When running the unit tests via make check inside a conda environment, the linking of testRNAblueprint fails with the following error message:
/home/felix/miniconda3/envs/rnablueprint/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: testRNAblueprint-main.o: in function `boost::unit_test::timer::timer::elapsed() const':
main.cc:(.text._ZNK5boost9unit_test5timer5timer7elapsedEv[_ZNK5boost9unit_test5timer5timer7elapsedEv]+0x45): undefined reference to `clock_gettime'
/home/felix/miniconda3/envs/rnablueprint/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: testRNAblueprint-main.o: in function `boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*)':
main.cc:(.text._ZN5boost9unit_test9framework5state17execute_test_treeEmmPKNS2_23random_generator_helperE[_ZN5boost9unit_test9framework5state17execute_test_treeEmmPKNS2_23random_generator_helperE]+0x5b3): undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status
Makefile:674: recipe for target 'testRNAblueprint' failed
make[2]: *** [testRNAblueprint] Error 1
My conda env was created using the following command:
conda create -n rnablueprint c-compiler python boost cxx-compiler perl swig automake autoconf libtool m4
The problem seems to be that clock_gettime needs to be linked with -lrt, cf. man clock_gettime. There it sais " Link with -lrt (only for glibc versions before 2.17)." Adding -lrt to testRNAblueprint_LDADD in tests/Makefile.am solves this problem. librt is part of the Linux Standard Base specification, so it should be present everywhere (?).
When running the unit tests via
make checkinside a conda environment, the linking oftestRNAblueprintfails with the following error message:My conda env was created using the following command:
The problem seems to be that
clock_gettimeneeds to be linked with-lrt, cf.man clock_gettime. There it sais " Link with -lrt (only for glibc versions before 2.17)." Adding-lrttotestRNAblueprint_LDADDintests/Makefile.amsolves this problem. librt is part of the Linux Standard Base specification, so it should be present everywhere (?).