jolibrain/deepdetect

Building on Ubuntu 15.10 / GCC-5 with new ABI

beniz opened this issue · 5 comments

beniz commented

This is an anchor post on how to build for gcc5 with new ABI, which is the recommended option on Ubuntu 15.10.

Warning: Ubuntu 15.10 has buggy libraries that are not correctly compiled with gcc5, requiring some of the kung-fu below. I have filed bug reports, will update when fixes occur.

  • Ubuntu 15.10 comes with libprotobuf compiled with gcc5 so Caffe should compile without difficulties (this is automatic when building deepdetect)
  • the built-in package for curlpp is wrongly compiled currently on Ubuntu 15.10 and will faill due to ABI mismatch. I've open a bug report but in the meantime the fix is to rebuild curlpp from https://github.com/datacratic/curlpp:
sudo apt-get remove libcurlpp0
git clone https://github.com/datacratic/curlpp
cd curlpp
./autogen.sh
./configure --prefix=/usr --enable-ewarning=no
make
sudo make install
wget https://launchpad.net/ubuntu/+archive/primary/+files/cpp-netlib_0.11.1%2Bdfsg1.orig.tar.gz
tar xvzf cpp-netlib_0.11.1+dfsg1.orig.tar.gz
cd cpp-netlib-0.11.1-final
mkdir build
cd build
cmake ..
make
sudo make install

That's it, deepdetect builds fine from me and all tests pass cleanly.

Same problem with Ubuntu 16.04, at least for the curlpp package. Manually install the library solve the pb (after a make clean).

beniz commented

There's a dedicated issue for 16.04, https://github.com/beniz/deepdetect/issues/126

I had 2 issues installing on 15.10. One got resolved from the comment above. Thanks.

Second issue is with the boost and netlib probably
../src/libddetect.a(httpjsonapi.cc.o): In function boost::network::uri::uri::parse()': /usr/include/boost/network/uri/uri.hpp:178: undefined reference toboost::network::uri::detail::parse(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, boost::network::uri::detail::uri_parts<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >&)'
../src/libddetect.a(httpjsonapi.cc.o): In function void boost::network::uri::scheme_directive::operator()<boost::network::uri::uri>(boost::network::uri::uri&) const': /usr/include/boost/network/uri/directives/scheme.hpp:23: undefined reference toboost::network::uri::opaque_schemes::exists(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'

  • I tried to add this line find_package(cppnetlib REQUIRED uri uri-parsers server-parsers client-connections)
    before boost in CMakeLists.tx - but to no avail. Errors are exactly the same.
    I am installing caffe-cpu version,

Any comments or suggestions. Thanks.

beniz commented

Please be more precise: have you recompiled both curlpp and cppnetlib exactly as detailed in the issue and made sure the distribution packages for these two libs are not installed ?

Thanks. I retried and it worked.
Ok - Probably I did not do that before - sudo apt-get remove libcppnetlib0
Also possibly generating all cmake files again helped.