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

Problem building osrm-backend with osrm-node on Debian Jessie #3978

Closed
angelocavallet opened this issue Apr 26, 2017 · 13 comments
Closed

Problem building osrm-backend with osrm-node on Debian Jessie #3978

angelocavallet opened this issue Apr 26, 2017 · 13 comments

Comments

@angelocavallet
Copy link

angelocavallet commented Apr 26, 2017

Hello, first sorry for my awful English, I'm Brazilian.

Since I read that running osrm-routed on production environment is not recommended, I have been trying to install osrm module for nodejs with the new node-osrm merge into osrm-backend but I'm getting some problems with building this on Debian Jessie

Linux 3.16.0-4-amd64 # 1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux

g++ (Debian 4.9.2-10) 4.9.2
gcc (Debian 4.9.2-10) 4.9.2

./usr/lib/x86_64-linux-gnu/libstdc++.so.5.0.7
./usr/lib/x86_64-linux-gnu/libstdc++.so.6
./usr/lib/x86_64-linux-gnu/libstdc++.so.5
./usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20

So, I have to update cmake from default Debian Jessie 3.0.2 to 3.1+ (more specifically 3.7.2) because the building error messages told me to do that.

After update cmake, I tried to build osrm-backend again.

mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On #this is recommended on CHANGELOG to build node-osrm with osrm-backend

which output the following text:

root@srvopenstreetmap:/home/osm/osrm/osrm-backend/build# cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On
-- Enabling mason
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- 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
-- Using GNU gold as linker.
-- Configuring OSRM in release mode
-- Configuring release mode optimizations
-- Performing Test LTO_AVAILABLE
-- Performing Test LTO_AVAILABLE - Success
CMake Warning at CMakeLists.txt:290 (message):
  ENABLE_MASON and ENABLE_LTO/ENABLE_GOLD_LINKER may not work on all linux
  systems currently


CMake Warning at CMakeLists.txt:291 (message):
  For more details see:
  https://github.com/Project-OSRM/osrm-backend/issues/3202


-- Performing Test HAS_COLOR_FLAG
-- Performing Test HAS_COLOR_FLAG - Success
-- Adding -fpermissive for GCC version < 5 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048). See #3603.
-- Setting linker optimizations
-- 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  
-- Installing dependencies via mason
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- OpenMP support found. Linking just in case for stxxl
-- Building node_osrm
-- Downloading: https://nodejs.org/download/release/v7.9.0/SHASUMS256.txt
-- NodeJS: Using node, version v7.9.0
-- Downloading: https://nodejs.org/download/release/v7.9.0/node-v7.9.0-headers.tar.gz
-- Configuring node_osrm bindings for NodeJs v7.9.0
-- node_osrm artifacts will be copied to: /home/osm/osrm/osrm-backend/lib/binding
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osm/osrm/osrm-backend/build


But when I tried to run "cmake --build ." I got that error:

root@srvopenstreetmap:/home/osm/osrm/osrm-backend/build# cmake --build .
Scanning dependencies of target UPDATER
[  0%] Building CXX object CMakeFiles/UPDATER.dir/src/updater/csv_source.cpp.o
[  0%] Building CXX object CMakeFiles/UPDATER.dir/src/updater/updater.cpp.o
[  0%] Built target UPDATER
Scanning dependencies of target UTIL
[  0%] Building CXX object CMakeFiles/UTIL.dir/src/util/assert.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/coordinate.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/coordinate_calculation.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/exception.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/fingerprint.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/geojson_debug_policies.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/log.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/name_table.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/bearing_class.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/entry_class.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/turn_bearing.cpp.o
[ 10%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/turn_lanes.cpp.o
[ 10%] Built target UTIL
Scanning dependencies of target osrm_update
[ 10%] Linking CXX static library libosrm_update.a
[ 10%] Built target osrm_update
Scanning dependencies of target CONTRACTOR
[ 10%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/contractor.cpp.o
[ 10%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/contractor_dijkstra.cpp.o
[ 10%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/graph_contractor.cpp.o
[ 10%] Built target CONTRACTOR
Scanning dependencies of target osrm_contract
[ 10%] Building CXX object CMakeFiles/osrm_contract.dir/src/osrm/contractor.cpp.o
[ 10%] Linking CXX static library libosrm_contract.a
[ 10%] Built target osrm_contract
Scanning dependencies of target SERVER
[ 10%] Building CXX object CMakeFiles/SERVER.dir/src/server/connection.cpp.o
[ 10%] Building CXX object CMakeFiles/SERVER.dir/src/server/request_handler.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/request_parser.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/service_handler.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/api/parameters_parser.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/api/url_parser.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/http/reply.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/match_service.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/nearest_service.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/route_service.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/table_service.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/tile_service.cpp.o
[ 17%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/trip_service.cpp.o
[ 17%] Built target SERVER
Scanning dependencies of target PARTITIONER
[ 17%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/annotated_partition.cpp.o
[ 21%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/bisection_to_partition.cpp.o
[ 21%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/dinic_max_flow.cpp.o
[ 21%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/graph_view.cpp.o
[ 21%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/inertial_flow.cpp.o
[ 21%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/partitioner.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/recursive_bisection.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/recursive_bisection_state.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/tarjan_graph_wrapper.cpp.o
[ 25%] Built target PARTITIONER
Scanning dependencies of target STORAGE
[ 28%] Building CXX object CMakeFiles/STORAGE.dir/src/storage/storage.cpp.o
[ 28%] Building CXX object CMakeFiles/STORAGE.dir/src/storage/storage_config.cpp.o
[ 28%] Built target STORAGE
Scanning dependencies of target EXTRACTOR
[ 28%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/compressed_edge_container.cpp.o
[ 32%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/edge_based_graph_factory.cpp.o
[ 32%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extraction_containers.cpp.o
[ 32%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extractor.cpp.o
[ 32%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extractor_callbacks.cpp.o
[ 32%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/graph_compressor.cpp.o
[ 35%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/raster_source.cpp.o
[ 35%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/restriction_map.cpp.o
[ 35%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/restriction_parser.cpp.o
[ 35%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/scripting_environment_lua.cpp.o
[ 35%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/suffix_table.cpp.o
[ 39%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/coordinate_extractor.cpp.o
[ 39%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection.cpp.o
[ 39%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_generator.cpp.o
[ 39%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_handler.cpp.o
[ 39%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_normalizer.cpp.o
[ 42%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/mergable_road_detector.cpp.o
[ 42%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/motorway_handler.cpp.o
[ 42%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/node_based_graph_walker.cpp.o
[ 42%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/roundabout_handler.cpp.o
[ 42%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/sliproad_handler.cpp.o
[ 46%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/suppress_mode_handler.cpp.o
[ 46%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_analysis.cpp.o
[ 46%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_classification.cpp.o
[ 46%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_discovery.cpp.o
[ 46%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_handler.cpp.o
[ 50%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_augmentation.cpp.o
[ 50%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_data.cpp.o
[ 50%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_handler.cpp.o
[ 50%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_matcher.cpp.o
[ 50%] Built target EXTRACTOR
Scanning dependencies of target osrm_extract
[ 53%] Building CXX object CMakeFiles/osrm_extract.dir/src/osrm/extractor.cpp.o
[ 53%] Linking CXX static library libosrm_extract.a
[ 53%] Built target osrm_extract
Scanning dependencies of target osrm-extract
[ 53%] Building CXX object CMakeFiles/osrm-extract.dir/src/tools/extract.cpp.o
[ 53%] Linking CXX executable osrm-extract
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(cmdline.o):libs/program_options/src/cmdline.cpp:function boost::program_options::detail::cmdline::run(): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(cmdline.o):libs/program_options/src/cmdline.cpp:function boost::program_options::detail::cmdline::handle_additional_parser(std::vector<std::string, std::allocator<std::string> >&): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(cmdline.o):libs/program_options/src/cmdline.cpp:function boost::program_options::detail::cmdline::finish_option(boost::program_options::basic_option<char>&, std::vector<std::string, std::allocator<std::string> >&, std::vector<boost::function1<std::vector<boost::program_options::basic_option<char>, std::allocator<boost::program_options::basic_option<char> > >, std::vector<std::string, std::allocator<std::string> >&>, std::allocator<boost::function1<std::vector<boost::program_options::basic_option<char>, std::allocator<boost::program_options::basic_option<char> > >, std::vector<std::string, std::allocator<std::string> >&> > > const&): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(value_semantic.o):libs/program_options/src/value_semantic.cpp:function boost::program_options::error_with_option_name::get_canonical_option_prefix() const: error: undefined reference to 'std::logic_error::logic_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(convert.o):libs/program_options/src/convert.cpp:function std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > boost::detail::convert<wchar_t, char, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >): error: undefined reference to 'std::logic_error::logic_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(convert.o):libs/program_options/src/convert.cpp:function std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > boost::detail::convert<wchar_t, char, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >): error: undefined reference to 'std::logic_error::logic_error(char const*)'
../mason_packages/linux-x86_64/boost_libprogram_options/1.63.0/lib/libboost_program_options.a(convert.o):libs/program_options/src/convert.cpp:function std::basic_string<char, std::char_traits<char>, std::allocator<char> > boost::detail::convert<char, wchar_t, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, boost::_bi::bind_t<std::codecvt_base::result, boost::_mfi::cmf7<std::codecvt_base::result, std::__codecvt_abstract_base<wchar_t, char, __mbstate_t>, __mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&>, boost::_bi::list8<boost::_bi::value<std::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >): error: undefined reference to 'std::logic_error::logic_error(char const*)'
../mason_packages/linux-x86_64/boost_libregex/1.63.0/lib/libboost_regex.a(instances.o):libs/regex/build/../src/instances.cpp:function boost::re_detail_106300::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, 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::_match_flags): error: undefined reference to 'std::invalid_argument::invalid_argument(char const*)'
../mason_packages/linux-x86_64/boost_libregex/1.63.0/lib/libboost_regex.a(instances.o):libs/regex/build/../src/instances.cpp:function boost::re_detail_106300::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, 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::_match_flags): error: undefined reference to 'std::invalid_argument::invalid_argument(char const*)'
../mason_packages/linux-x86_64/boost_libregex/1.63.0/lib/libboost_regex.a(instances.o):libs/regex/build/../src/instances.cpp:function boost::object_cache<boost::re_detail_106300::cpp_regex_traits_base<char>, boost::re_detail_106300::cpp_regex_traits_implementation<char> >::get(boost::re_detail_106300::cpp_regex_traits_base<char> const&, unsigned long): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
../mason_packages/linux-x86_64/boost_libregex/1.63.0/lib/libboost_regex.a(regex.o):libs/regex/build/../src/regex.cpp:function boost::regex_error::regex_error(boost::regex_constants::error_type): error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
../mason_packages/linux-x86_64/lua/5.2.4/lib/liblua.a(loslib.o):loslib.c:function os_tmpname: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
collect2: error: ld returned 1 exit status
CMakeFiles/osrm-extract.dir/build.make:107: recipe for target 'osrm-extract' failed
make[2]: *** [osrm-extract] Error 1
CMakeFiles/Makefile2:281: 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

So, I really don't know whats going on, I'm kinda lost here.

@daniel-j-h
Copy link
Member

Yep, can reproduce in a fresh docker run -it debian:jessie /bin/bash container:

apt update
apt install git curl g++ make zlib1g-dev
git clone https://github.com/Project-OSRM/osrm-backend.git
cd osrm-backend
mkdir build
cd build
curl https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.tar.gz -o cmake-3.8.0-Linux-x86_64.tar.gz
tar xf cmake-3.8.0-Linux-x86_64.tar.gz
./cmake-3.8.0-Linux-x86_64/bin/cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On
make

Seems like Debian comes with stdlibc++ version 3.4.20 but Mason packages require 3.4.21:

curl https://mason-binaries.s3.amazonaws.com/linux-x86_64/cmake/3.7.2.tar.gz -o cmake-3.7.2.tar.gz
tar xf cmake-3.7.2.tar.gz
./bin/cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=On -DENABLE_MASON=On
./bin/cmake: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./bin/cmake)

https://github.com/mapbox/mason/blob/9d4e91ff5bd534f209c9c4d5cac1c6bba601b2d4/scripts/cmake/3.7.2/.travis.yml#L14

Trusty:

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6
GLIBCXX_3.4.22

Debian Jessie:

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6
GLIBCXX_3.4.20

I suspect that's the reason we see undefined references to some stdlib internals. @angelocavallet can you install pre-built binaries via npm install osrm and use that as a workaround?

@springmeyer this effectively means we can't build osrm and / or the node bindings with Mason on latest Debian. In contrast running pre-build packages (e.g. the node bindings via npm install osrm) in latest Debian seem to work fine, because of compatibility guarantees I guess?

@angelocavallet
Copy link
Author

@daniel-j-h the pre-built seems to work fine on debian Jessie.

root@srvopenstreetmap:/home/osm/osrm/osrm-node# npm install osrm

> [email protected] install /home/osm/osrm/osrm-node/node_modules/osrm
> node-pre-gyp install --fallback-to-build=false || ./scripts/node_install.sh

node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/osrm/v5.7.0/Release/node-v51-linux-x64.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (/home/osm/osrm/osrm-node/node_modules/osrm/node_modules/node-pre-gyp/lib/install.js:120:27)
node-pre-gyp ERR! stack     at emitOne (events.js:101:20)
node-pre-gyp ERR! stack     at Request.emit (events.js:191:7)
node-pre-gyp ERR! stack     at Request.onRequestResponse (/home/osm/osrm/osrm-node/node_modules/osrm/node_modules/node-pre-gyp/node_modules/request/request.js:1074:10)
node-pre-gyp ERR! stack     at emitOne (events.js:96:13)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:191:7)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:522:21)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:411:20)
node-pre-gyp ERR! stack     at emitOne (events.js:96:13)
node-pre-gyp ERR! System Linux 3.16.0-4-amd64
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/osm/osrm/osrm-node/node_modules/osrm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
node-pre-gyp ERR! cwd /home/osm/osrm/osrm-node/node_modules/osrm
node-pre-gyp ERR! node -v v7.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.34
node-pre-gyp ERR! not ok 
403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/osrm/v5.7.0/Release/node-v51-linux-x64.tar.gz
/home/osm/osrm/osrm-node/node_modules/osrm/build /home/osm/osrm/osrm-node/node_modules/osrm
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- 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
-- Using GNU gold as linker.
-- Configuring OSRM in release mode
-- Configuring release mode optimizations
-- Performing Test LTO_AVAILABLE
-- Performing Test LTO_AVAILABLE - Success
-- Performing Test HAS_COLOR_FLAG
-- Performing Test HAS_COLOR_FLAG - Success
-- Adding -fpermissive for GCC version < 5 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048). See #3603.
-- Setting linker optimizations
-- 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  
-- Boost version: 1.63.0
-- Found the following Boost libraries:
--   date_time
--   chrono
--   filesystem
--   iostreams
--   program_options
--   regex
--   system
--   thread
--   unit_test_framework
--   atomic
-- Found Intel TBB
-- TBB interface version: 7003
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found version "2.2.0") 
-- Looking for STXXL...
-- Found STXXL: /usr/lib/libstxxl.so  
-- Found STXXL: /usr/lib/libstxxl.so
-- 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 Lua: /usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so (found suitable exact version "5.2.4") 
-- Using Lua 5.2.4
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") 
-- Looking for protozero
-- Looking for protozero - found
-- Found Osmium: /home/osm/osrm/osrm-node/node_modules/osrm/third_party/libosmium/include  
-- OpenMP support found. Linking just in case for stxxl
-- Building node_osrm
-- Downloading: https://nodejs.org/download/release/v7.9.0/SHASUMS256.txt
-- NodeJS: Using node, version v7.9.0
-- Downloading: https://nodejs.org/download/release/v7.9.0/node-v7.9.0-headers.tar.gz
-- Configuring node_osrm bindings for NodeJs v7.9.0
-- node_osrm artifacts will be copied to: /home/osm/osrm/osrm-node/node_modules/osrm/lib/binding
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osm/osrm/osrm-node/node_modules/osrm/build
Scanning dependencies of target UPDATER
[  0%] Building CXX object CMakeFiles/UPDATER.dir/src/updater/csv_source.cpp.o
[  3%] Building CXX object CMakeFiles/UPDATER.dir/src/updater/updater.cpp.o
[  3%] Built target UPDATER
Scanning dependencies of target UTIL
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/assert.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/coordinate.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/coordinate_calculation.cpp.o
[  3%] Building CXX object CMakeFiles/UTIL.dir/src/util/exception.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/fingerprint.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/geojson_debug_policies.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/log.cpp.o
[  7%] Building CXX object CMakeFiles/UTIL.dir/src/util/name_table.cpp.o
[ 11%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/bearing_class.cpp.o
[ 11%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/entry_class.cpp.o
[ 11%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/turn_bearing.cpp.o
[ 11%] Building CXX object CMakeFiles/UTIL.dir/src/util/guidance/turn_lanes.cpp.o
[ 11%] Built target UTIL
Scanning dependencies of target osrm_update
[ 11%] Linking CXX static library libosrm_update.a
[ 11%] Built target osrm_update
Scanning dependencies of target CONTRACTOR
[ 11%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/contractor.cpp.o
[ 11%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/contractor_dijkstra.cpp.o
[ 11%] Building CXX object CMakeFiles/CONTRACTOR.dir/src/contractor/graph_contractor.cpp.o
[ 11%] Built target CONTRACTOR
Scanning dependencies of target osrm_contract
[ 11%] Building CXX object CMakeFiles/osrm_contract.dir/src/osrm/contractor.cpp.o
[ 11%] Linking CXX static library libosrm_contract.a
[ 11%] Built target osrm_contract
Scanning dependencies of target SERVER
[ 11%] Building CXX object CMakeFiles/SERVER.dir/src/server/connection.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/request_handler.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/request_parser.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/service_handler.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/api/parameters_parser.cpp.o
[ 14%] Building CXX object CMakeFiles/SERVER.dir/src/server/api/url_parser.cpp.o
[ 18%] Building CXX object CMakeFiles/SERVER.dir/src/server/http/reply.cpp.o
[ 18%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/match_service.cpp.o
[ 18%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/nearest_service.cpp.o
[ 18%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/route_service.cpp.o
[ 18%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/table_service.cpp.o
[ 22%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/tile_service.cpp.o
[ 22%] Building CXX object CMakeFiles/SERVER.dir/src/server/service/trip_service.cpp.o
[ 22%] Built target SERVER
Scanning dependencies of target PARTITIONER
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/annotated_partition.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/bisection_to_partition.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/dinic_max_flow.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/graph_view.cpp.o
[ 25%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/inertial_flow.cpp.o
[ 29%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/partitioner.cpp.o
[ 29%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/recursive_bisection.cpp.o
[ 29%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/recursive_bisection_state.cpp.o
[ 29%] Building CXX object CMakeFiles/PARTITIONER.dir/src/partition/tarjan_graph_wrapper.cpp.o
[ 29%] Built target PARTITIONER
Scanning dependencies of target STORAGE
[ 29%] Building CXX object CMakeFiles/STORAGE.dir/src/storage/storage.cpp.o
[ 29%] Building CXX object CMakeFiles/STORAGE.dir/src/storage/storage_config.cpp.o
[ 29%] Built target STORAGE
Scanning dependencies of target EXTRACTOR
[ 33%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/compressed_edge_container.cpp.o
[ 33%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/edge_based_graph_factory.cpp.o
[ 33%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extraction_containers.cpp.o
[ 33%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extractor.cpp.o
[ 33%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/extractor_callbacks.cpp.o
[ 37%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/graph_compressor.cpp.o
[ 37%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/raster_source.cpp.o
[ 37%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/restriction_map.cpp.o
[ 37%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/restriction_parser.cpp.o
[ 37%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/scripting_environment_lua.cpp.o
[ 40%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/suffix_table.cpp.o
[ 40%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/coordinate_extractor.cpp.o
[ 40%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection.cpp.o
[ 40%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_generator.cpp.o
[ 40%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_handler.cpp.o
[ 44%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/intersection_normalizer.cpp.o
[ 44%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/mergable_road_detector.cpp.o
[ 44%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/motorway_handler.cpp.o
[ 44%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/node_based_graph_walker.cpp.o
[ 44%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/roundabout_handler.cpp.o
[ 48%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/sliproad_handler.cpp.o
[ 48%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/suppress_mode_handler.cpp.o
[ 48%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_analysis.cpp.o
[ 48%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_classification.cpp.o
[ 48%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_discovery.cpp.o
[ 51%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_handler.cpp.o
[ 51%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_augmentation.cpp.o
[ 51%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_data.cpp.o
[ 51%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_handler.cpp.o
[ 51%] Building CXX object CMakeFiles/EXTRACTOR.dir/src/extractor/guidance/turn_lane_matcher.cpp.o
[ 51%] Built target EXTRACTOR
Scanning dependencies of target osrm_extract
[ 51%] Building CXX object CMakeFiles/osrm_extract.dir/src/osrm/extractor.cpp.o
[ 55%] Linking CXX static library libosrm_extract.a
[ 55%] Built target osrm_extract
Scanning dependencies of target osrm-extract
[ 59%] Building CXX object CMakeFiles/osrm-extract.dir/src/tools/extract.cpp.o
[ 59%] Linking CXX executable osrm-extract
[ 59%] Built target osrm-extract
Scanning dependencies of target osrm-components
[ 59%] Building CXX object CMakeFiles/osrm-components.dir/src/tools/components.cpp.o
[ 59%] Linking CXX executable osrm-components
[ 59%] Built target osrm-components
Scanning dependencies of target osrm_store
[ 59%] Linking CXX static library libosrm_store.a
[ 59%] Built target osrm_store
Scanning dependencies of target osrm-datastore
[ 59%] Building CXX object CMakeFiles/osrm-datastore.dir/src/tools/store.cpp.o
[ 59%] Linking CXX executable osrm-datastore
[ 59%] Built target osrm-datastore
Scanning dependencies of target CUSTOMIZER
[ 59%] Building CXX object CMakeFiles/CUSTOMIZER.dir/src/customize/customizer.cpp.o
[ 59%] Built target CUSTOMIZER
Scanning dependencies of target osrm_partition
[ 59%] Linking CXX static library libosrm_partition.a
[ 59%] Built target osrm_partition
Scanning dependencies of target osrm-partition
[ 59%] Building CXX object CMakeFiles/osrm-partition.dir/src/tools/partition.cpp.o
[ 59%] Linking CXX executable osrm-partition
[ 59%] Built target osrm-partition
Scanning dependencies of target ENGINE
[ 62%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/douglas_peucker.cpp.o
[ 62%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/engine_config.cpp.o
[ 62%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/hint.cpp.o
[ 62%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/polyline_compressor.cpp.o
[ 62%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/search_engine_data.cpp.o
[ 66%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/api/json_factory.cpp.o
[ 66%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/datafacade/process_memory_allocator.cpp.o
[ 66%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/datafacade/shared_memory_allocator.cpp.o
[ 66%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/assemble_overview.cpp.o
[ 66%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/assemble_route.cpp.o
[ 70%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/assemble_steps.cpp.o
[ 70%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/collapse_scenario_detection.cpp.o
[ 70%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/collapse_turns.cpp.o
/home/osm/osrm/osrm-node/node_modules/osrm/src/engine/guidance/collapse_turns.cpp:56:5: warning: multi-line comment [-Wcomment]
     //           \
     ^
[ 70%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/lane_processing.cpp.o
[ 70%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/post_processing.cpp.o
[ 74%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/guidance/verbosity_reduction.cpp.o
[ 74%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/match.cpp.o
[ 74%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/nearest.cpp.o
[ 74%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/table.cpp.o
[ 74%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/tile.cpp.o
[ 77%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/trip.cpp.o
[ 77%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/plugins/viaroute.cpp.o
[ 77%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/alternative_path.cpp.o
[ 77%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/direct_shortest_path.cpp.o
[ 77%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/many_to_many.cpp.o
[ 81%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/map_matching.cpp.o
[ 81%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/routing_base.cpp.o
[ 81%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/routing_base_ch.cpp.o
[ 81%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/shortest_path.cpp.o
[ 81%] Building CXX object CMakeFiles/ENGINE.dir/src/engine/routing_algorithms/tile_turns.cpp.o
[ 81%] Built target ENGINE
Scanning dependencies of target osrm_customize
[ 81%] Linking CXX static library libosrm_customize.a
[ 81%] Built target osrm_customize
Scanning dependencies of target osrm-customize
[ 81%] Building CXX object CMakeFiles/osrm-customize.dir/src/tools/customize.cpp.o
[ 81%] Linking CXX executable osrm-customize
[ 81%] Built target osrm-customize
Scanning dependencies of target osrm-contract
[ 81%] Building CXX object CMakeFiles/osrm-contract.dir/src/tools/contract.cpp.o
[ 85%] Linking CXX executable osrm-contract
[ 85%] Built target osrm-contract
Scanning dependencies of target osrm
[ 88%] Building CXX object CMakeFiles/osrm.dir/src/osrm/osrm.cpp.o
[ 88%] Linking CXX static library libosrm.a
[ 88%] Built target osrm
Scanning dependencies of target osrm-routed
[ 88%] Building CXX object CMakeFiles/osrm-routed.dir/src/tools/routed.cpp.o
[ 92%] Linking CXX executable osrm-routed
[ 92%] Built target osrm-routed
Scanning dependencies of target node_osrm
[ 92%] Building CXX object src/nodejs/CMakeFiles/node_osrm.dir/node_osrm.cpp.o
In file included from /home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/node.h:42:0,
                 from /home/osm/osrm/osrm-node/node_modules/nan/nan.h:49,
                 from /home/osm/osrm/osrm-node/node_modules/osrm/include/nodejs/node_osrm.hpp:6,
                 from /home/osm/osrm/osrm-node/node_modules/osrm/src/nodejs/node_osrm.cpp:15:
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:5549:20: warning: unused parameter 'isolate' [-Wunused-parameter]
       v8::Isolate* isolate, v8::Local<v8::String> name) {
                    ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:5549:51: warning: unused parameter 'name' [-Wunused-parameter]
       v8::Isolate* isolate, v8::Local<v8::String> name) {
                                                   ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:6077:50: warning: unused parameter 'string' [-Wunused-parameter]
   virtual void VisitExternalString(Local<String> string) {}
                                                  ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:6087:57: warning: unused parameter 'value' [-Wunused-parameter]
   virtual void VisitPersistentHandle(Persistent<Value>* value,
                                                         ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:6088:47: warning: unused parameter 'class_id' [-Wunused-parameter]
                                      uint16_t class_id) {}
                                               ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:6142:66: warning: unused parameter 'reporter' [-Wunused-parameter]
   virtual void TracePrologue(EmbedderReachableReferenceReporter* reporter) {}
                                                                  ^
/home/osm/osrm/osrm-node/node_modules/osrm/build/src/nodejs/node/v7.9.0/include/v8.h:8258:55: warning: unused parameter 'isolate' [-Wunused-parameter]
   V8_INLINE static void CheckInitialized(v8::Isolate* isolate) {
                                                       ^
In file included from /home/osm/osrm/osrm-node/node_modules/osrm/src/nodejs/node_osrm.cpp:16:0:
/home/osm/osrm/osrm-node/node_modules/osrm/include/nodejs/node_osrm_support.hpp:78:45: warning: unused parameter 'result_status' [-Wunused-parameter]
 inline void ParseResult(const osrm::Status &result_status, const std::string & /*unused*/) {}
                                             ^
[ 92%] Linking CXX shared library Release/node_osrm.node
[ 92%] Built target node_osrm
Scanning dependencies of target copy_artifacts
[ 92%] Generating ../../../lib/binding/osrm-extract
[ 96%] Generating ../../../lib/binding/osrm-contract
[ 96%] Generating ../../../lib/binding/osrm-routed
[ 96%] Generating ../../../lib/binding/osrm-datastore
[ 96%] Generating ../../../lib/binding/osrm-components
[ 96%] Generating ../../../lib/binding/osrm-partition
[100%] Generating ../../../lib/binding/osrm-customize
[100%] Generating ../../../lib/binding/node_osrm.node
[100%] Built target copy_artifacts
/home/osm/osrm/osrm-node/node_modules/osrm
/home/osm/osrm/osrm-node
└─┬ [email protected] 
  ├── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   ├── [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ └── [email protected] 
  │   │ └── [email protected] 
  │   ├── [email protected] 
  │   ├── [email protected] 
  │   ├─┬ [email protected] 
  │   │ └─┬ [email protected] 
  │   │   └── [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├─┬ [email protected] 
  │   │ │ ├── [email protected] 
  │   │ │ └─┬ [email protected] 
  │   │ │   └── [email protected] 
  │   │ └─┬ [email protected] 
  │   │   ├─┬ [email protected] 
  │   │   │ ├── [email protected] 
  │   │   │ ├─┬ [email protected] 
  │   │   │ │ └─┬ [email protected] 
  │   │   │ │   └── [email protected] 
  │   │   │ ├── [email protected] 
  │   │   │ └─┬ [email protected] 
  │   │   │   └── [email protected] 
  │   │   ├─┬ [email protected] 
  │   │   │ ├── [email protected] 
  │   │   │ ├─┬ [email protected] 
  │   │   │ │ └── [email protected] 
  │   │   │ ├── [email protected] 
  │   │   │ └─┬ [email protected] 
  │   │   │   ├─┬ [email protected] 
  │   │   │   │ └── [email protected] 
  │   │   │   └── [email protected] 
  │   │   └── [email protected] 
  │   ├── [email protected] 
  │   ├── [email protected] 
  │   ├── [email protected] 
  │   ├─┬ [email protected] 
  │   │ ├── [email protected] 
  │   │ └─┬ [email protected] 
  │   │   └── [email protected] 
  │   ├── [email protected] 
  │   ├── [email protected] 
  │   └── [email protected] 
  └─┬ [email protected] 
    ├─┬ [email protected] 
    │ └── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ └─┬ [email protected] 
    │   ├── [email protected] 
    │   └── [email protected] 
    ├─┬ [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ ├── [email protected] 
    │ │ ├── [email protected] 
    │ │ ├── [email protected] 
    │ │ ├── [email protected] 
    │ │ ├─┬ [email protected] 
    │ │ │ ├── [email protected] 
    │ │ │ └─┬ [email protected] 
    │ │ │   └── [email protected] 
    │ │ ├─┬ [email protected] 
    │ │ │ └── [email protected] 
    │ │ └── [email protected] 
    │ └── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ └── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ ├─┬ [email protected] 
    │ │ ├─┬ [email protected] 
    │ │ │ ├── [email protected] 
    │ │ │ └─┬ [email protected] 
    │ │ │   └── [email protected] 
    │ │ └── [email protected] 
    │ ├─┬ [email protected] 
    │ │ ├── [email protected] 
    │ │ ├── [email protected] 
    │ │ ├── [email protected] 
    │ │ └── [email protected] 
    │ ├─┬ [email protected] 
    │ │ ├── [email protected] 
    │ │ ├─┬ [email protected] 
    │ │ │ ├── [email protected] 
    │ │ │ ├── [email protected] 
    │ │ │ └── [email protected] 
    │ │ └─┬ [email protected] 
    │ │   ├── [email protected] 
    │ │   ├── [email protected] 
    │ │   ├── [email protected] 
    │ │   ├─┬ [email protected] 
    │ │   │ └── [email protected] 
    │ │   ├── [email protected] 
    │ │   ├─┬ [email protected] 
    │ │   │ └── [email protected] 
    │ │   ├── [email protected] 
    │ │   ├── [email protected] 
    │ │   └── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ ├── [email protected] 
    │ └── [email protected] 
    ├─┬ [email protected] 
    │ └─┬ [email protected] 
    │   ├── [email protected] 
    │   ├── [email protected] 
    │   ├─┬ [email protected] 
    │   │ └─┬ [email protected] 
    │   │   ├── [email protected] 
    │   │   └── [email protected] 
    │   └── [email protected] 
    ├── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ ├─┬ [email protected] 
    │ │ └── [email protected] 
    │ └── [email protected] 
    └─┬ [email protected] 
      ├─┬ [email protected] 
      │ └── [email protected] 
      ├── [email protected] 
      ├─┬ [email protected] 
      │ └── [email protected] 
      ├─┬ [email protected] 
      │ ├── [email protected] 
      │ ├── [email protected] 
      │ ├── [email protected] 
      │ ├── [email protected] 
      │ ├── [email protected] 
      │ └── [email protected] 
      └── [email protected] 

npm WARN enoent ENOENT: no such file or directory, open '/home/osm/osrm/osrm-node/package.json'
npm WARN osrm-node No description
npm WARN osrm-node No repository field.
npm WARN osrm-node No README data
npm WARN osrm-node No license field.

I tried to run app.js (which is basically the example.js just fixed the osrm lib dir and .osrm dir)
And I think its worked
now its returning another error from "node app.js" command:

root@srvopenstreetmap:/home/osm/osrm/osrm-node# node app.js 
/home/osm/osrm/osrm-node/app.js:8
var osrm = new OSRM("/home/osm/osm/south-america-latest.osrm");
           ^

TypeError: Fingerprint mismatch in /home/osm/osm/south-america-latest.osrm.hsgr (at include/storage/io.hpp:61)
    at Object.<anonymous> (/home/osm/osrm/osrm-node/app.js:8:12)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:423:7)
    at startup (bootstrap_node.js:147:9)
    at bootstrap_node.js:538:3

Is that a problem with .osrm data?
I think the problem is because I exported with the latest osrm version, because I google it and found #2604
Do I have to extract the .pbf again with the pre-built version?

@daniel-j-h
Copy link
Member

Yes the problem you are seeing is the data files were generated with a different version. The easiest way to keep them in sync is using the binaries we bundle with the Node.js bindings:

./node_modules/osrm/lib/binding/osrm-*

@angelocavallet
Copy link
Author

Ok, I'll do that and return

Just a doubt, what is the difference between ./node_modules/osrm/build/osrm-* and ./node_modules/osrm/lib/binding/osrm-* ?

@daniel-j-h
Copy link
Member

./node_modules/osrm/lib/binding/osrm-*

is where we put and publish the osrm binaries (generated by Travis). There should be no ./node_modules/osrm/build directory and if I do npm install osrm I can't see one.

@oxidase
Copy link
Contributor

oxidase commented Apr 27, 2017

It is an undefined behavior in the pre-built osrm, but works because it does not hit std::runtime_error::runtime_error(char const*) that are missing in the library

readelf -Ws /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 | c++filt | grep std::runtime_error::runtime_error
  1512: 0000000000073770    59 FUNC    GLOBAL DEFAULT   12 std::runtime_error::runtime_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@@GLIBCXX_3.4
  1665: 0000000000073770    59 FUNC    GLOBAL DEFAULT   12 std::runtime_error::runtime_error(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@@GLIBCXX_3.4

The problem will be visible when boost or osrm will throw an exception std::runtime_error::runtime_error("error").

@angelocavallet
Copy link
Author

@daniel-j-h The pre-built version worked like a charm after regenerate osrm files

Thanks for the help and thanks all for this awesome project

@springmeyer
Copy link
Contributor

@springmeyer this effectively means we can't build osrm and / or the node bindings with Mason on latest Debian. In contrast running pre-build packages (e.g. the node bindings via npm install osrm) in latest Debian seem to work fine, because of compatibility guarantees I guess?

@daniel-j-h @oxidase - thanks for the flag. This feels like more evidence I need to move on mapbox/mason#267.

I've started on boost packages that are built against libstdc++-4.8-dev at mapbox/mason#409. I can ping when these are ready and we could test again against debian jessie. Let me know if you have other ideas.

@oxidase
Copy link
Contributor

oxidase commented Apr 28, 2017

@springmeyer even if osrm-routed starts with lazy bindings there is still a hidden undefined behavior because osrm-routed will fail trying to resolve

589: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND std::runtime_error::runtime_error(char const*)   
793: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND std::runtime_error::runtime_error(char const*)

To switch off lazy bindings and check binary compatibility export LD_BIND_NOW=1 will resolve all required symbols before the main call and should fail in case of undefined symbols.

daniel-j-h added a commit that referenced this issue Apr 28, 2017
At the moment the loader will lazily resolve symbols at runtime when the
first function call happens. This can lead to situations where the libs
are not compatible but we are still able to run - until unresolveable
symbols are encountered.

This changeset tells the loader to resolve all symbols at startup,
failing hard immediately if symbols are unresolveable.

> now
>
> When generating an executable or shared library, mark it to tell the
> dynamic linker to resolve all symbols when the program is started,
> or when the shared library is linked to using dlopen, instead of
> deferring function call resolution to the point when the function is
> first called.

https://linux.die.net/man/1/ld

See #3978
@oxidase
Copy link
Contributor

oxidase commented Oct 16, 2017

@daniel-j-h do you think the issue can be closed?

@springmeyer
Copy link
Contributor

@oxidase 👋 I think it is worthwhile testing this again to see if it is resolved. Can someone try to replicate again and see if it is fixed? Context: As part of #4567 we upgraded to the boost 1.65.1 package from mason. That package is built against libstdc++4.8. So I think that std::runtime_error::runtime_error(char const*) will no longer be present in the binary.

@oxidase
Copy link
Contributor

oxidase commented Oct 16, 2017

@springmeyer just checked with debian:jessie: no more linker errors

@oxidase oxidase closed this as completed Oct 16, 2017
@springmeyer
Copy link
Contributor

Great, thanks for confirming @oxidase. I wonder if we can remove

message(WARNING "Mason and GCC's LTO not work together. Disabling LTO.")
now?

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

No branches or pull requests

4 participants