Osrm-backend: build failed on Ubuntu 16.04

Created on 22 Jul 2016  路  4Comments  路  Source: Project-OSRM/osrm-backend

Hello,

I prevously suceed to build OSRM on ubuntu 15.10
But now my build failed on ubuntu 16.04 (up-to-date)

I try with version 5.2.7

commit 9224158835c900912c26e65f06e6ff6a2d647b1e
Author: Patrick Niklaus <[email protected]>
Date:   Wed Jul 20 17:14:15 2016 +0200

    Update changelog and bump to 5.2.7

Error below when I lanch cmake --build .
but libboost is already installed

[ 88%] Linking CXX executable osrm-extract
/tmp/ccMgV7jp.ltrans20.ltrans.o: In function `__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > boost::re_detail::re_is_set_member<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool)':
<artificial>:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb+0x16a): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
<artificial>:(.text._ZN5boost9re_detail16re_is_set_memberIN9__gnu_cxx17__normal_iteratorIPKcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEjEET_SH_SH_PKNS0_11re_set_longIT2_EERKNS0_10regex_dataIT0_T1_EEb+0x528): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
CMakeFiles/osrm-extract.dir/build.make:131: recipe for target 'osrm-extract' failed
make[2]: *** [osrm-extract] Error 1
CMakeFiles/Makefile2:216: recipe for target 'CMakeFiles/osrm-extract.dir/all' failed
make[1]: *** [CMakeFiles/osrm-extract.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

See below, cmake's check

$$$ cmake .. -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 6.1.0
-- The CXX compiler identification is GNU 6.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building on a 64 bit system
-- Configuring OSRM in release mode
-- Performing Test LTO_AVAILABLE
-- Performing Test LTO_AVAILABLE - Success
-- Performing Test LTO_WORKS
-- Performing Test LTO_WORKS - Success
-- LTO working
-- Using gcc specific binutils for LTO.
-- Performing Test HAS_COLOR_FLAG
-- Performing Test HAS_COLOR_FLAG - Success
-- Setting linker optimizations
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found version "2.1.0") 
-- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found Osmium: /home/david/osrm-backend/third_party/libosmium/include  
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   iostreams
--   program_options
--   regex
--   system
--   thread
--   chrono
--   atomic
-- Found Intel TBB
-- TBB interface version: 9002
-- Looking for Luabind...
-- Found Luabind: /usr/lib/libluabind.so  
-- Found Luabind: /usr/lib/libluabind.so
-- Found Lua52: /usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so  
-- Looking for LuaJIT 5.2
-- Could NOT find LUAJIT (missing:  LUAJIT_LIBRARIES) 
-- Performing Test LUABIND_WORKS
-- Performing Test LUABIND_WORKS - Success
-- Luabind/Lua5.2 combination working with /usr/lib/x86_64-linux-gnu/liblua5.2.so
-- Looking for STXXL...
-- Found STXXL: /usr/lib/libstxxl.so  
-- Found STXXL: /usr/lib/libstxxl.so
-- OpenMP support found. Linking just in case for stxxl
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.11") 
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/osrm-backend/build2
Compilation

Most helpful comment

Closing here, since it's not actionable on our side.

Just keep in mind that if you want to compile OSRM with GCC 6 you have to compile all its C++ dependencies with the same stdlib and same compiler, too. As in, you have to build local versions of

  • boost
  • luabind
  • stxxl
  • tbb (recent TBB table has an issue with latest gcc, see https://github.com/Project-OSRM/osrm-backend/issues/2414)

All 4 comments

same issue on master branch on last commit commit 9b737230d655cac3e9cd5647be86d2e4aca79061

Can't reproduce in a fresh 16.04 container. Builds fine with the following:

docker run -i -v $(pwd):/mnt/build -t ubuntu:16.04 /bin/bash

apt-get install --yes --no-install-recommends build-essential git cmake pkg-config libbz2-dev libstxxl-dev libxml2-dev libzip-dev libboost-all-dev liblua5.1-0-dev libluabind-dev libtbb-dev

Looking at your CMake output:

-- The C compiler identification is GNU 6.1.0
-- The CXX compiler identification is GNU 6.1.0

GCC 6 is not the default Ubuntu 16.04 compiler. Did you install it yourself?
You're probably hitting ABI incompatibilities.

Thanks for your quick reply
Yes I compile other programs with my own build of gcc-6.1

these 2 commands fix the problem
export CC=/usr/bin/gcc-5
export CXX=/usr/bin/g++-5

Closing here, since it's not actionable on our side.

Just keep in mind that if you want to compile OSRM with GCC 6 you have to compile all its C++ dependencies with the same stdlib and same compiler, too. As in, you have to build local versions of

  • boost
  • luabind
  • stxxl
  • tbb (recent TBB table has an issue with latest gcc, see https://github.com/Project-OSRM/osrm-backend/issues/2414)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

pat841 picture pat841  路  4Comments

freenerd picture freenerd  路  4Comments

MouadSb picture MouadSb  路  3Comments

AliKarami picture AliKarami  路  3Comments

grib0 picture grib0  路  4Comments