Commit 355b57e7 authored by PRUVOST Florent's avatar PRUVOST Florent

add a condition to MAGMA version we are depending on (with pkg-config)

parent 65b50f55
......@@ -306,8 +306,9 @@ if(NOT CHAMELEON_SIMULATION)
#----------------------------------------------
if ( CUDA_FOUND )
if ( CHAMELEON_USE_MAGMA )
set(CHAMELEON_CACHE_VERSION "1.4" CACHE STRING "oldest MAGMA version desired")
set(MAGMA_DIR "" CACHE PATH "Root directory of MAGMA library")
find_package(MAGMA REQUIRED COMPONENTS CBLAS LAPACK CUDA)
find_package(MAGMA ${CHAMELEON_CACHE_VERSION} REQUIRED COMPONENTS CBLAS LAPACK CUDA)
set(HAVE_MAGMA ${MAGMA_FOUND})
if ( MAGMA_FOUND )
......
......@@ -94,6 +94,27 @@ if(PKG_CONFIG_EXECUTABLE)
endif()
endif()
if (MAGMA_FIND_VERSION_EXACT STREQUAL 1)
if( NOT (MAGMA_FIND_VERSION_MAJOR STREQUAL MAGMA_VERSION_MAJOR) OR
NOT (MAGMA_FIND_VERSION_MINOR STREQUAL MAGMA_VERSION_MINOR) )
if(NOT MAGMA_FIND_QUIETLY)
message(FATAL_ERROR
"MAGMA version found is ${MAGMA_VERSION_STRING}"
"when required is ${MAGMA_FIND_VERSION}")
endif()
endif()
else()
# if the version found is older than the required then error
if( (MAGMA_FIND_VERSION_MAJOR STRGREATER MAGMA_VERSION_MAJOR) OR
(MAGMA_FIND_VERSION_MINOR STRGREATER MAGMA_VERSION_MINOR) )
if(NOT MAGMA_FIND_QUIETLY)
message(FATAL_ERROR
"MAGMA version found is ${MAGMA_VERSION_STRING}"
"when required is ${MAGMA_FIND_VERSION} or newer")
endif()
endif()
endif()
endif(PKG_CONFIG_EXECUTABLE)
if(NOT MAGMA_FOUND OR NOT MAGMA_LIBRARIES)
......
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