dividiti / ck-caffe

Collective Knowledge workflow for Caffe to automate installation across diverse platforms and to collaboratively evaluate and optimize Caffe-based workloads across diverse hardware, software and data sets (compilers, libraries, tools, models, inputs):
http://cKnowledge.org
BSD 3-Clause "New" or "Revised" License
193 stars 40 forks source link

"ck install package:lib-caffe-intel-request-cpu" fails with LLVM 5.0 #136

Open psyhtest opened 6 years ago

psyhtest commented 6 years ago

After I relaxed the compiler constraints on building Caffe (i.e. allow to use C++ compilers other than GCC), I found that building with Clang (LLVM) fails due to linking issues:

$ sudo apt install clang-5.0
$ ck detect soft:compiler.llvm
$ ck pull repo:ck-caffe  --url=https://github.com/dividiti/ck-caffe
$ ck install package:lib-caffe-intel-request-cpu

I see at least 2 different issues:

  1. Due to Boost regex (tried with 1.65.1 an 1.66.0, both full and min-for-caffe):
    [ 88%] Linking CXX executable device_query
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::put_mem_block(void*)'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*,
    std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_matc
    h_flags)'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::get_default_error_string(boost::regex_constants::error_type)'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::get_mem_block()'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::verify_options(unsigned int, boost::regex_constants::_match_flags)'
    ../lib/libcaffe.so.1.1.0: undefined reference to `boost::re_detail_106600::raise_runtime_error(std::runtime_error const&)'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    tools/CMakeFiles/device_query.dir/build.make:132: recipe for target 'tools/device_query' failed
    make[2]: *** [tools/device_query] Error 1
    CMakeFiles/Makefile2:664: recipe for target 'tools/CMakeFiles/device_query.dir/all' failed
    make[1]: *** [tools/CMakeFiles/device_query.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
  2. Due to GFlags:
    
    CMakeFiles/convert_annoset.dir/convert_annoset.cpp.o: In function `_GLOBAL__sub_I_convert_annoset.cpp':
    /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x5f): undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
    /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x8a): undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
    /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x116): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(c
    har const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
    /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:clang(: .text.startup+0x20c): undefined reference to `error: google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocat
    or<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)linker command failed with exit code 1 (use -v to see invocation)'

/home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x2d5): undefined reference to google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(c har const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x386): undefined reference togoogle::FlagRegisterer::FlagRegisterer<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(c har const, char const, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x3ea): undefined reference to google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x415): undefined reference togoogle::FlagRegisterer::FlagRegisterer(char const, char const, char const, int, int)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x440): undefined reference to `google::FlagRegisterer::FlagRegisterer(char const, char const, char const, int, int)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x46b): undefined reference to google::FlagRegisterer::FlagRegisterer<int>(char const*, char const*, char const*, int*, int*)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x496): undefined reference togoogle::FlagRegisterer::FlagRegisterer(char const, char const, char const, int, int)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x4c1): undefined reference to `google::FlagRegisterer::FlagRegisterer(char const, char const, char const, bool, bool)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x4ec): undefined reference to google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)' /home/anton/CK_TOOLS/lib-caffe-intel-request-cpu-request-llvm-5.0.0-3~16.04.1-linux-64/src/tools/convert_annoset.cpp:(.text.startup+0x564): undefined reference togoogle::FlagRegisterer::FlagRegisterer<std::cxx11::basic_string<char, std::char_traits, std::allocator > >(c har const, char const, char const*, std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' tools/CMakeFiles/train_net.dir/build.make:132: recipe for target 'tools/train_net' failed