-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathmumps.cmake
More file actions
65 lines (54 loc) · 1.73 KB
/
Copy pathmumps.cmake
File metadata and controls
65 lines (54 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# MUMPS -- use cmake -DMUMPS_ROOT= for hint.
#
# Intel MKL-compiled MUMPS requires at the linker for the main executable:
# mkl_scalapack_lp64 mkl_blacs_intelmpi_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core
#
# easily obtain MUMPS without compiling:
# CentOS 6/7 EPEL: yum install mumps-devel
# Ubuntu / Debian: apt install libmumps-dev
include(FetchContent)
# --- prereqs
include(${CMAKE_CURRENT_LIST_DIR}/lapack.cmake)
if(mpi)
include(${CMAKE_CURRENT_LIST_DIR}/scalapack.cmake)
endif()
# --- MUMPS
if(NOT mumps_external AND (MUMPS_ROOT OR (DEFINED ENV{MUMPS_ROOT}) OR (CMAKE_Fortran_COMPILER_ID STREQUAL GNU)))
set(_comp ${arith})
if(NOT mpi)
list(APPEND _comp mpiseq)
endif()
if(scotch)
list(APPEND _comp Scotch)
endif()
if(metis)
list(APPEND _comp METIS)
endif()
if(OpenMP_FOUND)
list(APPEND _comp OpenMP)
endif()
if(autobuild)
find_package(MUMPS COMPONENTS ${_comp})
else()
find_package(MUMPS COMPONENTS ${_comp} REQUIRED)
endif()
endif()
if(NOT MUMPS_FOUND)
set(mumps_external true CACHE BOOL "build Mumps")
# necessary since CMAKE_ARGS is broken in general
set(parallel ${mpi} CACHE BOOL "Mumps parallel == Gemini mpi")
set(MUMPS_BUILD_TESTING false CACHE BOOL "mumps disable tests")
FetchContent_Declare(MUMPS
GIT_REPOSITORY ${mumps_git}
GIT_TAG ${mumps_tag}
CMAKE_ARGS -Darith=${arith} -Dmetis:BOOL=${metis} -Dscotch:BOOL=${scotch} -Dopenmp:BOOL=false)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
FetchContent_MakeAvailable(MUMPS)
elseif(NOT mumps_POPULATED)
FetchContent_Populate(MUMPS)
add_subdirectory(${mumps_SOURCE_DIR} ${mumps_BINARY_DIR})
endif()
endif()
if(mpi)
target_link_libraries(MUMPS::MUMPS INTERFACE SCALAPACK::SCALAPACK LAPACK::LAPACK)
endif()