ncbi / ngs

NGS Language Bindings
Other
118 stars 52 forks source link

Unable to build examples #31

Closed taltman closed 3 years ago

taltman commented 3 years ago
(base) ubuntu@ip-172-31-72-183:~/tmp/ngs-sdk.2.10.8-linux/share$ export LD_LIBRARY_PATH=$HOME/tmp/ngs-sdk.2.10.8-linux/lib64
(base) ubuntu@ip-172-31-72-183:~/tmp/ngs-sdk.2.10.8-linux/share$ make
c++  -I/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64//../include -I/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64//../include -g -o AlignSliceTest AlignSliceTest.cpp -L/home\
/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64/ -L/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64/ -lncbi-ngs-c++ -lngs-c++ -lngs-bam-c++ -lncbi-ngs-c++ -lncbi-vdb-static -lngs-ada\
pt-c++ -lpthread -ldl -lm
/tmp/ccE6sCHo.o: In function `main':
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/share/AlignSliceTest.cpp:112: undefined reference to `ncbi::NGS::setAppVersionString(std::__cxx11::basic_string<char, std::char_tr\
aits<char>, std::allocator<char> > const&)'
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/share/AlignSliceTest.cpp:118: undefined reference to `ngs::ErrorMsg::toString[abi:cxx11]() const'
/tmp/ccE6sCHo.o: In function `ngs::Alignment::getReferenceSpec[abi:cxx11]() const':
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64//../include/ngs/inl/Alignment.hpp:58: undefined reference to `ngs::StringRef::toString[abi:cxx11]() const'
/tmp/ccE6sCHo.o: In function `ngs::ReadCollection::getName[abi:cxx11]() const':
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/lib64//../include/ngs/inl/ReadCollection.hpp:48: undefined reference to `ngs::StringRef::toString[abi:cxx11]() const'
/tmp/ccE6sCHo.o: In function `AlignSliceTest::run_csra(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char,\
 std::char_traits<char>, std::allocator<char> >, int, int)':
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/share/AlignSliceTest.cpp:74: undefined reference to `ncbi::NGS::openReadCollection(std::__cxx11::basic_string<char, std::char_trai\
ts<char>, std::allocator<char> > const&)'
/tmp/ccE6sCHo.o: In function `AlignSliceTest::run_bam(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, \
std::char_traits<char>, std::allocator<char> >, int, int)':
/home/ubuntu/tmp/ngs-sdk.2.10.8-linux/share/AlignSliceTest.cpp:81: undefined reference to `NGS_BAM::openReadCollection(std::__cxx11::basic_string<char, std::char_traits\
<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
Makefile:85: recipe for target 'AlignSliceTest' failed
make: *** [AlignSliceTest] Error 1
aboshkin commented 3 years ago

Which C++ compiler are you using (c++ -v)? Did you download the NGS libraries, or built from sources?

taltman commented 3 years ago

Thank you for your fast reply!

I downloaded the tar-ball from the Download page on the wiki. Here is the C++ complier info (below). Please let me know if I can send any further debugging info. Thanks in advance for your help!

ubuntu@ip-172-31-72-183:~/tmp/ngs-sdk.2.10.8-linux/share$ c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,\
go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-\
id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-deb\
ug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie \
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,m\
x32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-lin\
ux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
taltman commented 3 years ago

Also, I tried turning off Conda with conda deactivate, and that didn't change the error output nor the c++ version.

taltman commented 3 years ago

Good morning! Any thoughts about how I can proceed, @aboshkin? I need to compile HISAT2 with SRA mode enabled, and unfortunately this issue is blocking me. Any help would be greatly appreciated. Thanks in advance!

aboshkin commented 3 years ago

@taltman good morning! The likely root cause is the fact that you are using a newer version of the C++ (7.5) compiler than the one that was used to build the libraries in the tarballs (4.8 - I know...). We will discuss upgrading our toolchain; in the meantime you can try to build the libraries yourself: the instructions are in https://github.com/ncbi/ngs/wiki/Building-and-Installing-from-Source and https://github.com/ncbi/ncbi-vdb/wiki/Building-and-Installing-from-Source If you have any trouble building, do not hesitate to ask here.

taltman commented 3 years ago

@aboshkin Thanks for pointing out that issue. I'll take a stab at compiling everything from scratch, and I'll let you know how it goes. Cheers!

taltman commented 3 years ago

I can confirm that the libraries get built & installed correctly. It allowed me to compile HISAT2 from scratch with SRA capabilities enabled. Thank you for your help @aboshkin!