PDB-REDO/dssp

Error in cmake build

Closed this issue · 2 comments

I get the below error when running cmake --build . for both mrc and dssp. libcifcpp seems to compile just fine

/bin/ld: CMakeFiles/mrc-unit-test.dir/mrc-unit-test.cpp.o: in function `boost::unit_test::timer::timer::elapsed() const':
mrc-unit-test.cpp:(.text._ZNK5boost9unit_test5timer5timer7elapsedEv[_ZNK5boost9unit_test5timer5timer7elapsedEv]+0x43): undefined reference to `clock_gettime'

cmake version 3.24.0
cpp (conda-forge gcc 10.4.0-16) 10.4.0
cc (conda-forge gcc 10.4.0-16) 10.4.0
GNU ld (GNU Binutils) 2.36.1
CentOS Linux 8

Just out of curiosity, why are you using such an old system?

If you look at the man page for clock_gettime you will see:

   Link with -lrt (only for glibc versions before 2.17).

So you will have to include this to the linker flags. You can do that by modifying the CMakeLists.txt files. For mrc add rt to the link_libraries statement on line 63. For libcifpp you might get away by adding it to the target_link_libraries instruction at line 252.

Interestingly, my version shows as:
GNU libc version: 2.28

I added the flags and it worked though. Thank you for the quick response