I am trying to build OSRM on a Ubuntu system (14.04 LTS, up-to-date, 64 bit), but I am getting a "Could NOT find OSMPBF" error.

First I followed the Ubuntu 14.04 instructions on the Building on Ubuntu page. This appears to have installed everything successfully. Next I followed it with the General Build Instructions:

git clone https://github.com/Project-OSRM/osrm-backend.git
cd osrm-backend
mkdir -p build
cd build
cmake ..

This fails at the cmake line with:

-- Building on a 64 bit system
-- Configuring OSRM in release mode
-- LTO working
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   iostreams
--   program_options
--   regex
--   system
--   thread
--   unit_test_framework
-- Found Intel TBB
-- Looking for Luabind...
-- Found Luabind: /usr/lib/libluabind.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
-- OpenMP support found. Linking just in case for stxxl
-- Looking for OSMPBF...
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  CMakeLists.txt:283 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/richard/osrm/osrm-backend/build/CMakeFiles/CMakeOutput.log".
See also "/home/richard/osrm/osrm-backend/build/CMakeFiles/CMakeError.log".

I can post the logs if necessary: CMakeError.log has a sequence of errors including undefined reference to pthread_create (doesn't appear to be related?) CMakeOutput.log is much bigger, but the last build command reported is

Run Build Command:/usr/bin/make "cmTryCompileExec3258574548/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3258574548.dir/build.make CMakeFiles

...and it appears to have been successful.

Can anyone see what my problem is? Or where I should look? OSRM is new to me (hence my attempt to install & build, so that I can experiment with it), so I am not sure how OSMPBF fits in, or where to look. Also this Linux box has not been used for C++ dev work before, so it is possible a common tool might be missing? (I usually use Linux for Python dev). However the first step from Building on Ubuntu should have installed all the extras (cmake, boost, etc).


Same problem - instructions on OSRM github are incomplete. I've fixed it by:

sudo apt-get install libosmpbf-dev
  • Thanks - that pushes me further forward - now I'm getting an error from CMake that PROTOBUF_LIBRARY has been set to NOTFOUND
    – winwaed
    Sep 6 '15 at 17:14
  • Try to find required libraries here: osrm-installation It looks like you need to install "libprotobuf-dev"
    – dmbreaker
    Sep 7 '15 at 9:56
  • Thanks, yes that has fixed it. Now appears to have built okay. Still early in the learning curve here, but I think OSRM shows a lot of promise. If it lives up to that promise I hope to be eventually a part of the community/dev team...
    – winwaed
    Sep 7 '15 at 15:39

You try to use the unstable version from the develop branch. We recently removed the dependency for OSMPBF.

  • 1
    Perhaps the instructions should give links to both the latest stable and the dev branches?
    – winwaed
    Sep 6 '15 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.