Skip to content

Commit

Permalink
Merge pull request #266 from akva2/slu_stuff
Browse files Browse the repository at this point in the history
changed: add option to disable superlu
  • Loading branch information
atgeirr authored Aug 22, 2017
2 parents 15aba45 + e3ff47d commit 67a8d5b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cmake/Modules/FindSuperLU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
# SUPERLU_LIBRARIES Name to the SuperLU library.
#

if(NOT USE_SUPERLU)
return()
endif()

include(CheckIncludeFiles)
include(CMakePushCheckState)
include(CheckCSourceCompiles)
Expand Down Expand Up @@ -118,6 +122,19 @@ int main(void)
return 0;
}"
SUPERLU_POST_2005_VERSION)

# check whether version is at least 5.0
CHECK_C_SOURCE_COMPILES("
typedef int int_t;
#include <supermatrix.h>
#include <slu_util.h>
int main(void)
{
GlobalLU_t glu;
return 0;
}"
SUPERLU_MIN_VERSION_5)

cmake_pop_check_state()

if(SUPERLU_MIN_VERSION_4_3)
Expand All @@ -128,6 +145,17 @@ else()
"Human readable string containing SuperLU version information.")
endif()

if(SUPERLU_MIN_VERSION_5)
include(UseDuneVer)
find_dune_version("dune" "istl")
set(DUNE_ISTL_VERSION ${DUNE_ISTL_VERSION_MAJOR}.${DUNE_ISTL_VERSION_MINOR}.${DUNE_ISTL_VERSION_REVISION})
if(DUNE_ISTL_VERSION VERSION_LESS 2.5)
message(STATUS "SuperLU requested, but version found not compatible with dune-istl ${DUNE_ISTL_VERSION}")
set(SUPERLU_LIBRARY "")
set(SUPERLU_INCLUDE_DIR "")
endif()
endif()

# behave like a CMake module is supposed to behave
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/OpmLibMain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ find_openmp (${project})
include (UseThreads)
find_threads (${project})

# SuperLU is optional
option (USE_SUPERLU "Use SuperLU direct solvers" OFF)

# static code analysis
include(UseStaticAnalysis)
setup_static_analysis_tools()
Expand Down

0 comments on commit 67a8d5b

Please sign in to comment.