2008-10-20 18:43:11 +08:00
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
# Umfpack lib usually requires linking to a blas library.
|
|
|
|
# It is up to the user of this module to find a BLAS and link to it.
|
|
|
|
|
2008-10-20 18:43:11 +08:00
|
|
|
if (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
|
|
|
|
set(SUPERLU_FIND_QUIETLY TRUE)
|
|
|
|
endif (SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
|
|
|
|
|
2011-02-18 18:23:27 +08:00
|
|
|
find_path(SUPERLU_INCLUDES
|
|
|
|
NAMES
|
|
|
|
supermatrix.h
|
|
|
|
PATHS
|
|
|
|
$ENV{SUPERLUDIR}
|
|
|
|
${INCLUDE_INSTALL_DIR}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
superlu
|
2013-01-26 01:17:17 +08:00
|
|
|
SRC
|
2011-02-18 18:23:27 +08:00
|
|
|
)
|
2008-10-20 18:43:11 +08:00
|
|
|
|
2015-11-30 21:48:11 +08:00
|
|
|
find_library(SUPERLU_LIBRARIES NAMES "superlu_4.3" "superlu_4.2" "superlu_4.1" "superlu_4.0" "superlu_3.1" "superlu_3.0" "superlu" PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR} PATH_SUFFIXES lib)
|
|
|
|
|
|
|
|
if(SUPERLU_INCLUDES AND SUPERLU_LIBRARIES)
|
|
|
|
|
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
include(CMakePushCheckState)
|
|
|
|
cmake_push_check_state()
|
|
|
|
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SUPERLU_INCLUDES})
|
|
|
|
|
|
|
|
# check whether struct mem_usage_t is globally defined
|
|
|
|
check_cxx_source_compiles("
|
|
|
|
typedef int int_t;
|
|
|
|
#include <supermatrix.h>
|
|
|
|
#include <slu_util.h>
|
|
|
|
int main() {
|
|
|
|
mem_usage_t mem;
|
|
|
|
return 0;
|
|
|
|
}"
|
|
|
|
SUPERLU_HAS_GLOBAL_MEM_USAGE_T)
|
|
|
|
|
|
|
|
|
|
|
|
check_cxx_source_compiles("
|
|
|
|
typedef int int_t;
|
|
|
|
#include <supermatrix.h>
|
|
|
|
#include <superlu_enum_consts.h>
|
|
|
|
int main() {
|
|
|
|
return SLU_SINGLE;
|
|
|
|
}"
|
|
|
|
SUPERLU_HAS_CLEAN_ENUMS)
|
|
|
|
|
|
|
|
if(SUPERLU_HAS_CLEAN_ENUMS)
|
|
|
|
# at least 4.3
|
|
|
|
set(SUPERLU_VERSION_VAR "4.3")
|
|
|
|
elseif(SUPERLU_HAS_GLOBAL_MEM_USAGE_T)
|
|
|
|
# at least 4.3
|
|
|
|
set(SUPERLU_VERSION_VAR "4.0")
|
|
|
|
else()
|
|
|
|
set(SUPERLU_VERSION_VAR "3.0")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
cmake_pop_check_state()
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2008-10-20 18:43:11 +08:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2015-11-30 21:48:11 +08:00
|
|
|
find_package_handle_standard_args(SUPERLU
|
|
|
|
REQUIRED_VARS SUPERLU_INCLUDES SUPERLU_LIBRARIES
|
|
|
|
VERSION_VAR SUPERLU_VERSION_VAR)
|
2008-10-20 18:43:11 +08:00
|
|
|
|
|
|
|
mark_as_advanced(SUPERLU_INCLUDES SUPERLU_LIBRARIES)
|