Building OSRM error on CentOs
Hi,
I'm trying to build OSRM on CentOS 6.4. I'm working with the develop branch code. I got to the point of the make command but i got this error :
$ make [ 7%] Building CXX object CMakeFiles/osrm-extract.dir/extractor.cpp.o Dans le fichier inclus à partir de /usr/local/include/luabind/wrapper_base.hpp:31, à partir de /usr/local/include/luabind/back_reference.hpp:27, à partir de /usr/local/include/luabind/class.hpp:93, à partir de /usr/local/include/luabind/luabind.hpp:28, à partir de /usr/src/Project-OSRM/Extractor/ScriptingEnvironment.h:29, à partir de /usr/src/Project-OSRM/extractor.cpp:29: /usr/local/include/luabind/detail/call_member.hpp:319:1: erreur: opérateur binaire manquant avant l'élément lexical « ( » Dans le fichier inclus à partir de /usr/local/include/luabind/back_reference.hpp:27, à partir de /usr/local/include/luabind/class.hpp:93, à partir de /usr/local/include/luabind/luabind.hpp:28, à partir de /usr/src/Project-OSRM/Extractor/ScriptingEnvironment.h:29, à partir de /usr/src/Project-OSRM/extractor.cpp:29: /usr/local/include/luabind/wrapper_base.hpp:92:1: erreur: opérateur binaire manquant avant l'élément lexical « ( » Dans le fichier inclus à partir de /usr/local/include/luabind/function.hpp:10, à partir de /usr/local/include/luabind/class.hpp:94, à partir de /usr/local/include/luabind/luabind.hpp:28, à partir de /usr/src/Project-OSRM/Extractor/ScriptingEnvironment.h:29, à partir de /usr/src/Project-OSRM/extractor.cpp:29: /usr/local/include/luabind/detail/call_function.hpp:326:1: erreur: opérateur binaire manquant avant l'élément lexical « ( » Dans le fichier inclus à partir de /usr/local/include/luabind/detail/constructor.hpp:12, à partir de /usr/local/include/luabind/class.hpp:96, à partir de /usr/local/include/luabind/luabind.hpp:28, à partir de /usr/src/Project-OSRM/Extractor/ScriptingEnvironment.h:29, à partir de /usr/src/Project-OSRM/extractor.cpp:29: /usr/local/include/luabind/wrapper_base.hpp:92:1: erreur: opérateur binaire manquant avant l'élément lexical « ( » Dans le fichier inclus à partir de /usr/local/include/luabind/class.hpp:107, à partir de /usr/local/include/luabind/luabind.hpp:28, à partir de /usr/src/Project-OSRM/Extractor/ScriptingEnvironment.h:29, à partir de /usr/src/Project-OSRM/extractor.cpp:29: /usr/local/include/luabind/detail/call_member.hpp:319:1: erreur: opérateur binaire manquant avant l'élément lexical « ( » In file included from /usr/src/stxxl-1.3.1/include/stxxl/bits/common/utils.h:28, from /usr/src/stxxl-1.3.1/include/stxxl.h:16, from /usr/src/Project-OSRM/Extractor/ExtractionContainers.h:25, from /usr/src/Project-OSRM/Extractor/ExtractorCallbacks.h:33, from /usr/src/Project-OSRM/extractor.cpp:27: /usr/src/stxxl-1.3.1/include/stxxl/bits/common/types.h:36: attention : ISO C++ 1998 does not support ‘long long’ /usr/src/stxxl-1.3.1/include/stxxl/bits/common/types.h:37: attention : ISO C++ 1998 does not support ‘long long’ make[2]: *** [CMakeFiles/osrm-extract.dir/extractor.cpp.o] Erreur 1 make[1]: *** [CMakeFiles/osrm-extract.dir/all] Erreur 2 make: *** [all] Erreur 2
Can somebody help me ?
What compiler and luabind version are you using? First guess is that the compiler it too old.
gcc 4.4.7 and luabind 0.9.1
The old'ish version of GCC may be an issue here. Do you have access to GCC 4.6?
I tried with gcc 4.7 and the installation succeeded but when i check the version of gcc it still returns 4.4.7.
I installed gcc 4.6.3 and made it the default compiler but I still have the same error.
Have you any idea ?
Did you follow the steps on the wiki? https://github.com/DennisOSRM/Project-OSRM/wiki/Building%20OSRM
g++ may be installed under a different name, perhaps g++-4-7. You would need to find out the name of your 4.7 installation and then rerun cmake with explicitely specified compiler, e.g.:
cmake .. -DCMAKE_CXX_COMPILER=g++-4.7
Solved thank you.
The compilation worked well until 53%. This time I got this
[ 53%] Building CXX object CMakeFiles/osrm-extract.dir/Extractor/ScriptingEnvironment.cpp.o
Linking CXX executable osrm-extract
CMakeFiles/osrm-extract.dir/extractor.cpp.o: In function testDataFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': extractor.cpp:(.text._Z12testDataFileRKSs[testDataFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x1a): undefined reference toboost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code_)'
CMakeFiles/osrm-extract.dir/extractor.cpp.o: In function _GLOBAL__sub_I_extractCallBacks': extractor.cpp:(.text.startup+0xca1): undefined reference toboost::system::generic_category()'
extractor.cpp:(.text.startup+0xcad): undefined reference to boost::system::generic_category()' extractor.cpp:(.text.startup+0xcb9): undefined reference toboost::system::system_category()'
CMakeFiles/osrm-extract.dir/Extractor/PBFParser.cpp.o: In function void boost::condition_variable_any::wait<boost::unique_lock<boost::mutex> >(boost::unique_lock<boost::mutex>&) [clone .constprop.732]': PBFParser.cpp:(.text+0xba9): undefined reference toboost::system::system_category()'
CMakeFiles/osrm-extract.dir/Extractor/PBFParser.cpp.o: In function boost::thread_exception::thread_exception(int, char const_)': PBFParser.cpp:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x21): undefined reference to boost::system::system_category()'
CMakeFiles/osrm-extract.dir/Extractor/PBFParser.cpp.o: In functionPBFParser::Parse()': PBFParser.cpp:(.text._ZN9PBFParser5ParseEv[PBFParser::Parse()]+0x6e): undefined reference to boost::thread::start_thread_noexcept()'
PBFParser.cpp:(.text._ZN9PBFParser5ParseEv[PBFParser::Parse()]+0xdc): undefined reference toboost::thread::start_thread_noexcept()' PBFParser.cpp:(.text._ZN9PBFParser5ParseEv[PBFParser::Parse()]+0x112): undefined reference to boost::thread::join_noexcept()'
PBFParser.cpp:(.text._ZN9PBFParser5ParseEv[PBFParser::Parse()]+0x135): undefined reference toboost::thread::join_noexcept()' CMakeFiles/osrm-extract.dir/Extractor/PBFParser.cpp.o: In function _GLOBAL__sub_I__ZN9PBFParserC2EPKcP18ExtractorCallbacksR20ScriptingEnvironment':
PBFParser.cpp:(.text.startup+0x24): undefined reference toboost::system::generic_category()' PBFParser.cpp:(.text.startup+0x30): undefined reference to boost::system::generic_category()'
PBFParser.cpp:(.text.startup+0x3c): undefined reference toboost::system::system_category()' CMakeFiles/osrm-extract.dir/Extractor/XMLParser.cpp.o: In function _GLOBAL__sub_I__Z17readFromBz2StreamPvPci':
XMLParser.cpp:(.text.startup+0x191): undefined reference toboost::system::generic_category()' XMLParser.cpp:(.text.startup+0x19d): undefined reference to boost::system::generic_category()'
XMLParser.cpp:(.text.startup+0x1a9): undefined reference toboost::system::system_category()' CMakeFiles/osrm-extract.dir/Extractor/BaseParser.cpp.o: In function _GLOBAL__sub_I__ZN10BaseParserC2EP18ExtractorCallbacksR20ScriptingEnvironment':
BaseParser.cpp:(.text.startup+0x191): undefined reference toboost::system::generic_category()' BaseParser.cpp:(.text.startup+0x19d): undefined reference to boost::system::generic_category()'
BaseParser.cpp:(.text.startup+0x1a9): undefined reference toboost::system::system_category()' CMakeFiles/osrm-extract.dir/Extractor/ScriptingEnvironment.cpp.o: In function luaAddScriptFolderToLoadPath(lua_State*, char const*)':
ScriptingEnvironment.cpp:(.text._Z28luaAddScriptFolderToLoadPathP9lua_StatePKc[luaAddScriptFolderToLoadPath(lua_State*, char const*)]+0x1e): undefined reference toboost::filesystem::path::parent_path() const' CMakeFiles/osrm-extract.dir/Extractor/ScriptingEnvironment.cpp.o: In function _GLOBAL__sub_I__ZN20ScriptingEnvironmentC2Ev':
ScriptingEnvironment.cpp:(.text.startup+0x1c4): undefined reference toboost::system::generic_category()' ScriptingEnvironment.cpp:(.text.startup+0x1d0): undefined reference to boost::system::generic_category()'
ScriptingEnvironment.cpp:(.text.startup+0x1dc): undefined reference toboost::system::system_category()' /usr/lib/libosmpbf.a(fileformat.pb.o): In function OSMPBF::BlobHeader::MergeFrom(OSMPBF::BlobHeader const&)':
fileformat.pb.cc:(.text+0x200): undefined reference togoogle::protobuf::internal::kEmptyString' fileformat.pb.cc:(.text+0x225): undefined reference to google::protobuf::internal::kEmptyString'
/usr/lib/libosmpbf.a(fileformat.pb.o): In functionOSMPBF::Blob::MergeFrom(OSMPBF::Blob const&)': fileformat.pb.cc:(.text+0x3b8): undefined reference to google::protobuf::internal::kEmptyString'
fileformat.pb.cc:(.text+0x3ee): undefined reference togoogle::protobuf::internal::kEmptyString' fileformat.pb.cc:(.text+0x413): undefined reference to google::protobuf::internal::kEmptyString'
/usr/lib/libosmpbf.a(fileformat.pb.o):fileformat.pb.cc:(.text+0x438): more undefined references to`google::protobuf::internal::kEmptyString' follow
collect2: ld a retourné 1 code d'état d'exécution
make[2]: *** [osrm-extract] Erreur 1
make[1]: *** [CMakeFiles/osrm-extract.dir/all] Erreur 2
make: *** [all] Erreur 2
Seems to be just a library link error. I tried many things to solve this but I can't find the problem. Have you any idea ?
Is boost properly installed, i.e. all sub packages of boost?
I'm not sure about that. I compiled all the libraries and all the .so files are in the lib repertory but there is nothing in the include repertory. Is it normal ?
Solved for boost. I deleted all the boost files and reinstalled it and it worked.
But still have the protobuf errors Linking CXX executable osrm-extract
/usr/lib/libosmpbf.a(fileformat.pb.o): In function OSMPBF::BlobHeader::MergeFrom(OSMPBF::BlobHeader const&)': fileformat.pb.cc:(.text+0x200): undefined reference togoogle::protobuf::internal::kEmptyString'
fileformat.pb.cc:(.text+0x225): undefined reference to google::protobuf::internal::kEmptyString' /usr/lib/libosmpbf.a(fileformat.pb.o): In functionOSMPBF::Blob::MergeFrom(OSMPBF::Blob const&)':
fileformat.pb.cc:(.text+0x3b8): undefined reference to google::protobuf::internal::kEmptyString' fileformat.pb.cc:(.text+0x3ee): undefined reference togoogle::protobuf::internal::kEmptyString'
fileformat.pb.cc:(.text+0x413): undefined reference to google::protobuf::internal::kEmptyString' /usr/lib/libosmpbf.a(fileformat.pb.o):fileformat.pb.cc:(.text+0x438): more undefined references togoogle::protobuf::internal::kEmptyString' follow
collect2: ld a retourné 1 code d'état d'exécution
make[2]: *** [osrm-extract] Erreur 1
make[1]: *** [CMakeFiles/osrm-extract.dir/all] Erreur 2
make: *** [all] Erreur 2
Same question as before for libprotobuf
I did the same and worked :). Compilation succeeded. Thank you.
Ok, cool. Happy to hear