Commit 20f466e5 authored by PRUVOST Florent's avatar PRUVOST Florent

replace libs in CMAKE_THREAD_LIBS_INIT with absolute paths

parent 26ea29d3
......@@ -609,6 +609,17 @@ if( (NOT BLAS_FOUND_WITH_PKGCONFIG) OR BLAS_GIVEN_BY_USER )
else()
find_package(Threads REQUIRED)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(BLAS_SEARCH_LIBS "")
......
......@@ -203,6 +203,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
endif()
set(CHAMELEON_EXTRA_LIBRARIES "")
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
list(APPEND CHAMELEON_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
......
......@@ -222,6 +222,19 @@ if (FFTW_LOOK_FOR_ESSL)
endif()
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(ENV_FFTW_DIR "$ENV{FFTW_DIR}")
set(ENV_FFTW_INCDIR "$ENV{FFTW_INCDIR}")
set(ENV_FFTW_LIBDIR "$ENV{FFTW_LIBDIR}")
......
......@@ -466,6 +466,17 @@ if(BLAS_FOUND)
else()
find_package(Threads REQUIRED)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(LAPACK_SEARCH_LIBS "")
......
......@@ -141,6 +141,17 @@ if (MUMPS_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(MUMPS_EXTRA_LIBRARIES "")
if( THREADS_FOUND )
list(APPEND MUMPS_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
......
......@@ -117,6 +117,17 @@ if (PARSEC_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(PARSEC_EXTRA_LIBRARIES "")
if( THREADS_FOUND )
list(APPEND PARSEC_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
......
......@@ -165,6 +165,17 @@ if (PASTIX_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(PASTIX_EXTRA_LIBRARIES "")
if( THREADS_FOUND )
list(APPEND PASTIX_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
......
......@@ -87,6 +87,17 @@ if (PTSCOTCH_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
# PTSCOTCH depends on MPI, try to find it
if (PTSCOTCH_FIND_REQUIRED)
......
......@@ -88,6 +88,17 @@ if (QUARK_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
# QUARK may depend on HWLOC, try to find it
if (QUARK_LOOK_FOR_HWLOC)
......
......@@ -341,7 +341,17 @@ if(BLAS_FOUND AND LAPACK_FOUND AND MPI_FOUND)
else()
find_package(Threads REQUIRED)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
set(SCALAPACK_SEARCH_LIBS "")
if (BLA_F95)
......
......@@ -76,6 +76,17 @@ if (SCOTCH_FIND_REQUIRED)
else()
find_package(Threads)
endif()
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
# Looking for include
# -------------------
......
......@@ -121,6 +121,17 @@ endif()
# STARPU may depend on pthread, try to find it
find_package(Threads)
if( THREADS_FOUND )
string(REGEX REPLACE "-l" "" THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_THREAD_LIBS_INIT)
foreach(_lib ${THREAD_LIBS})
find_library(THREADS_${_lib}_LIBRARY NAMES ${_lib}
HINTS ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
if (THREADS_${_lib}_LIBRARY)
list(APPEND CMAKE_THREAD_LIBS_INIT ${THREADS_${_lib}_LIBRARY})
endif()
endforeach()
endif ()
if( THREADS_FOUND )
list(APPEND STARPU_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment