Open bmhan12 opened 4 years ago
# Removes -pthread from BLT CUDA libraries lists
if (ENABLE_CUDA)
set(_cuda_libraries)
foreach(_lib ${BLT_CUDA_LIBRARIES})
if ("${_lib}" STREQUAL "-pthread")
list(APPEND _cuda_libraries "-lpthread")
else()
list(APPEND _cuda_libraries "${_lib}")
endif()
endforeach()
set(BLT_CUDA_LIBRARIES "${_cuda_libraries}" CACHE STRING "" FORCE)
set(BLT_CUDA_RUNTIME_LIBRARIES "${_cuda_libraries}" CACHE STRING "" FORCE)
endif()
The above code fixed it in GEOSX. This is also handled (maybe incorrectly) in SetupMPI.cmake by simply removing the -pthread argument from the link command.
When reconfiguring a GEOSX build with CUDA using older versions of CMake (3.9 and 3.12 was tested), BLT_CUDA_LIBRARIES and BLT_CUDA_RUNTIME_LIBRARIES had their
-lpthread
flag change to-pthread
.