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

undefined reference to symbol 'omp_get_max_threads@@OMP_1.0' during make on Debian "jessie" #1420

Closed
rebos opened this issue Mar 19, 2015 · 3 comments

Comments

@rebos
Copy link

rebos commented Mar 19, 2015

Im trying to build current "osrm-backend" - cloned on 2015-03-19 - on Debian "jessie".

During make it comes to this error message:

[...]
Linking CXX executable osrm-extract
/usr/bin/ld: CMakeFiles/osrm-extract.dir/extractor/extraction_containers.cpp.o: undefined reference to symbol 'omp_get_max_threads@@OMP_1.0'
//usr/lib/x86_64-linux-gnu/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/osrm-extract.dir/build.make:268: recipe for target 'osrm-extract' failed
make[2]: *** [osrm-extract] Error 1
CMakeFiles/Makefile2:555: recipe for target 'CMakeFiles/osrm-extract.dir/all' failed
make[1]: *** [CMakeFiles/osrm-extract.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

I found issues #977, #1361 and #1373 which make me think, the problem should already be solved. But currently the error still occurs on my development system.

Inspired by the issues mentioned, I found a workaround by editing "CMakeLists.txt". I added "target_link_libraries(osrm-extract gomp)" to a certain paragraph. It looks like this:

if(UNIX AND NOT APPLE)
  target_link_libraries(osrm-prepare rt)
  target_link_libraries(osrm-extract gomp)
  target_link_libraries(osrm-datastore rt)
  target_link_libraries(OSRM rt)
endif()

After that "make" and "make install" successfully finish as expected. I have to admit, that I actually don't know, what this change by me really does or if it has unwanted side-effects. It seems to work for me. But it would be nice, if someone understanding the problem, could repair this.

Thanks and greetings,
rebos

@lhahne
Copy link

lhahne commented Mar 20, 2015

I just got pretty much the same error on Centos 7 with current master

extraction_containers.cpp:(.text._ZN5stxxl4sortINS_15vector_iteratorI21InternalExtractorEdgeNS_2RCEyxLj2097152ENS_9lru_pagerILj8EEELj4EEE17CmpEdgeByTargetIDEEvT_S8_T0_y[_ZN5stxxl4sortINS_15vector_iteratorI21InternalExtractorEdgeNS_2RCEyxLj2097152ENS_9lru_pagerILj8EEELj4EEE17CmpEdgeByTargetIDEEvT_S8_T0_y]+0x1731): undefined reference to `omp_get_max_threads'

I managed to fix this by adding the following line to CMakeLists.txt

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")

@DennisOSRM
Copy link
Collaborator

try the latest code from develop branch. it should already contain a fix for this issue

@rebos
Copy link
Author

rebos commented Mar 20, 2015

Thanks for the quick response!

Not being a developer I cowardly preferred stable "v4.5.0" ;-) But after checking out "develop" I was able to run "make" successfully. The essential changes during my effort were these:

git clone --no-checkout https:/Project-OSRM/osrm-backend.git
cd osrm-backend
git checkout develop

Building on this branch I did not need to edit any files.

Greetings,
rebos

@rebos rebos closed this as completed Mar 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants