Skip to content
Snippets Groups Projects
Unverified Commit b10672cf authored by Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin
Browse files

COMP: Remove obsolete and unused PThreads requirement

Considering that in VegaFEM v4.0, pthreads was replaced with
Intel TBB, this commit removes the references to "pthread" and
also removes the corresponding custom CMake module.

See http://barbic.usc.edu/vega/download.html
parent be55ca42
Branches master
No related tags found
No related merge requests found
find_path(PTHREAD_INCLUDE_DIR
pthread.h
)
set(PTHREAD_INCLUDE_DIR ${PTHREAD_INCLUDE_DIR})
find_library(PTHREAD_RELEASE_LIBRARY
NAMES
pthread
libpthread
)
if (EXISTS ${PTHREAD_RELEASE_LIBRARY})
list(APPEND PTHREAD_LIBRARIES optimized ${PTHREAD_RELEASE_LIBRARY})
endif()
find_library(PTHREAD_DEBUG_LIBRARY
NAMES
pthreadd
libpthreadd
)
if (EXISTS ${PTHREAD_DEBUG_LIBRARY})
list(APPEND PTHREAD_LIBRARIES debug ${PTHREAD_DEBUG_LIBRARY})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PTHREAD
REQUIRED_VARS
PTHREAD_INCLUDE_DIR
PTHREAD_LIBRARIES)
mark_as_advanced(
PTHREAD_INCLUDE_DIR
PTHREAD_DEBUG_LIBRARY
PTHREAD_RELEASE_LIBRARY)
if(PTHREAD_FOUND AND NOT TARGET Threads::Threads)
add_library(Threads::Threads INTERFACE IMPORTED)
target_include_directories(Threads::Threads INTERFACE "${PTHREAD_INCLUDE_DIR}")
if (EXISTS ${PTHREAD_DEBUG_LIBRARY})
target_link_libraries(Threads::Threads INTERFACE debug ${PTHREAD_DEBUG_LIBRARY})
endif()
if (EXISTS ${PTHREAD_RELEASE_LIBRARY})
target_link_libraries(Threads::Threads INTERFACE optimized ${PTHREAD_RELEASE_LIBRARY})
endif()
endif()
# Add access to dependencies Find<package>.cmake files
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMake)
set(VegaFEM_ENABLE_PTHREADS_SUPPORT @VegaFEM_ENABLE_PTHREADS_SUPPORT@)
if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
if(WIN32)
find_package(PThreads REQUIRED)
else()
find_package(Threads REQUIRED)
endif()
endif()
# Remove access to those dependencies
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMake)
include("${CMAKE_CURRENT_LIST_DIR}/VegaFEMTargets.cmake")
......@@ -32,8 +32,6 @@ option(VegaFEM_BUILD_RIGID_BODIES "Build Rigid body support" OFF)
option(VegaFEM_ENABLE_OpenGL_SUPPORT "Should modules that require OpenGL be enabled?" ON)
option(VegaFEM_ENABLE_PTHREADS_SUPPORT "Use multithreading (pthread)" ON)
option(VegaFEM_ENABLE_ExpoKit_SUPPORT "Should matrix classes use ExpoKit for exponentiation?" OFF)
# TODO: define USE_EXPOKIT if enabled
......@@ -220,20 +218,6 @@ if (VegaFEM_ENABLE_OpenGL_SUPPORT)
endif()
endif()
if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
if(WIN32)
set(THREADS_USE_PTHREADS_WIN32 1)
find_package(PThreads REQUIRED)
configure_file(
CMake/FindPThreads.cmake
"${CMAKE_CURRENT_BINARY_DIR}/CMake/FindPThreads.cmake"
COPYONLY
)
else()
find_package(Threads REQUIRED)
endif()
endif()
add_subdirectory(libraries)
......
......@@ -8,11 +8,6 @@ set(clothbw_headers
clothBWFromObjMesh.h
)
# if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
# list(APPEND clothbw_headers clothBWMT.h)
# list(APPEND clothbw_sources clothBWMT.cpp)
# endif()
vega_add_library(clothBW
SOURCES
${clothbw_sources}
......@@ -25,5 +20,4 @@ target_link_libraries(clothBW
objMesh
minivector
sparseMatrix
#Threads::Threads
)
......@@ -7,5 +7,4 @@ vega_add_library(glslPhong
target_link_libraries(glslPhong
PUBLIC
${OPENGL_LIBRARIES}
Threads::Threads
)
......@@ -22,12 +22,6 @@ set(isotropichyperelasticfem_hdrs
neoHookeanIsotropicMaterial.h
)
#if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
# list(APPEND isotropichyperelasticfem_hdrs isotropicHyperelasticFEMMT.h)
# list(APPEND isotropichyperelasticfem_srcs isotropicHyperelasticFEMMT.cpp)
#endif()
vega_add_library(isotropicHyperelasticFEM
SOURCES
${isotropichyperelasticfem_srcs}
......@@ -39,5 +33,4 @@ target_link_libraries(isotropicHyperelasticFEM
minivector
volumetricMesh
sparseMatrix
Threads::Threads
)
......@@ -17,11 +17,6 @@ set(massspringsystem_hdrs
massSpringSystemFromTetMeshConfigFile.h
)
# if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
# list(APPEND massspringsystem_srcs massSpringSystemMT.cpp)
# list(APPEND massspringsystem_hdrs massSpringSystemMT.h)
# endif()
if (VegaFEM_ENABLE_OpenGL_SUPPORT)
list(APPEND massspringsystem_srcs renderSprings.cpp)
list(APPEND massspringsystem_hdrs renderSprings.h)
......@@ -39,7 +34,6 @@ target_link_libraries(massSpringSystem
volumetricMesh
configFile
sparseMatrix
Threads::Threads
INTERFACE
minivector
)
......
......@@ -32,12 +32,8 @@ vega_add_library(matrix
${matrix_hdrs}
)
# target_compile_options(matrix PUBLIC -lpthread -lm -liomp5 -lgfortran -Wl,--no-as-needed -m64 -ldl)
target_compile_options(matrix PUBLIC -Wl,--no-as-needed -m64)
# set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-as-needed")
target_link_libraries(matrix
PUBLIC
matrixIO
......
......@@ -22,15 +22,6 @@ set(stvk_hdrs
StVKTetHighMemoryABCD.h
)
# if(VegaFEM_ENABLE_PTHREADS_SUPPORT)
# list(APPEND stvk_srcs
# StVKInternalForcesMT.cpp
# StVKStiffnessMatrixMT.cpp)
# list(APPEND stvk_hdrs
# StVKInternalForcesMT.h
# StVKStiffnessMatrixMT.h)
# endif()
vega_add_library(stvk
SOURCES
${stvk_srcs}
......@@ -42,5 +33,4 @@ target_link_libraries(stvk
minivector
volumetricMesh
sparseMatrix
Threads::Threads
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment