-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathmumps.cmake
More file actions
62 lines (51 loc) · 1.54 KB
/
Copy pathmumps.cmake
File metadata and controls
62 lines (51 loc) · 1.54 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
# 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
unset(_mumps_extra)
# BLACS
if(BLACS_ROOT)
find_package(BLACS REQUIRED)
list(APPEND _mumps_extra ${BLACS_LIBRARIES})
endif()
# Metis
if(METIS_ROOT)
find_package(METIS REQUIRED)
list(APPEND _mumps_extra ${METIS_LIBRARIES})
endif()
# Scotch
if(Scotch_ROOT)
find_package(Scotch REQUIRED COMPONENTS ESMUMPS)
list(APPEND _mumps_extra ${Scotch_LIBRARIES})
endif()
# SCALAPACK always needed for MUMPS
if(DEFINED ENV{MKLROOT})
find_package(SCALAPACK REQUIRED COMPONENTS MKL)
else()
find_package(SCALAPACK REQUIRED COMPONENTS OpenMPI)
endif()
if(DEFINED ENV{MKLROOT})
find_package(LAPACK REQUIRED COMPONENTS MKL)
else()
find_package(LAPACK REQUIRED)
endif()
# Mumps
if(realbits EQUAL 64)
set(mumpscomp d)
elseif(realbits EQUAL 32)
set(mumpscomp s)
else()
message(FATAL_ERROR "MUMPS has only real32, real64")
endif()
find_package(MUMPS REQUIRED COMPONENTS ${mumpscomp})
# rather than appending this libraries everywhere, just put them together here.
list(APPEND MUMPS_LIBRARIES ${SCALAPACK_LIBRARIES})
list(APPEND MUMPS_INCLUDE_DIRS ${SCALAPACK_INCLUDE_DIRS})
list(APPEND MUMPS_LIBRARIES ${_mumps_extra})
if(MUMPS_ROOT) # not a system library, need lapack
list(APPEND MUMPS_LIBRARIES ${LAPACK_LIBRARIES})
endif()