sequencing / isaac_aligner

Isaac Genome Alignment Software
Other
37 stars 8 forks source link

link to librt #7

Closed ernfrid closed 10 years ago

ernfrid commented 10 years ago

linking currently fails because librt isn't specified in the linker commands. This adds it, but doesn't check for its existence. This build process is a little more complicated than what I'm personally used to so there may be additional checks that are needed. This allowed us to compile on both Ubuntu 10.04 and 12.10.

rpetrovski commented 10 years ago

iSAAC should not be using librt directly. Can you please post the linker errors?

ernfrid commented 10 years ago

Certainly!

Linking CXX executable isaac-align
/usr/bin/ld: ../lib/build/libisaac_build.a(BinSorter.cpp.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5'
/usr/bin/ld: note: 'clock_gettime@@GLIBC_2.2.5' is defined in DSO /lib64/librt.so.1 so try adding it to the linker command line
/lib64/librt.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [c++/bin/isaac-align] Error 1
make[1]: *** [c++/bin/CMakeFiles/isaac-align.dir/all] Error 2
make: *** [all] Error 2

In case it is helpful:

gcc --version
gcc (Ubuntu/Linaro 4.6.4-1ubuntu1~10.04) 4.6.4
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ld --version
GNU ld (GNU Binutils for Ubuntu) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

We observed similar errors with Ubuntu 12.04 although in this case they were of a slightly different form:

Linking CXX executable isaac-reorder-reference

../../bootstrap/lib/libboost_thread.a(thread.o): In function `boost::this_thread::hiden::sleep_until(timespec const&)':

thread.cpp:(.text+0x1660): undefined reference to `clock_gettime'

thread.cpp:(.text+0x16d1): undefined reference to `clock_gettime'

thread.cpp:(.text+0x173c): undefined reference to `clock_gettime'

thread.cpp:(.text+0x17a7): undefined reference to `clock_gettime'

thread.cpp:(.text+0x1812): undefined reference to `clock_gettime'

../../bootstrap/lib/libboost_thread.a(thread.o):thread.cpp:(.text+0x187d): more undefined references to `clock_gettime' follow

collect2: ld returned 1 exit status

make[2]: *** [c++/bin/isaac-reorder-reference] Error 1

make[1]: *** [c++/bin/CMakeFiles/isaac-reorder-reference.dir/all] Error 2

make: *** [all] Error 2

Both were resolved by adding in the rt library as in the pull request.

rpetrovski commented 10 years ago

I've put in an update iSAAC-01.14.04.01 which adds librt if it is available. Please tell me if this fixes the issue.

Roman.

ernfrid commented 10 years ago

Yes, iSAAC now links without error! I still need to run the configuration twice in order for the redistributed Boost libraries to be detected (as described in issue #8).