# CNS Installation - Segmentation Fault

**URL:** <https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677>\
**Category:** HADDOCK\
**Created:** [May 16, 2025, 7:10pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677 "2025-05-16T19:10:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 16, 2025, 7:10pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/1 "2025-05-16T19:10:15Z")

</div>

Hello,

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

```auto
 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:

```auto
  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!

---

<div class="post-metadata">

**Author:** ![regen](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@regen](https://ask.bioexcel.eu/u/regen)\
**Post date:** [May 19, 2025, 12:21am UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/2 "2025-05-19T00:21:04Z")

</div>

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

For haddock2?

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [May 19, 2025, 6:56am UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/3 "2025-05-19T06:56:29Z")

</div>

not the case for haddock2

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

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 19, 2025, 7:28pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/4 "2025-05-19T19:28:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [May 19, 2025, 9:29pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/5 "2025-05-19T21:29:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 20, 2025, 4:50pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/6 "2025-05-20T16:50:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 20, 2025, 10:10pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/7 "2025-05-20T22:10:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [May 21, 2025, 5:21am UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/8 "2025-05-21T05:21:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 21, 2025, 10:59pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/9 "2025-05-21T22:59:11Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [May 22, 2025, 2:59am UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/10 "2025-05-22T02:59:53Z")

</div>

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

[

| 

 ![97be5584-db7b-4a0a-80d2-2aba6114567b.png](https://europe1.discourse-cdn.com/flex013/uploads/bioexcel/original/2X/a/af50eb67052495f5d320e44e06ab5e8e22aba040.png)

 |

| 

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

 |

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

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [May 22, 2025, 6:35pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/11 "2025-05-22T18:35:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [May 23, 2025, 7:44am UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/12 "2025-05-23T07:44:50Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [June 3, 2025, 4:32pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/13 "2025-06-03T16:32:29Z")

</div>

Still no luck with that error. I tried running haddock with the cns as is and after running one of the examples for an hour, there are still no completed structures.

```auto

[2025-06-03 12:31:17] stage 0: 1000 structures remaining, 54 running, 0 completed, 1000 total
[2025-06-03 12:31:17] FIX: Modifying random seed for it 0 structure 1
[2025-06-03 12:31:17] Waiting to restart job...
[2025-06-03 12:31:17] FIX: Modifying random seed for it 0 structure 2
[2025-06-03 12:31:17] Waiting to restart job...
[2025-06-03 12:31:17] FIX: Modifying random seed for it 0 structure 3
[2025-06-03 12:31:17] Waiting to restart job...
[2025-06-03 12:31:17] FIX: Modifying random seed for it 0 structure 4
[2025-06-03 12:31:17] Waiting to restart job...

```

Would this be as a direct result of the CNS compilation error or could it be something else?

Thanks

---

<div class="post-metadata">

**Author:** ![amjjbonvin](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/amjjbonvin/32/23_2.png) [@amjjbonvin](https://ask.bioexcel.eu/u/amjjbonvin)\
**Post date:** [June 3, 2025, 6:28pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/14 "2025-06-03T18:28:37Z")

</div>

What is the content of the run directory? Any .out files?

Check their content. Start at the bottom of the file to search for errors.

Also are there pdb and psf files in the begin directory. There should be.  
it looks like your rigid body is failing for some reason.

---

<div class="post-metadata">

**Author:** ![dawno](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dawno](https://ask.bioexcel.eu/u/dawno)\
**Post date:** [June 3, 2025, 7:45pm UTC](https://ask.bioexcel.eu/t/cns-installation-segmentation-fault/5677/15 "2025-06-03T19:45:16Z")

</div>

I think I found the issue. I was submitting the jobs using batch submit and sbatch on my HPC but that just wasn’t working. I have it working now using bash and the default queue submission script.

However, eventually, I do want to utilize my HPC fully. Is there a way to do that using bash and the default queue submission method?

Thanks!
