Skip to content

Commit

Permalink
Try fix openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias-Fischer committed Dec 9, 2020
1 parent ffec31f commit 11f351a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions patch/ros-noetic-moveit-planners-ompl.osx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/ompl_interface/CMakeLists.txt b/ompl_interface/CMakeLists.txt
index e44e0ecb1..bb1a6fdbb 100644
--- a/ompl_interface/CMakeLists.txt
+++ b/ompl_interface/CMakeLists.txt
@@ -21,6 +21,23 @@ add_library(${MOVEIT_LIB_NAME}
)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")

+if(CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(OpenMP_C "${CMAKE_C_COMPILER}")
+ set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+ set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
+ set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+ set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+ set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
+endif()
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
+ set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+ set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
+ set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+ set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+ set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+endif()
+
find_package(OpenMP REQUIRED)

target_link_libraries(${MOVEIT_LIB_NAME} ${OMPL_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES})

0 comments on commit 11f351a

Please sign in to comment.