# Error when trying to install CNS make install compiler=gfortran

**URL:** <https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806>\
**Category:** HADDOCK\
**Tags:** haddock\
**Created:** [July 14, 2025, 6:38am UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806 "2025-07-14T06:38:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shinyi](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shinyi](https://ask.bioexcel.eu/u/shinyi)\
**Post date:** [July 14, 2025, 6:38am UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/1 "2025-07-14T06:38:04Z")

</div>

Hi,

I have been keep trying to run the compiler makefile but fail to do so. Anybody can help me on this? I’m not sure where do i get wrong steps, but i just do as follow on the guid on this link [haddock3/docs/CNS.md at main · haddocking/haddock3 · GitHub](https://github.com/haddocking/haddock3/blob/main/docs/CNS.md).  
By the way i’m using WSL for this installation. Any help will be gratefully appreciated. Thank you  
Error list is:  
(base) xxxx:/mnt/c/wsl/cns\_solve\_1.3$ make install compiler=gfortran  
Installation directory: /mnt/c/wsl/cns\_solve\_1.3/intel-x86\_64bit-linux  
copying files in instlib directory intel-x86\_64bit-linux to intel-x86\_64bit-linux  
[0read.me](http://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  
Segmentation fault (core dumped)  
linking source files to intel-x86\_64bit-linux/source  
Segmentation fault (core dumped)  
removing old object files  
linking machine\_f.f to source directory  
linking machine\_c.c to source directory  
linking generic fft file to source directory  
making Makefile in source directory  
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 -static  
linking: gfortran -w -static-libgfortran  
Fortran compiler passes test  
making utility programs  
make relink  
make default  
gfortran -o PSmapx -w -O PSmapx.f  
gfortran -o PSmapy -w -O PSmapy.f  
gfortran -o PSmapz -w -O PSmapz.f  
gcc -o to\_cns -O to\_cns.c -lm  
to\_cns.c:65:1: warning: return type defaults to ‘int’ [-Wimplicit-int]  
65 | main(int argc, char _argv[]) {  
| ^~~~  
to\_cns.c: In function ‘read\_header’:  
to\_cns.c:231:5: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
231 | fscanf(stream,“%d”,&nindex);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:232:5: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
232 | fscanf(stream,“%d”,&ndata);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:233:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
233 | fgets(line,MAXLINE,stream);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:234:5: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
234 | fgets(line,MAXLINE,stream);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:242:5: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
242 | fscanf(stream,“%d %d %d %d\n”,&nindex,&ndata,&nextra,&ninfo);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:249:7: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
249 | fgets(info,MAXLINE,stream);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:252:7: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
252 | fscanf(stream,“%s”,index);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:256:7: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
256 | fscanf(stream,“%s”,data);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c:265:7: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-resul]  
265 | fscanf(stream,“%s”,extra);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~  
to\_cns.c: In function ‘read\_reflections’:  
to\_cns.c:282:16: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
282 | if ( ! fscanf(stream,“%d %d %d %lf %lf %lf %lf %lf %lf”,  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
283 | &h, &k, &l,  
| ~~~~~~~~~~~  
284 | &mean\_i, &mean\_s,  
| ~~~~~~~~~~~~~~~~~  
285 | &plus\_i, &plus\_s,  
| ~~~~~~~~~~~~~~~~~  
286 | &minus\_i, &minus\_s) == 9 ) {  
| ~~~~~~~~~~~~~~~~~~~  
to\_cns.c:335:16: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
335 | if ( ! fscanf(stream,“%d %d %d %lf %lf”,  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
336 | &h, &k, &l,  
| ~~~~~~~~~~~  
337 | &mean\_i, &mean\_s) == 5 ) {  
| ~~~~~~~~~~~~~~~~~  
to\_cns.c: In function ‘get\_hkl\_refs’:  
to\_cns.c:431:3: warning: ignoring return value of ‘fgets’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
431 | fgets(line,MAXLINE,stream);  
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~  
g++ -o cluster\_struc -O cluster\_struc.cpp -lm  
cluster\_struc.cpp: In function ‘int main(int, char_\*)’:  
cluster\_struc.cpp:122:10: warning: ignoring return value of ‘char\* fgets(char\*, int, FILE\*)’ declared with attribute ‘warn\_unused\_result’ [-Wunused-result]  
122 | fgets(buf, 1000, f);  
| ~~~^~~~~~~~~~~~  
lex refloat.l  
gcc -O -o refloat lex.yy.c -lm -lfl  
make clean

flags:  
fortran → [gfortran] -fdefault-integer-8 -w -fallow-argument-mismatch -O3 -funroll-loops -ffast-math -static  
c → [gcc] -O -DINTEGER=‘long int’ -DCNS\_ARCH\_TYPE\_LINUX  
link → [gfortran] -w -static-libgfortran

compiling: Segmentation  
gfortran: warning: Segmentation: linker input file unused because linking not done  
gfortran: error: Segmentation: linker input file not found: No such file or directory  
make[3]: \*\*\* [Makefile:64: Segmentation] Error 1  
compiling: fault  
gfortran: warning: fault: linker input file unused because linking not done  
gfortran: error: fault: linker input file not found: No such file or directory  
make[3]: \*\*\* [Makefile:64: fault] Error 1  
/bin/sh: 2: Syntax error: “(” unexpected  
make[3]: \*\*\* [Makefile:64: (core] Error 2  
/bin/sh: 2: Syntax error: “)” unexpected  
make[3]: \*\*\* [Makefile:64: dumped)] Error 2

compiling: dmemory.c

compiling: machine\_c.c  
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:** [July 14, 2025, 1:34pm UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/2 "2025-07-14T13:34:36Z")

</div>

Did you try to match the Makefile’s header to the one under section 3 (Makefile) of the online CNS instructions?

Also on WSL a `pip install` (or `pip install .`) might work directly, installing the proper CNS executable.

Check: [https://www.bonvinlab.org/haddock3-user-manual/install.html](https://www.bonvinlab.org/haddock3-user-manual/install.html)

---

<div class="post-metadata">

**Author:** ![shinyi](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shinyi](https://ask.bioexcel.eu/u/shinyi)\
**Post date:** [July 15, 2025, 12:27pm UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/3 "2025-07-15T12:27:50Z")

</div>

Hi Prof,

Thank you so much for the reply. I retry the full steps from the link i still get the same error when running until step

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/bioexcel/original/2X/5/575a62615f98217a275b7fbd994901f064c73e1a.png)

I also tried just build a new environment with just pip install . and run the haddock3 config.toml

this is my toml file looks like:

# === General parameters ===

run\_dir = “run1-docking”  
ncores = 4

molecules = [  
“data/xxx.pdb”,  
“data/xxx.pdb”  
]

[topoaa]

[rigidbody]

[seletop]  
select = 10

[clustfcc]  
strictness = 0.75

[clustrmsd]

The error i got from running haddock3 config.toml is below

Traceback (most recent call last):  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/libs/libutil.py”, line 378, in log\_error\_and\_exit  
yield  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/clis/cli.py”, line 193, in main  
workflow.run()  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/libs/libworkflow.py”, line 43, in run  
step.execute()  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/libs/libworkflow.py”, line 173, in execute  
self.module.run() # type: ignore  
^^^^^^^^^^^^^^^^^  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/modules/base\_cns\_module.py”, line 61, in run  
self.\_run()  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/modules/sampling/rigidbody/ **init**.py”, line 250, in \_run  
self.export\_io\_models(faulty\_tolerance=self.params[“tolerance”])  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/modules/ **init**.py”, line 309, in export\_io\_models  
self.finish\_with\_error(\_msg)  
File “/home/shinyi/haddock3/.haddock3-env/lib/python3.12/site-packages/haddock/modules/ **init**.py”, line 317, in finish\_with\_error  
raise RuntimeError(reason)  
RuntimeError: 100.00% of output was not generated for this module and tolerance was set to 5.00%.

Just some extra information the both pdb file i am able to run it on the website Haddock server, so the pdb file should have no issues.

Really need some guidance on this. And again thank you so much for the help.

---

<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:** [July 15, 2025, 12:48pm UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/4 "2025-07-15T12:48:53Z")

</div>

Try to go into the `unknown…/source` directory in your CNS installation directory (or whatever directory was created when giving the make install command)

Edit the Makefile in that directory to match the header described in the CNS installation instructions.

Then in the same directory type:

`make cns_solve`

And see if it compiles… If successful there should be a cns… .exe file created.  
If present call it from the command line to see if you get the CNS prompt.

---

<div class="post-metadata">

**Author:** ![shinyi](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shinyi](https://ask.bioexcel.eu/u/shinyi)\
**Post date:** [August 23, 2025, 6:40am UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/5 "2025-08-23T06:40:37Z")

</div>

Hi Prof,

Hope it is finding you well, I’m sorry that I’m being busy lately. I retry again with the changes on the makefile header in the source file just like this.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/bioexcel/original/2X/8/8102ed14e0cfe9577ddd16eb190042d079229b81.png)

But i still fail in running make cns\_solve

The error logs is below:

make[1]: Entering directory ‘/mnt/c/WSL/cns\_solve\_1.3/intel-x86\_64bit-linux/source’

flags:  
fortran → [gfortran] -fdefault-integer-8 -w -fallow-argument-mismatch -O3 -funroll-loops -ffast-math -march=native -mtune=native  
c → [gcc] -O -DINTEGER=‘long int’ -DCNS\_ARCH\_TYPE\_  
link → [gfortran] -w -static-libgfortran

make[1]: Leaving directory ‘/mnt/c/WSL/cns\_solve\_1.3/intel-x86\_64bit-linux/source’  
make[1]: Entering directory ‘/mnt/c/WSL/cns\_solve\_1.3/intel-x86\_64bit-linux/source’  
compiling: Segmentation  
gfortran: warning: Segmentation: linker input file unused because linking not done  
gfortran: error: Segmentation: linker input file not found: No such file or directory  
make[1]: \*\*\* [Makefile:64: Segmentation] Error 1  
compiling: fault  
gfortran: warning: fault: linker input file unused because linking not done  
gfortran: error: fault: linker input file not found: No such file or directory  
make[1]: \*\*\* [Makefile:64: fault] Error 1  
/bin/sh: 2: Syntax error: “(” unexpected  
make[1]: \*\*\* [Makefile:64: (core] Error 2  
/bin/sh: 2: Syntax error: “)” unexpected  
make[1]: \*\*\* [Makefile:64: dumped)] Error 2  
make[1]: Target ‘../bin/cns\_solve’ not remade because of errors.  
make[1]: Leaving directory ‘/mnt/c/WSL/cns\_solve\_1.3/intel-x86\_64bit-linux/source’  
make: \*\*\* [Makefile:59: cns\_solve] Error 2

Can you help me on this? And thank you so much for spending your time to help me solve this. Hope to get your help soon.

---

<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:** [August 23, 2025, 8:05am UTC](https://ask.bioexcel.eu/t/error-when-trying-to-install-cns-make-install-compiler-gfortran/5806/6 "2025-08-23T08:05:05Z")

</div>

It looks like you are compiling it under a Window Linux subsystem, correct?

Did you simply try a `pip install` - this would install a CNS executable. Check the installation and development instructions in the haddock3 directory
