Commit 81fb9ee2 authored by PRUVOST Florent's avatar PRUVOST Florent

even if the package is not required we must set libraries to not found if function test fails

parent b7c13137
......@@ -253,17 +253,15 @@ if (BLAS_FOUND)
set(CBLAS_LIBRARY_DIRS "${CBLAS_LIBRARY_DIRS}" "${BLAS_LIBRARY_DIRS}")
set(CBLAS_INCLUDE_DIRS "${CMAKE_REQUIRED_INCLUDES}")
else()
if (CBLAS_FIND_REQUIRED)
if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas : test of cblas_dscal with cblas and blas libraries fails")
message(STATUS "CBLAS_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CBLAS_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "CBLAS_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for cblas : set CBLAS_LIBRARIES to NOTFOUND")
endif()
set(CBLAS_LIBRARIES "CBLAS_LIBRARIES-NOTFOUND")
if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas : test of cblas_dscal with cblas and blas libraries fails")
message(STATUS "CBLAS_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CBLAS_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "CBLAS_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for cblas : set CBLAS_LIBRARIES to NOTFOUND")
endif()
set(CBLAS_LIBRARIES "CBLAS_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -508,17 +508,15 @@ if(NOT CHAMELEON_FOUND OR NOT CHAMELEON_LIBRARIES)
set(CHAMELEON_LIBRARY_DIRS "${CMAKE_REQUIRED_FLAGS}")
set(CHAMELEON_INCLUDE_DIRS "${CMAKE_REQUIRED_INCLUDES}")
else()
if (CHAMELEON_FIND_REQUIRED)
if(NOT CHAMELEON_FIND_QUIETLY)
message(STATUS "Looking for chameleon : test of MORSE_Init fails")
message(STATUS "CHAMELEON_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CHAMELEON_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "CHAMELEON_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for chameleon : set CHAMELEON_LIBRARIES to NOTFOUND")
endif()
set(CHAMELEON_LIBRARIES "CHAMELEON_LIBRARIES-NOTFOUND")
if(NOT CHAMELEON_FIND_QUIETLY)
message(STATUS "Looking for chameleon : test of MORSE_Init fails")
message(STATUS "CHAMELEON_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CHAMELEON_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "CHAMELEON_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for chameleon : set CHAMELEON_LIBRARIES to NOTFOUND")
endif()
set(CHAMELEON_LIBRARIES "CHAMELEON_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -212,17 +212,15 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
mark_as_advanced(FXT_WORKS)
if(NOT FXT_WORKS)
if (FXT_FIND_REQUIRED)
if(NOT FXT_FIND_QUIETLY)
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "FXT_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "FXT_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "FXT_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for fxt : set FXT_LIBRARIES to NOTFOUND")
endif()
set(FXT_LIBRARIES "FXT_LIBRARIES-NOTFOUND")
if(NOT FXT_FIND_QUIETLY)
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "FXT_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "FXT_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "FXT_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for fxt : set FXT_LIBRARIES to NOTFOUND")
endif()
set(FXT_LIBRARIES "FXT_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -219,17 +219,15 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
mark_as_advanced(HWLOC_WORKS)
if(NOT HWLOC_WORKS)
if (HWLOC_FIND_REQUIRED)
if(NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails")
message(STATUS "HWLOC_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "HWLOC_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "HWLOC_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for hwloc : set HWLOC_LIBRARIES to NOTFOUND")
endif()
set(HWLOC_LIBRARIES "HWLOC_LIBRARIES-NOTFOUND")
if(NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails")
message(STATUS "HWLOC_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "HWLOC_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "HWLOC_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for hwloc : set HWLOC_LIBRARIES to NOTFOUND")
endif()
set(HWLOC_LIBRARIES "HWLOC_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -253,17 +253,15 @@ if (LAPACK_FOUND)
set(LAPACKE_LIBRARY_DIRS "${LAPACKE_LIBRARY_DIRS}" "${LAPACK_LIBRARY_DIRS}")
set(LAPACKE_INCLUDE_DIRS ${CMAKE_REQUIRED_INCLUDES})
else()
if (LAPACKE_FIND_REQUIRED)
if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke: test of LAPACKE_dgeqrf with lapacke and lapack libraries fails")
message(STATUS "LAPACKE_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "LAPACKE_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "LAPACKE_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for lapacke : set LAPACKE_LIBRARIES to NOTFOUND")
endif()
set(LAPACKE_LIBRARIES "LAPACKE_LIBRARIES-NOTFOUND")
if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke: test of LAPACKE_dgeqrf with lapacke and lapack libraries fails")
message(STATUS "LAPACKE_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "LAPACKE_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "LAPACKE_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for lapacke : set LAPACKE_LIBRARIES to NOTFOUND")
endif()
set(LAPACKE_LIBRARIES "LAPACKE_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -290,18 +290,16 @@ if(NOT MAGMA_FOUND OR NOT MAGMA_LIBRARIES)
set(MAGMA_LIBRARY_DIRS "${MAGMA_LIBRARY_DIRS}" "${CBLAS_LIBRARY_DIRS}" "${CUDA_LIBRARY_DIRS}" "${LAPACK_LIBRARY_DIRS}")
set(MAGMA_INCLUDE_DIRS "${CMAKE_REQUIRED_INCLUDES}")
else()
if (MAGMA_FIND_REQUIRED)
if(NOT MAGMA_FIND_QUIETLY)
message(STATUS "Looking for magma : test of magma_dgetrf with
magma, cblas, cuda and lapack libraries fails")
message(STATUS "MAGMA_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "MAGMA_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "MAGMA_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for magma : set MAGMA_LIBRARIES to NOTFOUND")
endif()
set(MAGMA_LIBRARIES "MAGMA_LIBRARIES-NOTFOUND")
if(NOT MAGMA_FIND_QUIETLY)
message(STATUS "Looking for magma : test of magma_dgetrf with
magma, cblas, cuda and lapack libraries fails")
message(STATUS "MAGMA_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "MAGMA_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "MAGMA_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for magma : set MAGMA_LIBRARIES to NOTFOUND")
endif()
set(MAGMA_LIBRARIES "MAGMA_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -20,6 +20,7 @@
# PTSCOTCH_INCLUDE_DIRS - ptscotch include directories
# PTSCOTCH_LIBRARY_DIRS - Link directories for ptscotch libraries
# PTSCOTCH_LIBRARIES - ptscotch component libraries to be linked
# PTSCOTCH_INTSIZE - Number of octets occupied by a SCOTCH_Num
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DPTSCOTCH=path/to/ptscotch):
# PTSCOTCH_DIR - Where to find the base directory of ptscotch
......@@ -127,7 +128,7 @@ else ()
set(PTSCOTCH_INCLUDE_DIRS "PTSCOTCH_INCLUDE_DIRS-NOTFOUND")
if (NOT PTSCOTCH_FIND_QUIETLY)
message(STATUS "Looking for ptscotch -- ptscotch.h not found")
endif
endif()
endif()
......@@ -205,6 +206,45 @@ foreach(ptscotch_lib ${PTSCOTCH_libs_to_find})
endforeach()
# Check the size of SCOTCH_Num
# ---------------------------------
set(CMAKE_REQUIRED_INCLUDES ${PTSCOTCH_INCLUDE_DIRS})
include(CheckCSourceRuns)
set(PTSCOTCH_C_TEST_SCOTCH_Num_4 "
#include <stdio.h>
#include <ptscotch.h>
int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 4)
return 0;
else
return 1;
}
")
set(PTSCOTCH_C_TEST_SCOTCH_Num_8 "
#include <stdio.h>
#include <ptscotch.h>
int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 8)
return 0;
else
return 1;
}
")
set(CMAKE_REQUIRED_INCLUDES "")
check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_4}" PTSCOTCH_Num_4)
if(NOT PTSCOTCH_Num_4)
check_c_source_runs("${PTSCOTCH_C_TEST_SCOTCH_Num_8}" PTSCOTCH_Num_8)
if(NOT PTSCOTCH_Num_8)
set(PTSCOTCH_INTSIZE -1)
else()
set(PTSCOTCH_INTSIZE 8)
endif()
else()
set(PTSCOTCH_INTSIZE 4)
endif()
# check that PTSCOTCH has been found
# ---------------------------------
include(FindPackageHandleStandardArgs)
......
......@@ -206,17 +206,15 @@ if(QUARK_LIBRARIES)
if(QUARK_WORKS)
set(QUARK_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
else()
if (QUARK_FIND_REQUIRED)
if(NOT QUARK_FIND_QUIETLY)
message(STATUS "Looking for quark : test of QUARK_New with quark library fails")
message(STATUS "QUARK_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "QUARK_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "QUARK_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for quark : set QUARK_LIBRARIES to NOTFOUND")
endif()
set(QUARK_LIBRARIES "QUARK_LIBRARIES-NOTFOUND")
if(NOT QUARK_FIND_QUIETLY)
message(STATUS "Looking for quark : test of QUARK_New with quark library fails")
message(STATUS "QUARK_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "QUARK_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "QUARK_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for quark : set QUARK_LIBRARIES to NOTFOUND")
endif()
set(QUARK_LIBRARIES "QUARK_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -20,6 +20,7 @@
# SCOTCH_INCLUDE_DIRS - scotch include directories
# SCOTCH_LIBRARY_DIRS - Link directories for scotch libraries
# SCOTCH_LIBRARIES - scotch component libraries to be linked
# SCOTCH_INTSIZE - Number of octets occupied by a SCOTCH_Num
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DSCOTCH=path/to/scotch):
# SCOTCH_DIR - Where to find the base directory of scotch
......@@ -197,6 +198,46 @@ foreach(scotch_lib ${SCOTCH_libs_to_find})
endforeach()
# Check the size of SCOTCH_Num
# ---------------------------------
set(CMAKE_REQUIRED_INCLUDES ${SCOTCH_INCLUDE_DIRS})
include(CheckCSourceRuns)
set(SCOTCH_C_TEST_SCOTCH_Num_4 "
#include <stdio.h>
#include <scotch.h>
int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 4)
return 0;
else
return 1;
}
")
set(SCOTCH_C_TEST_SCOTCH_Num_8 "
#include <stdio.h>
#include <scotch.h>
int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 8)
return 0;
else
return 1;
}
")
set(CMAKE_REQUIRED_INCLUDES "")
check_c_source_runs("${SCOTCH_C_TEST_SCOTCH_Num_4}" SCOTCH_Num_4)
if(NOT SCOTCH_Num_4)
check_c_source_runs("${SCOTCH_C_TEST_SCOTCH_Num_8}" SCOTCH_Num_8)
if(NOT SCOTCH_Num_8)
set(SCOTCH_INTSIZE -1)
else()
set(SCOTCH_INTSIZE 8)
endif()
else()
set(SCOTCH_INTSIZE 4)
endif()
# check that SCOTCH has been found
# ---------------------------------
include(FindPackageHandleStandardArgs)
......
......@@ -564,17 +564,15 @@ if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
set(STARPU_LIBRARY_DIRS "${CMAKE_REQUIRED_FLAGS}")
set(STARPU_INCLUDE_DIRS "${CMAKE_REQUIRED_INCLUDES}")
else()
if (STARPU_FIND_REQUIRED)
if(NOT STARPU_FIND_QUIETLY)
message(STATUS "Looking for starpu : test of starpu_init fails")
message(STATUS "STARPU_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "STARPU_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "STARPU_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for starpu : set STARPU_LIBRARIES to NOTFOUND")
endif()
set(STARPU_LIBRARIES "STARPU_LIBRARIES-NOTFOUND")
if(NOT STARPU_FIND_QUIETLY)
message(STATUS "Looking for starpu : test of starpu_init fails")
message(STATUS "STARPU_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "STARPU_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "STARPU_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for starpu : set STARPU_LIBRARIES to NOTFOUND")
endif()
set(STARPU_LIBRARIES "STARPU_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
......@@ -217,17 +217,15 @@ if (LAPACK_FOUND)
set(TMG_LIBRARY_DIRS "${TMG_LIBRARY_DIRS}" "${LAPACK_LIBRARY_DIRS}")
set(TMG_INCLUDE_DIRS ${CMAKE_REQUIRED_INCLUDES})
else()
if (TMG_FIND_REQUIRED)
if(NOT TMG_FIND_QUIETLY)
message(STATUS "Looking for tmg: test of dlarnv and dlagsy with tmg and lapack libraries fails")
message(STATUS "TMG_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "TMG_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "TMG_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for tmg : set TMG_LIBRARIES to NOTFOUND")
endif()
set(TMG_LIBRARIES "TMG_LIBRARIES-NOTFOUND")
if(NOT TMG_FIND_QUIETLY)
message(STATUS "Looking for tmg: test of dlarnv and dlagsy with tmg and lapack libraries fails")
message(STATUS "TMG_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "TMG_LIBRARY_DIRS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "TMG_INCLUDE_DIRS: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for tmg : set TMG_LIBRARIES to NOTFOUND")
endif()
set(TMG_LIBRARIES "TMG_LIBRARIES-NOTFOUND")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......
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