# CNS errors before/after recompilation

**URL:** <https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54>\
**Category:** HADDOCK\
**Created:** [April 7, 2016, 8:34am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54 "2016-04-07T08:34:33Z")\
**Posts on this page:** 20\
**Page:** 3

<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:** [October 8, 2020, 1:02pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/41 "2020-10-08T13:02:58Z")

</div>

Did you copy the files provided with HADDOCK in the cns1.3 directory into the cns source directory?

And recompile?

Also make sure to point to the latest compiled version of cns

---

<div class="post-metadata">

**Author:** ![Marija](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/marija/32/278_2.png) [@Marija](https://ask.bioexcel.eu/u/Marija)\
**Post date:** [October 8, 2020, 3:06pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/42 "2020-10-08T15:06:48Z")

</div>

Thank you very much for your prompt reply.

Unfortunately I still could not solve the problem and topology files are still not generated. I tried the following:  
I have copied all files from software/cns13 to software/cns\_solve\_1.3/intel-x86\_64bit-linux/source and run in this folder

```
make cns_solve

```

it run but I got a message at the end:

```
collect2: error: ld returned 1 exit status
problems with new executable - old version retained

```

Although I have noticed that e.g. parameters in rtf.inc were rewritten.  
Thereafter, I went to software/cns\_solve\_1.3 and under tcsh venvironment run:

```
source cns_solve_env 

```

whereby in cns\_solve\_env setenv is set to the path to cns\_solve\_13:

```
setenv CNS_SOLVE 'path_to_software/software/cns_solve_1.3' 

```

Did I maybe miss some steps or does cns compilation work in some other way?  
Thank you.

---

<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:** [October 8, 2020, 3:52pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/43 "2020-10-08T15:52:30Z")

</div>

Make a fresh installation of cns and copy first the haddock-provided files into the main source directory before starting the compilation

---

<div class="post-metadata">

**Author:** ![Marija](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/marija/32/278_2.png) [@Marija](https://ask.bioexcel.eu/u/Marija)\
**Post date:** [October 9, 2020, 11:51am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/44 "2020-10-09T11:51:30Z")

</div>

Thank you very much for help, everything works now.  
Below I just summarize what I have done to install CNS v1.3 on Centos7.7 and to link CNS to the local version of HADDOCK2.4:  
-\> After registration at [http://cns-online.org/cns\_request/](http://cns-online.org/cns_request/), download cns\_solve\_xyz.tar.gz file “xyz = cns\_solve downloaded version”  
-\> Enter the command in terminal: gunzip cns\_solve\_xyz.tar.gz  
-\> Then enter: tar xvf cns\_solve\_xyz.tar  
-\> This will create a new cns\_solve\_13 directory. Now copy all files from haddock2.4/cns1.3/ to cns\_solve\_1.3/source  
-\> Now enter into cns\_solve\_1.3 directory and type: make install  
-\> Copy the path of the directory.  
-\> Now open the file cns\_solve\_env and paste the copied path in place of ‘location of CNSsolve directory’  
-\> Go to the directory cns\_solve\_1.3/intel-x86\_64bit-linux/source  
-\> Type: make cns\_solve  
-\> Then go back to cns\_solve\_1.3 directory, and enter the command: tcsh  
-\> Then you entered into C-shell, now enter the command: source cns\_solve\_env  
-\> Then enter: cns  
-\> Your software should run without any error.

---

<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:** [October 9, 2020, 1:37pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/45 "2020-10-09T13:37:35Z")

</div>

Thanks for describing all the steps!

Note that for the `bash` fans among you, there is actually a version of `cns_solve_env` for it.  
It is however kind of hidden since it starts with a dot: `.cns_solve_env_sh`

---

<div class="post-metadata">

**Author:** ![jbibbe](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/jbibbe/32/432_2.png) [@jbibbe](https://ask.bioexcel.eu/u/jbibbe)\
**Post date:** [April 28, 2021, 12:58pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/46 "2021-04-28T12:58:18Z")

</div>

I ran into an error while compiling CNS 1.3 on MacOS Catalina (10.15.7) using ifort. The compiler for C couldn’t find stdio.h so it couldn’t go on and compile the parts of the program that are written in C.  
I made sure that XCode’s CommandLineTools were installed and as up to date as they could be (not the most recent version because that one is for MacOS Big Sur).  
I also made sure that ifort and icc were working. I had to source the `/opt/intel/oneapi/setvars.sh` file for ifort and icc to work.  
This was not enough, because the compiler still could not find stdio.h. I had to edit the Makefile of CNS, change `CCFLAGS=-O` into `CCFLAGS="$(CCFLAGS)`" (4 lines above the bottom of the file) then in the command line (make sure it’s `tcsh`) enter:  
`setenv EXT_CCFLAGS "-I/foo"` with foo being the path to the stdio file. Then just enter `make install`.

---

<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:** [April 29, 2021, 7:51am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/47 "2021-04-29T07:51:27Z")

</div>

Thanks for providing those instructions.

---

<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:** [December 24, 2021, 8:42am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/48 "2021-12-24T08:42:25Z")

</div>

Drop me an email and I can share a pre-compiled executable.

---

<div class="post-metadata">

**Author:** ![mohammad-khatami](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mohammad-khatami](https://ask.bioexcel.eu/u/mohammad-khatami)\
**Post date:** [March 3, 2022, 5:27pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/49 "2022-03-03T17:27:03Z")

</div>

Hi @amjjbonvin,  
I am trying to figure out the source of an error I am getting when I am running haddock2.4. the structures keep crashing with the following error:

```auto
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x2b75ae4ebc5d in ???
#1 0x2b75ae4eae95 in ???
#2 0x2b75ae97097f in ???
#3 0x62172f in ???
#4 0x62c5cb in ???
#5 0x62e3ab in ???
#6 0x667c55 in ???
#7 0x66810e in ???
#8 0x434e1c in ???
#9 0x401afc in ???
#10 0x2b75ae95be1a in ???
#11 0x401b39 in ???
#12 0xffffffffffffffff in ???
Segmentation fault (core dumped)

```

The code tries to re-running the structures with new seeds, but those also crash.

---

<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:** [March 3, 2022, 7:16pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/50 "2022-03-03T19:16:21Z")

</div>

Is this with an executable you compiled yourself?

I assume you have a M1 processor? In that case check the following thread about compiling CNS:

> <https://github.com/haddocking/haddock3/issues/200>
>
> HADDOCK3 installation on an \*\*Ubuntu 21 (aarch64) VM running via 10 CPU MacBookP…ro M1\*\* was straightforward. Thank you for the instructions.
> 
> On the MacOS side, it is possible to make HADDOCK3 and run it \_but it does require a few manual steps\_. I used homebrew to provide the required software. 
> 
> Install \*\*homebrew\*\*, then the compiler and python modules and items required by haddock
> \_brew install gcc-11 pyenv hdf5 hwloc llvm@11 open-mpi openblas\_
> 
> \*\*build cns\_solve\_1.3 for arm64\*\*
> I transferred the updated source files from haddock2.4 to the source directory of cns\_solve\_1.3. I modified \_bin/getarch\_ to output mac-arm-darwin and then made the appropriate machine directory The machine directory includes a \_Makefile.6.gfortran\_ with references to gcc-11, g++-11 and gfortran-11 from homebrew. I made the binary as usual with make install compiler=gfortran. The 
> mac-arm64-darwin/source/cns\_solve...exe binary was linked to bin/cns in the HADDOCK3 directory
> 
> \*\*build HADDOCK3 for arm64\*\*
> install a compatible python and ensure that your shell's $PATH finds it first in \_~/.pyenv/shims\_
> \_pyenv install 3.9.9\_
> \_pyenv global 3.9.9\_
> 
> \*\*manually build two python modules\*\* from the requirements.txt file. 
> I downloaded \_h5py-3.6.0\_ and manually built it with the usual \_python setup.py install\_ 
> I downloaded \_llvmlite-0.37.0\_ and manually built it with the usual \_python setup.py install\_
> Afterwards the HADDOCK3 installation will complete
> 
> The job distributor on HADDOCK3 over the 10 CPUs available on my MacProBook 2021 works flawlessly... congratulations ! 
> 
> For what it's worth, I have successfully built \*\*XPLOR-NIH 3.4 for MacOS/arm64\*\* (and the speed relative to my 2019 intel i5 Mac, is \*\*\> 2x\*\* !).

If you are running on an intel Mac, I can provide you with an executable. Reach to me via email

---

<div class="post-metadata">

**Author:** ![mohammad-khatami](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mohammad-khatami](https://ask.bioexcel.eu/u/mohammad-khatami)\
**Post date:** [March 4, 2022, 1:23am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/51 "2022-03-04T01:23:49Z")

</div>

Yes, It’s with the executable I compiled. But it is happening on a Linux cluster:  
NAME=“CentOS Linux”  
VERSION=“7 (Core)”  
using Intel Skylake or Cascadelake cores at 2.4GHz.

I am putting the error here, which might be a help:

```auto
The following modules were not unloaded:
  (Use "module --force purge" to unload all):

  1) NiaEnv/2019b

Due to MODULEPATH changes, the following have been reloaded:
  1) mii/1.1.1

Lmod is automatically replacing "intel/2020.1.217" with "gcc/9.3.0".

Due to MODULEPATH changes, the following have been reloaded:
  1) openmpi/4.0.3

##############################################################################
# #
# Starting HADDOCK2.4 #
# #
# N-components version of HADDOCK (current maximum is 20) #
# #
# Copyright 2003-2020 Alexandre Bonvin, Utrecht University. #
# Originally adapted from Aria 1.2 from Nilges and Linge, EMBL. #
# All rights reserved. #
# This code is part of the HADDOCK software and governed by its #
# license. Please see the LICENSE file that should have been included #
# as part of this package. #
# #
##############################################################################
    
Starting HADDOCK on: 2022-03-03 20:17:20
 
HADDOCK version: 2.4 - May 2021 release
Python version: 2.7.18 (default, May 15 2020, 03:15:48) 
[GCC 9.3.0]
parsing run.cns file
parsing run.param in /gpfs/fs0/project/p/pmkim/mkhatami/work/3hsa/run1/data
reading parameters from the file /gpfs/fs0/project/p/pmkim/mkhatami/work/3hsa/run1/data/run.param
  setting some variables:
  N_COMP set to: 2
  RUN_NUMBER set to: 1
  HADDOCK_DIR set to: /home/p/pmkim/mkhatami/software/haddock2.4-2021-05
  CGTOAA_TBL set to: ./protein_shell_cg.tbl
  PROT_SEGID_2 set to: B
  PROT_SEGID_1 set to: A
  PDB_FILE1 set to: ./P02768-Albumin-1.pdb
  PDB_FILE2 set to: ./P02768-Albumin-2.pdb
  PROJECT_DIR set to: .
  CGPDB_FILE1 set to: ./P02768-Albumin-1_cg.pdb
  CGPDB_FILE2 set to: ./P02768-Albumin-2_cg.pdb
N_COMP 2
RUN_NUMBER 1
HADDOCK_DIR /home/p/pmkim/mkhatami/software/haddock2.4-2021-05
CGTOAA_TBL ./protein_shell_cg.tbl
PROT_SEGID_2 B
PROT_SEGID_1 A
PDB_FILE1 ./P02768-Albumin-1.pdb
PDB_FILE2 ./P02768-Albumin-2.pdb
PROJECT_DIR .
CGPDB_FILE1 ./P02768-Albumin-1_cg.pdb
CGPDB_FILE2 ./P02768-Albumin-2_cg.pdb
looking for existing files
waterdock false
  waiting for the psf files...
looking for iteration 0
working on iteration 0
increased number of structures requested for it0
  ==> regenerating file.nam file.list and file.cns in begin directory
starting DOCKING protocol 
FIX: Modifying random seed for it 0 structure 1
Waiting to restart job...
------------------------------------------------------------
Structure 1: crashed
------------------------------------------------------------

    calculating structure 1
      queue command:
      /bin/csh 3hsa_run1_it0_refine_1.job
------------------------------------------------------------
Structure 1: running
------------------------------------------------------------

```

---

<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:** [March 4, 2022, 8:41am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/52 "2022-03-04T08:41:40Z")

</div>

Email me directly and I will provide you an executable to test

---

<div class="post-metadata">

**Author:** ![mohammad-khatami](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mohammad-khatami](https://ask.bioexcel.eu/u/mohammad-khatami)\
**Post date:** [March 4, 2022, 2:11pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/53 "2022-03-04T14:11:59Z")

</div>

Thanks for giving me the idea that I could use another working executable. I had one and now the package works like a charm!

---

<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:** [March 4, 2022, 2:26pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/54 "2022-03-04T14:26:48Z")

</div>

Good! Happy docking then 🙂

---

<div class="post-metadata">

**Author:** ![aghdam](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@aghdam](https://ask.bioexcel.eu/u/aghdam)\
**Post date:** [December 12, 2022, 3:47pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/55 "2022-12-12T15:47:49Z")

</div>

Dear Amjjbovin,  
I’m using the compiled version of CNS and I have got an error like the above:

_EVALUATE: symbol $PSF\_INFILE\_1 set to “RUN:begin/gsk3b1.B99990546.psf” (string)_

- CNSsolve\> structure\*
- STRUcture\> @@$psf\_infile\_$nchain1\*
- %ASSFIL-ERR: error opening file .//begin/p1.psf\*
- %ASSFIL error encountered: Error accessing file\*
- (CNS is in mode: SET ABORT=NORMal END)\*

* * *

- ABORT mode will terminate program execution.\*

How can I fix it?

---

<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:** [December 12, 2022, 4:15pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/56 "2022-12-12T16:15:59Z")

</div>

I would suggest to start a fresh run (as you had issues with that one).

Something went wrong with the initial topo generation.

---

<div class="post-metadata">

**Author:** ![aghdam](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@aghdam](https://ask.bioexcel.eu/u/aghdam)\
**Post date:** [December 13, 2022, 2:22pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/57 "2022-12-13T14:22:51Z")

</div>

It’s the same as before.  
I think it is sth wrong with my pdb file.  
how would I find out the reason for this error?

---

<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:** [December 13, 2022, 4:56pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/58 "2022-12-13T16:56:22Z")

</div>

Check the out files in the begin directory and look for ERR messages starting from the bottom

Alternatively simply try our webserver 🙂

---

<div class="post-metadata">

**Author:** ![MarGra](https://dub1.discourse-cdn.com/flex013/user_avatar/ask.bioexcel.eu/margra/32/748_2.png) [@MarGra](https://ask.bioexcel.eu/u/MarGra)\
**Post date:** [March 29, 2023, 4:13pm UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/59 "2023-03-29T16:13:07Z")

</div>

hey can you help me with compilaion error please?

```auto
make[3]: *** [Makefile:64: xtarget.o] Error 1
make[3]: Target '../bin/cns_solve' not remade because of errors.
make[2]: *** [Makefile:59: cns_solve] Error 2
make[1]: *** [Makefile:64: cns_solve] 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:** [March 31, 2023, 11:30am UTC](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/60 "2023-03-31T11:30:14Z")

</div>

Here are some online instructions:

[https://www.bonvinlab.org/haddock3/CNS.html](https://www.bonvinlab.org/haddock3/CNS.html)

With the haddock2.4/5 installation you will find a cns1.3 directory - check also the README file there.

[Previous page](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54.md?page=2)

[Next page](https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54.md?page=4)
