osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Build from source Error: TBB not found.

Open handcath opened this issue 3 years ago • 13 comments

Hi,

Trying to build 5.26 on Mac OS and Ubuntu 22.04. I am getting the following error (on max os or ubuntu 22.04) when running cmake .. The old fix (#6253) to build OSRM with the -DENABLE_MASON=ON does not work.

ERROR: Intel TBB NOT found! -- Looked for Threading Building Blocks in /Library/Frameworks/Intel_TBB.framework/Versions CMake Error at cmake/FindTBB.cmake:274 (message): Could NOT find TBB library. Call Stack (most recent call first): CMakeLists.txt:518 (find_package)

handcath avatar Aug 07 '22 18:08 handcath

Ran into the same issue,

it seems they are migrating to Conan package manager instead of Mason. https://github.com/Project-OSRM/osrm-backend/commit/589becbfec1f4ab19972bd2f445a8fdd0cc6ca25

You could use the last Mason commit until the docs are updated, that one works for me :) https://github.com/Project-OSRM/osrm-backend/commit/4e8ee288d98bdf0e9725f11b5392f6276ede8bcb

Hope someone confirms this, possibly supplying Conan instructions, as my attempt building with it failed.

nitko12 avatar Aug 08 '22 12:08 nitko12

Hmm even https://github.com/Project-OSRM/osrm-backend/commit/4e8ee288d98bdf0e9725f11b5392f6276ede8bcb seems to have some bugs, ends up using too much memory and crashing upon extracting maps, commit before it doesn't.

nitko12 avatar Aug 08 '22 15:08 nitko12

Hmm even 4e8ee28 seems to have some bugs, ends up using too much memory and crashing upon extracting maps, commit before it doesn't.

Could you elaborate here? What exactly are you doing and have issues?

SiarheiFedartsou avatar Aug 08 '22 20:08 SiarheiFedartsou

4e8ee28 appears to have successfully built, no reported memory usage issues, thank you. However, when trying to run the example.cpp I get an include error: /usr/local/include/osrm/engine/api/match_parameters.hpp:31:10: fatal error: 'engine/api/route_parameters.hpp' file not found #include "engine/api/route_parameters.hpp"

The include/osrm/* files don't seem to useable.

handcath avatar Aug 09 '22 00:08 handcath

@handcath did you reinstall OSRM before it with make install? We build example on CI and it works. Also would appreciate if you provide exact steps with commands you are executing.

SiarheiFedartsou avatar Aug 09 '22 05:08 SiarheiFedartsou

Could you elaborate here? What exactly are you doing and have issues?

I'm sorry for hijacking this issue, but could you try running osrm-extract after building https://github.com/Project-OSRM/osrm-backend/commit/4e8ee288d98bdf0e9725f11b5392f6276ede8bcb

In particular, I've tried extracting Geofabrik's United States, Midwest and New York just to make sure it wasn't a ram issue, but still failed even on New York, which is not that big of a map (I'm using 128 gb ram on Ubuntu).

I've tried it on macOS Monterey 12.4 and Ubuntu 22.04, having the same result.

The process keeps on allocating more memory, and after filling all ram and swap just terminates with "Killed." message.

I'm building it using Mason.

nitko12 avatar Aug 09 '22 12:08 nitko12

Could you elaborate here? What exactly are you doing and have issues?

I'm sorry for hijacking this issue, but could you try running osrm-extract after building 4e8ee28

In particular, I've tried extracting Geofabrik's United States, Midwest and New York just to make sure it wasn't a ram issue, but still failed even on New York, which is not that big of a map (I'm using 128 gb ram on Ubuntu).

I've tried it on macOS Monterey 12.4 and Ubuntu 22.04, having the same result.

The process keeps on allocating more memory, and after filling all ram and swap just terminates with "Killed." message.

I'm building it using Mason.

Okay, will try to look in the nearest days. Btw master was migrated to Conan already.

SiarheiFedartsou avatar Aug 09 '22 12:08 SiarheiFedartsou

@SiarheiFedartsou.

here are the commands I ran on macOS 12.3: mkdir -p build && cd build cmake .. make install

then to compile the example.cpp file: g++ -I/usr/local/include ./example.cpp -o ./example. Actually I ran it with or without the -I path. Throws the following include error:

In file included from ./example.cpp:1: In file included from /usr/local/include/osrm/match_parameters.hpp:31: /usr/local/include/osrm/engine/api/match_parameters.hpp:31:10: fatal error: 'engine/api/route_parameters.hpp' file not found #include "engine/api/route_parameters.hpp" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

handcath avatar Aug 09 '22 13:08 handcath

@SiarheiFedartsou.

here are the commands I ran on macOS 12.3: mkdir -p build && cd build cmake .. make install

then to compile the example.cpp file: g++ -I/usr/local/include ./example.cpp -o ./example. Actually I ran it with or without the -I path. Throws the following include error:

In file included from ./example.cpp:1: In file included from /usr/local/include/osrm/match_parameters.hpp:31: /usr/local/include/osrm/engine/api/match_parameters.hpp:31:10: fatal error: 'engine/api/route_parameters.hpp' file not found #include "engine/api/route_parameters.hpp" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Example has its own CMakeLists.txt. Try smth like:

cd example
mkdir build
cd build
cmake ..
make 

instead of manually calling g++

SiarheiFedartsou avatar Aug 09 '22 13:08 SiarheiFedartsou

@SiarheiFedartsou, thank you. ./osrm-example built successfully.

However, memory usage as reported by @nitko12 is an issue when building new osrm file. Following osrm file extract runs from the example folder. osrm-extract ./osm-maps/britain-and-ireland-latest.osm.pbf -p ../../profiles/car.lua The process gets killed by the OS. zsh: killed.

NB: I cannot use old(er) osrm files as this is 5.27, which cannot run osrm files built on 5.26.

handcath avatar Aug 09 '22 13:08 handcath

@SiarheiFedartsou, thank you. ./osrm-example built successfully.

However, memory usage as reported by @nitko12 is an issue when building new osrm file. Following osrm file extract runs from the example folder. osrm-extract ./osm-maps/britain-and-ireland-latest.osm.pbf -p ../../profiles/car.lua The process gets killed by the OS. zsh: killed.

NB: I cannot use old(er) osrm files as this is 5.27, which cannot run osrm files built on 5.26.

~Weird, just tried to run it against england-latest.osm.pbf and it finished for me successfully. With peak RAM usage ~5.5GB.

Reproduced.

SiarheiFedartsou avatar Aug 09 '22 15:08 SiarheiFedartsou

@SiarheiFedartsou, thank you. ./osrm-example built successfully. However, memory usage as reported by @nitko12 is an issue when building new osrm file. Following osrm file extract runs from the example folder. osrm-extract ./osm-maps/britain-and-ireland-latest.osm.pbf -p ../../profiles/car.lua The process gets killed by the OS. zsh: killed. NB: I cannot use old(er) osrm files as this is 5.27, which cannot run osrm files built on 5.26.

~Weird, just tried to run it against england-latest.osm.pbf and it finished for me successfully. With peak RAM usage ~5.5GB.

Reproduced.

The only pbf files I can successfully 'osrm-extract' are very small ones, e.g. Andorra with is 2.2MB in size...

handcath avatar Aug 10 '22 15:08 handcath

The only pbf files I can successfully 'osrm-extract' are very small ones, e.g. Andorra with is 2.2MB in size...

Please, see fix in https://github.com/Project-OSRM/osrm-backend/pull/6304, but we probably need someone with write access to the repo to merge it in master 🤔

SiarheiFedartsou avatar Aug 10 '22 15:08 SiarheiFedartsou