Ask Your Question
0

Error in ´rosmake rgbdslam_freiburg´: "undefined reference to GOMP ..."

asked 2013-06-03 10:09:19 -0600

kuroro gravatar image

updated 2016-10-24 08:37:06 -0600

ngrennan gravatar image

Hi

rosmake rgbdslam_freiburg

I get this error:

{-------------------------------------------------------------------------------
  make[3]: se ingresa al directorio «/root/ros_workspace/rgbdslam_freiburg/rgbdslam/build»
  make[3]: se sale del directorio «/root/ros_workspace/rgbdslam_freiburg/rgbdslam/build»
  make[3]: se ingresa al directorio «/root/ros_workspace/rgbdslam_freiburg/rgbdslam/build»
  Linking CXX executable ../bin/rgbdslam
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_sections_next'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_sections_end_nowait'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_atomic_start'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_atomic_end'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_sections_next'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_parallel_sections_start'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/node.cpp:1404: error: undefined reference to 'GOMP_parallel_end'
  /usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h:92: error: undefined reference to 'omp_get_thread_num'
  /usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h:93: error: undefined reference to 'omp_get_num_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_num_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_thread_num'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_num_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_thread_num'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_num_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:131: error: undefined reference to 'omp_get_thread_num'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_start'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_end'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:47: error: undefined reference to 'omp_get_max_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_start'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_end'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:47: error: undefined reference to 'omp_get_max_threads'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_start'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:145: error: undefined reference to 'GOMP_parallel_end'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:47: error: undefined reference to 'omp_get_max_threads'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/misc.cpp:873: error: undefined reference to 'GOMP_atomic_start'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/misc.cpp:863: error: undefined reference to 'GOMP_atomic_end'
  /root/ros_workspace/rgbdslam_freiburg/rgbdslam/src/misc.cpp:863: error: undefined reference to 'GOMP_parallel_start'
  /usr/include/eigen3/Eigen/src/Core/products/Parallelizer.h:47: error: undefined reference to 'omp_get_max_threads'
  collect2: ld devolvió el estado de salida 1
  make[3]: *** [../bin/rgbdslam] Error 1
  make[3]: se sale del directorio «/root/ros_workspace/rgbdslam_freiburg/rgbdslam/build»
  make[2]: *** [CMakeFiles/rgbdslam.dir/all] Error 2
  make[2]: se sale del directorio «/root/ros_workspace/rgbdslam_freiburg/rgbdslam/build»
  make[1]: *** [all] Error 2
  make[1]: se sale del directorio ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
0

answered 2013-06-07 05:12:09 -0600

As this error also appears in the Eigen sources I would guess that you have a corrupted setup or lack support for OpenMP.

If you can't solve it otherwise, you could try to remove all lines containing #pragma omp from rgbdslam, the effect should be minimal. But this won't solve the issues with it in the Eigen code.

edit flag offensive delete link more
1

answered 2013-12-12 04:58:12 -0600

sai gravatar image

updated 2013-12-12 05:00:12 -0600

This has solved the similar errors which I encountered in an other pkg. Hopefully it will solve yours too :)

Add these lines in your CMakeLists.txt

#check for OpenMP
find_package(OpenMP)
if(OPENMP_FOUND)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
  if(MSVC90 OR MSVC10)
    if(MSVC90)
      set(OPENMP_DLL VCOMP90)
    elseif(MSVC10)
      set(OPENMP_DLL VCOMP100)
    endif(MSVC90)
    set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DELAYLOAD:${OPENMP_DLL}D.dll")
    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DELAYLOAD:${OPENMP_DLL}.dll")
  endif(MSVC)
else(OPENMP_FOUND)
  message (STATUS "OpenMP not found")
endif()

if (MSVC)
  Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /O2 ${SSE_FLAGS}")
else (MSVC)
  set(CMAKE_CXX_FLAGS "-O3 ${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${SSE_FLAGS}")
  set(CMAKE_CXX_FLAGS_RELEASE " ${CMAKE_CXX_FLAGS} -O3 ${SSE_FLAGS}")
endif (MSVC)
edit flag offensive delete link more
0

answered 2014-05-21 02:52:24 -0600

NANZHE LI gravatar image

you sovle this error?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-06-03 10:09:19 -0600

Seen: 3,509 times

Last updated: May 21 '14