Error when trying to install CNS make install compiler=gfortran

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.
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
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

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

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

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.

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.

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.

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.

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