Skip to content

Commit

Permalink
Explicitly link against -lpthread on Unix
Browse files Browse the repository at this point in the history
/usr/bin/ld.lld: error: undefined symbol: pthread_condattr_init
>>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
>>>               src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable())

/usr/bin/ld.lld: error: undefined symbol: pthread_condattr_setclock
>>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
>>>               src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable())

/usr/bin/ld.lld: error: undefined symbol: pthread_condattr_destroy
>>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp
>>>               src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable())
  • Loading branch information
jbeich authored and wwmayer committed Apr 19, 2018
1 parent 6ac274b commit 869b5c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Expand Up @@ -596,6 +596,11 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(Boost ${BOOST_MIN_VERSION}
COMPONENTS filesystem program_options regex signals system thread REQUIRED)

if(UNIX AND NOT APPLE)
# Boost.Thread 1.67+ headers reference pthread_condattr_*
list(APPEND Boost_LIBRARIES pthread)
endif()

IF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "========================================\n"
"boost not found, install the components:\n"
Expand Down

0 comments on commit 869b5c8

Please sign in to comment.