Commit 3db67ddf authored by PRUVOST Florent's avatar PRUVOST Florent

fix problem of empty LIBRARY_DIRS for modules which have a function test

parent bdef190a
......@@ -241,7 +241,12 @@ if (BLAS_FOUND)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${CBLAS_INCLUDE_DIRS};${BLAS_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${CBLAS_LIBRARIES};${BLAS_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "-L${CBLAS_LIBRARY_DIRS} -L${BLAS_LIBRARY_DIRS}")
if (CBLAS_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${CBLAS_LIBRARY_DIRS}")
if (BLAS_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${BLAS_LIBRARY_DIRS}")
endif()
endif()
unset(CBLAS_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -446,56 +446,76 @@ if(NOT CHAMELEON_FOUND OR NOT CHAMELEON_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES "${CHAMELEON_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_FLAGS)
foreach(libdir ${CHAMELEON_LIBRARY_DIRS})
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}")
if (libdir)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${libdir}")
endif()
endforeach()
set(CMAKE_REQUIRED_LIBRARIES "${CHAMELEON_LIBRARIES}")
if (STARPU_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${STARPU_LIBRARY_DIRS}")
if(STARPU_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${STARPU_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES}")
endif()
if (QUARK_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "$QUARK_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${QUARK_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${QUARK_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUARK_LIBRARIES}")
endif()
if (CUDA_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${CUDA_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${CUDA_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${CUDA_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${CUDA_CUBLAS_LIBRARIES};${CUDA_LIBRARIES}")
endif()
if (MAGMA_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MAGMA_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${MAGMA_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${MAGMA_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${${MAGMA_LIBRARIES}}")
endif()
if (MPI_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${MPI_C_LINK_FLAGS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${MPI_C_LINK_FLAGS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
endif()
if (HWLOC_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${HWLOC_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${HWLOC_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${HWLOC_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${HWLOC_LIBRARIES}")
endif()
if (TMG_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${TMG_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${TMG_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${TMG_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TMG_LIBRARIES}")
endif()
if (LAPACKE_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${LAPACKE_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${LAPACKE_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${LAPACKE_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACKE_LIBRARIES}")
endif()
if (CBLAS_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${CBLAS_INCLUDE_DIRS}")
#list(APPEND CMAKE_REQUIRED_FLAGS "-L${CBLAS_LIBRARY_DIRS}")
if(QUARK_LIBRARY_DIRS)
list(APPEND CMAKE_REQUIRED_FLAGS "-L${CBLAS_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${CBLAS_LIBRARIES}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CHAMELEON_EXTRA_LIBRARIES})
#string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
unset(CHAMELEON_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -204,7 +204,9 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${FXT_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${FXT_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "-L${FXT_LIBRARY_DIRS}")
if (FXT_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${FXT_LIBRARY_DIRS}")
endif()
unset(FXT_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -211,7 +211,9 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${HWLOC_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${HWLOC_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "-L${HWLOC_LIBRARY_DIRS}")
if (HWLOC_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${HWLOC_LIBRARY_DIRS}")
endif()
unset(HWLOC_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -241,7 +241,12 @@ if (LAPACK_FOUND)
elseif (CMAKE_Fortran_COMPILER MATCHES ".+ifort.*")
list(APPEND CMAKE_REQUIRED_LIBRARIES "-lifcore")
endif()
set(CMAKE_REQUIRED_FLAGS "-L${LAPACKE_LIBRARY_DIRS} -L${LAPACK_LIBRARY_DIRS}")
if (LAPACKE_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${LAPACKE_LIBRARY_DIRS}")
if(LAPACK_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${LAPACK_LIBRARY_DIRS}")
endif()
endif()
unset(LAPACKE_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -278,7 +278,18 @@ if(NOT MAGMA_FOUND OR NOT MAGMA_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${MAGMA_INCLUDE_DIRS};${CBLAS_INCLUDE_DIRS};${CUDA_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${MAGMA_LIBRARIES};${CBLAS_LIBRARIES};${CUDA_CUBLAS_LIBRARIES};${CUDA_LIBRARIES};${LAPACK_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "-L${MAGMA_LIBRARY_DIRS} -L${CBLAS_LIBRARY_DIRS} -L${CUDA_LIBRARY_DIRS} -L${LAPACK_LIBRARY_DIRS}")
if (MAGMA_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${MAGMA_LIBRARY_DIRS}")
if (CBLAS_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${CBLAS_LIBRARY_DIRS}")
if(CUDA_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${CUDA_LIBRARY_DIRS}")
if(LAPACK_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${LAPACK_LIBRARY_DIRS}")
endif()
endif()
endif()
endif()
unset(MAGMA_WORKS CACHE)
include(CheckFunctionExists)
......
......@@ -191,11 +191,15 @@ if(QUARK_LIBRARIES)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${QUARK_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${QUARK_LIBRARIES};${CMAKE_THREAD_LIBS_INIT}")
set(CMAKE_REQUIRED_FLAGS "-L${QUARK_LIBRARY_DIRS}")
if (QUARK_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${QUARK_LIBRARY_DIRS}")
endif()
if (HWLOC_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${HWLOC_INCLUDE_DIRS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${HWLOC_LIBRARIES}")
list(APPEND CMAKE_REQUIRED_FLAGS "-L${HWLOC_LIBRARIES}")
if (HWLOC_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${HWLOC_LIBRARY_DIRS}")
endif()
endif()
unset(QUARK_WORKS CACHE)
......
......@@ -532,22 +532,37 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
set(CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_FLAGS)
foreach(libdir ${STARPU_LIBRARY_DIRS})
if(libdir)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${libdir}")
endif()
endforeach()
set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES}")
if (HWLOC_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${HWLOC_INCLUDE_DIRS}")
if (HWLOC_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${HWLOC_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${HWLOC_LIBRARIES}")
endif()
if (MPI_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}")
if (MPI_C_LINK_FLAGS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${MPI_C_LINK_FLAGS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}")
endif()
if (CUDA_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${CUDA_INCLUDE_DIRS}")
if (CUDA_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${CUDA_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${CUDA_CUBLAS_LIBRARIES};${CUDA_LIBRARIES}")
endif()
if (MAGMA_FOUND)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MAGMA_INCLUDE_DIRS}")
if (MAGMA_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${MAGMA_LIBRARY_DIRS}")
endif()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${${MAGMA_LIBRARIES}}")
endif()
......
......@@ -191,7 +191,12 @@ if (LAPACK_FOUND)
# check a function to validate the find
set(CMAKE_REQUIRED_INCLUDES "${TMG_INCLUDE_DIRS};${LAPACK_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "${TMG_LIBRARIES};${LAPACK_LIBRARIES}")
set(CMAKE_REQUIRED_FLAGS "-L${TMG_LIBRARY_DIRS} -L${LAPACK_LIBRARY_DIRS}")
if (TMG_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "-L${TMG_LIBRARY_DIRS}")
if (LAPACK_LIBRARY_DIRS)
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -L${LAPACK_LIBRARY_DIRS}")
endif()
endif()
if(TMG_LIBRARIES)
unset(TMG_WORKS CACHE)
......
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