CNS Installation - Segmentation Fault

Hello,

I am running into issues compiling CNS. I keep getting this error after following the guide:

 make install
Installation directory: /home/.../haddock2.5/software/cns_solve_1.3/intel-x86_64bit-linux
copying files in instlib directory intel-x86_64bit-linux to intel-x86_64bit-linux
0read.me
Makefile.header.1.ifort
Makefile.header.2.gfortran
Makefile.header.3.ifort_mp
Makefile.header.4.pgf95
Makefile.header.5.ifort_mp_profile
Makefile.header.6.ifort_mp_tcheck
Makefile.header.7.gfortran_mp
arch_env
machine_c.c
machine_f.f
Using Makefile template for compiler: gfortran
linking source files to intel-x86_64bit-linux/source
Segmentation fault
make: *** [Makefile:38: install] Error 139

System Information:

  Kernel: 5.15.167.4-microsoft-standard-WSL2 arch: x86_64 bits: 64
    compiler: gcc v: 11.2.0
  Desktop: N/A dm: N/A Distro: Ubuntu 24.04.2 LTS (Noble Numbat)
CPU:
  Info: 8-core model: 12th Gen Intel Core i5-1240P bits: 64 type: MT MCP
    arch: Alder Lake rev: 3 cache: L1: 640 KiB L2: 10 MiB L3: 12 MiB
  Speed (MHz): avg: 2112 min/max: N/A cores: 1: 2112 2: 2112 3: 2112 4: 2112
    5: 2112 6: 2112 7: 2112 8: 2112 9: 2112 10: 2112 11: 2112 12: 2112 13: 2112
    14: 2112 15: 2112 16: 2112 bogomips: 67584
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Microsoft Basic Render Driver driver: dxgkrnl v: 2.0.3
    bus-ID: 4982:00:00.0 chip-ID: 1414:008e
  Display: wayland server: Microsoft Corporation X.org driver: dri: swrast
    gpu: dxgkrnl display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1024x768 s-dpi: 96
  Monitor-1: XWAYLAND0 res: 1024x768 size: N/A
  API: EGL v: 1.5 platforms: device: 1 drv: swrast surfaceless: drv: swrast
    x11: drv: swrast inactive: gbm,wayland,device-0
  API: OpenGL v: 4.1 vendor: microsoft mesa v: 24.2.8-1ubuntu1~24.04.1
    glx-v: 1.4 direct-render: yes renderer: D3D12 (Intel UHD Graphics)
    device-ID: ffffffff:ffffffff
Drives:
  Local Storage: total: 1 TiB used: 4.9 GiB (0.5%)
  ID-1: /dev/sda model: Virtual Disk size: 388.4 MiB serial: N/A
  ID-2: /dev/sdb model: Virtual Disk size: 2 GiB serial: N/A
  ID-3: /dev/sdc model: Virtual Disk size: 1024 GiB serial: N/A
Partition:
  ID-1: / size: 1006.85 GiB used: 4.9 GiB (0.5%) fs: ext4 dev: /dev/sdc
Swap:
  ID-1: swap-1 type: partition size: 2 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/sdb
Info:
  Memory: total: 8 GiB note: est. available: 7.61 GiB used: 720.8 MiB (9.2%)
  Processes: 34 Power: uptime: 9h 8m Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: dpkg pkgs: 641 Compilers: gcc: 13.3.0 Shell: Bash v: 5.2.21
    running-in: Relay(54071) inxi: 3.3.34

Does anyone know what could be the cause? Or how to get around it?

Thanks!

Haddock3 can be installed by pip install haddock3 now and doesn’t need to compile CNS anymore.

For haddock2?

not the case for haddock2

But we do provide links to CNS executables in the email containing the instructions

Hello,
I’m trying to install haddock2.5. I followed the provided instructions on compiling the CNS executable.

Did you simply try to use a pre-compiled executable?

I have tried, but haven’t had much success with pre-compiled executables from other working haddock installs

Is there a way to use a pre-compiled executable but update the CNS_solve location variable?

haddock only needs the executable - it is defined in run.cns - nothing else

I recompiled a CNS executable I thought was working but now I see it does not fully compile while building an apptainer image:

making Makefile in source directory
making compiler-test directory in intel-x86_64bit-linux
testing Fortran and C compilers
compiling: gcc -O -DINTEGER='long int' -DCNS_ARCH_TYPE_LINUX 
C compiler passes test
compiling: gfortran -fdefault-integer-8 -w -fallow-argument-mismatch -O3  -funroll-loops -ffast-math -march=native -mtune=native  
linking: gfortran -w  -static-libgfortran
Fortran compiler passes test
making utility programs
make[2]: *** No rule to make target 'compile-utils'.  Stop.
make[1]: *** [Makefile:60: utils] Error 2

Our most up to date instructions for compiling CNS can be found at:

[

haddock3/docs/CNS.md at main · haddocking/haddock3
github.com

](https://github.com/haddocking/haddock3/blob/main/docs/CNS.md)

Thank you, I have followed these instructions but I still can’t get past the Error 2.

Try the following:

go directly into the intel-x86_64bit-linux/source directory and type make cns_solve

Also best to use a rather recent version of gcc/gfortran (e.g. 13 or 14)