The HADDOCK category is meant to discuss any HADDOCK-related issue. For general information about HADDOCK refer to HADDOCK – Bonvin Lab
Dear HADDOCK team,
I am currently attempting to compile CNS for integration with HADDOCK3, and I’d like to describe my current setup and the steps I’ve taken so far:
1. System Environment:
- Linux system,
x86_64
architecture - No root privileges
tcsh
installed via Conda (conda install -c conda-forge tcsh
)- Created a symbolic link from
tcsh
tocsh
in~/bin/
, and added this path to$PATH
2. CNS Setup & Adjustments:
- I cloned the HADDOCK3 repository from GitHub (
https://github.com/haddocking/haddock3
), but thevaria/cns1.3/
directory only containsgetarch
, and does not include the patched CNS files necessary to build CNS:- Missing:
bin/install
,bin/depend
,bin/objects
,bin/modify_path
, patchedsource/
files, etc.
- Missing:
- I obtained a
cns_solve_1.3
directory separately and attempted to compile it.
3. Manual Modifications for Compatibility:
To allow CNS scripts to run with my environment (no /bin/csh
, only Conda-installed tcsh
), I made the following changes:
-
Edited all CNS scripts (
bin/install
,bin/modify_path
, etc.) and changed the shebang lines: -
#!/bin/csh -f to #!/usr/bin/env csh
-
Modified the
Makefile
to set: CSHELL = /home/data/t210416/bin/csh -
Compilation Progress
csh
source ./cns_solve_env
setenv CNS_ARCH intel-x86_64bit-linux
./bin/install
Installation directory: /home/data/t210416/biosoft/cns/cns_solve_1.3/intel-x86_64bit-linux
copying files in instlib directory intel-x86_64bit-linux to intel-x86_64bit-linux
0read.me
arch_env
machine_c.c
machine_f.f
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
Using Makefile template for compiler: gfortran
removing old source files
linking source files to intel-x86_64bit-linux/source
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
/bin/sh: 1: ../../bin/objects: not found
/bin/sh: 12: ../../bin/depend: not found
make[1]: *** [Makefile.proto:67: makefiles] Error 127
make: *** [Makefile:131: makefiles] Error 2
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: error: return type defaults to 'int' [-Wimplicit-int]
65 | main(int argc, char *argv[]) {
| ^~~~
make[3]: *** [Makefile:28: to_cns] Error 1
make[2]: *** [Makefile:21: utils] Error 2
make[1]: *** [Makefile.header:26: compile-utils] Error 2
make: *** [Makefile:60: utils] Error 2
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: dmemory.c
compiling: machine_c.c
linking: cns_solve
/home/data/t210416/miniconda3/envs/haddock_3.9/bin/../lib/gcc/x86_64-conda-linux-gnu/14.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/data/t210416/miniconda3/envs/haddock_3.9/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
problems with new executable - old version retained
I was unable to obtain the working cns
executable, and I am not sure where exactly the error occurred.
I would greatly appreciate your guidance in resolving this issue.