Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link problem #10

Open
mianbaozhai opened this issue Aug 25, 2017 · 1 comment
Open

Link problem #10

mianbaozhai opened this issue Aug 25, 2017 · 1 comment

Comments

@mianbaozhai
Copy link

mianbaozhai commented Aug 25, 2017

Hi,
I tried to install armatus using cmake
cmake CMakeLists.txt -DBoost_NO_BOOST_CMAKE=TRUE -DCMAKE_INSTALL_PREFIX=~/software/armatus/
That's OK.

But, I have a problem when make install

Linking CXX executable armatus
cd /public/home/liuyanlin/download/armatus-2.2/src && /public/home/liuyanlin/anaconda2/bin/cmake -E cmake_link_script CMakeFiles/armatus.dir/link.txt --verbose=1
/public/home/liuyanlin/anaconda2/bin/c++ -O3 -g -std=c++11 -Wall -Wno-unused-local-typedefs CMakeFiles/armatus.dir/Armatus.cpp.o CMakeFiles/armatus.dir/ArmatusUtil.cpp.o CMakeFiles/armatus.dir/ArmatusParams.cpp.o CMakeFiles/armatus.dir/ArmatusDAG.cpp.o CMakeFiles/armatus.dir/IntervalScheduling.cpp.o -o armatus -rdynamic -lboost_program_options-mt -lboost_iostreams -lboost_graph -lboost_system -lboost_regex -lz -Wl,-rpath,/public/home/liuyanlin/anaconda2/lib:
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libc.so when searching for -lc
/usr/bin/ld: warning: libicui18n.so.54, needed by /public/home/liuyanlin/anaconda2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/../../../../lib/libboost_graph.so, not found (try using -rpath or -rpath-link)
/public/home/liuyanlin/anaconda2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crt1.o: In function _start': (.text+0x12): undefined reference to __libc_csu_fini'
/public/home/liuyanlin/anaconda2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crt1.o: In function _start': (.text+0x19): undefined reference to __libc_csu_init'
CMakeFiles/armatus.dir/Armatus.cpp.o: In function `boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::string const&, std::string const&, int)':
...

I added a parameter “-L/usr/lib/x86_64-redhat-linux5E/lib64” in link.txt and set up "ln /public/home/liuyanlin/anaconda2/lib/libicui18n.so.54.1 /public/home/liuyanlin/anaconda2/lib/libicui18n.so.54"

But still some part of the problem is not resolved

Linking CXX executable armatus
cd /public/home/liuyanlin/download/armatus-2.2/src && /public/home/liuyanlin/anaconda2/bin/cmake -E cmake_link_script CMakeFiles/armatus.dir/link.txt --verbose=1
/public/home/liuyanlin/anaconda2/bin/c++ -O3 -g -std=c++11 -Wall -Wno-unused-local-typedefs -L/usr/lib/x86_64-redhat-linux5E/lib64 CMakeFiles/armatus.dir/Armatus.cpp.o CMakeFiles/armatus.dir/ArmatusUtil.cpp.o CMakeFiles/armatus.dir/ArmatusParams.cpp.o CMakeFiles/armatus.dir/ArmatusDAG.cpp.o CMakeFiles/armatus.dir/IntervalScheduling.cpp.o -o armatus -rdynamic -lboost_program_options-mt -lboost_iostreams -lboost_graph -lboost_system -lboost_regex -lz -Wl,-rpath-link,/public/home/liuyanlin/anaconda2/lib:
/public/home/liuyanlin/anaconda2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crt1.o: In function _start': (.text+0x12): undefined reference to __libc_csu_fini'
/public/home/liuyanlin/anaconda2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.5/crt1.o: In function _start': (.text+0x19): undefined reference to __libc_csu_init'
CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::string const&, std::string const&, int)': /public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:373: undefined reference to boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:373: undefined reference to boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)' CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::error_with_option_name::~error_with_option_name()':
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::validation_error::~validation_error()':
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::invalid_option_value::~invalid_option_value()':
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::error_with_option_name::~error_with_option_name()':
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::validation_error::~validation_error()':
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o:/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:119: more undefined references to vtable for boost::program_options::error_with_option_name' follow
CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::basic_command_line_parser<char>::run()': /public/home/liuyanlin/anaconda2/include/boost/program_options/detail/parsers.hpp:108: undefined reference to boost::program_options::detail::cmdline::get_canonical_option_prefix()'
CMakeFiles/armatus.dir/Armatus.cpp.o: In function main': /public/home/liuyanlin/download/armatus-2.2/src/Armatus.cpp:55: undefined reference to boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
CMakeFiles/armatus.dir/Armatus.cpp.o: In function boost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&)': /public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name'
CMakeFiles/armatus.dir/Armatus.cpp.o: In function error_with_option_name': /public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name'
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name' /public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name'
/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o:/public/home/liuyanlin/anaconda2/include/boost/program_options/errors.hpp:89: more undefined references to vtable for boost::program_options::error_with_option_name' follow
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x28): undefined reference to boost::program_options::error_with_option_name::what() const' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x28): undefined reference to boost::program_options::error_with_option_name::what() const' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTIN5boost15program_options16validation_errorE[_ZTIN5boost15program_options16validation_errorE]+0x10): undefined reference to typeinfo for boost::program_options::error_with_option_name' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const' CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const'
CMakeFiles/armatus.dir/Armatus.cpp.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference to boost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const' /lib64//librt.so.1: undefined reference to __fortify_fail@GLIBC_PRIVATE'
/lib64//libpthread.so.0: undefined reference to __vdso_clock_gettime@GLIBC_PRIVATE' collect2: error: ld returned 1 exit status make[2]: *** [src/armatus] Error 1 make[2]: Leaving directory /public/home/liuyanlin/download/armatus-2.2'
make[1]: *** [src/CMakeFiles/armatus.dir/all] Error 2
make[1]: Leaving directory `/public/home/liuyanlin/download/armatus-2.2'
make: *** [all] Error 2

Do you have any suggestions?
Thank you!

@ckingsford
Copy link
Collaborator

Someone else who is also using conda suggested doing the following:

  export LD_LIBRARY_PATH=$CONDA_PREFIX/lib/

and also you could try adding -L$CONDA_PREFIX/lib/ to your link command line. E.g. add that directory to the src/CMakeLists.txt file at the link_directories line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants