forked from NLAFET/preAlps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.lib.inc
136 lines (110 loc) · 4.53 KB
/
make.lib.inc
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# Provide the path for the libraires
#
MKL_ROOT=/opt/ohpc/pub/intel/compilers_and_libraries_2020.2.254/linux/mkl
METIS_ROOT=/opt/ohpc/pub/libs/intel/metis/5.1.0
MPI_ROOT=/opt/ohpc/pub/mpi/openmpi3-intel/3.1.4
#
# REQUIRED : Provide the compiler directives for the libraries
#
# Provide the compiler directives for MPI
MPI_LIB = $(MPI_ROOT)/lib
MPI_INC = $(MPI_ROOT)/include
INCLUDE_FLAGS += $(addprefix -I,$(MPI_INC))
LD_FLAGS += -L$(MPI_LIB) -lmpi
ADDITIONAL_LD_FLAGS += -lmpi
# Provide the compiler directives for METIS
METIS_DIR = ${METIS_ROOT}
METIS_INC = $(METIS_DIR)/include
METIS_LIB = $(METIS_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(METIS_INC))
LD_FLAGS += -L$(METIS_LIB) -lmetis
ADDITIONAL_FLAGS +=
ADDITIONAL_LD_FLAGS += -lmetis
#
# OPTIONAL :
# To use one of the following library, set the variable USE_* to 1
#
# Provide the compiler directives for MKL
USE_MKL=1
ifeq ($(USE_MKL), 1)
MKL_DIR = ${MKL_ROOT}
MKL_INC = $(MKL_DIR)/include
MKL_LIB = $(MKL_DIR)/lib/intel64
INCLUDE_FLAGS += $(addprefix -I,$(MKL_INC))
LD_FLAGS += -L$(MKL_LIB) -Wl,-rpath,$(MKL_LIB) -lmkl_core -lmkl_sequential -lmkl_intel_lp64 -lpthread -ldl
# LD_FLAGS += -L$(MKL_DIR)/lib/intel64 -Wl,-rpath,$(MKL_ROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lgomp -lm -ldl -lpthread -DMKL_LP64
# LD_FLAGS += -Wl,--no-as-needed -L$(MKL_DIR)/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -lgomp -lm -ldl -lpthread -DMKL_LP64
ADDITIONAL_FLAGS += -DMKLACTIVATE -DUSE_MKL
ADDITIONAL_LD_FLAGS +=
endif
# Provide the compiler directives for ParMetis
USE_PARMETIS=0
ifeq ($(USE_PARMETIS), 1)
PARMETIS_DIR = ${PARMETIS_ROOT}
PARMETIS_INC = $(PARMETIS_DIR)/include
PARMETIS_LIB = $(PARMETIS_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(PARMETIS_INC))
LD_FLAGS += -L$(PARMETIS_LIB) -Wl,-rpath,$(PARMETIS_DIR)/lib -lparmetis -lmetis
ADDITIONAL_FLAGS += -DUSE_PARMETIS
endif
# Provide the compiler directives for PARPACK
USE_PARPACK=0
ifeq ($(USE_PARPACK), 1)
PARPACK_DIR = ${PARPACK_ROOT}
PARPACK_LIB = $(PARPACK_DIR)
INCLUDE_FLAGS +=
LD_FLAGS += -L$(PARPACK_LIB) -lparpack -larpack
ADDITIONAL_FLAGS += -DUSE_PARPACK
endif
# Provide the compiler directives for MUMPS
USE_SOLVER_MUMPS=0
ifeq ($(USE_SOLVER_MUMPS), 1)
MUMPS_DIR = $(MUMPS_ROOT)
MUMPS_INC = $(MUMPS_DIR)/include
MUMPS_LIB = $(MUMPS_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(MUMPS_INC))
LD_FLAGS += -L$(MUMPS_LIB) -Wl,-rpath,$(MUMPS_DIR)/lib -ldmumps -lmumps_common -lpord -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64
ADDITIONAL_FLAGS += -DUSE_SOLVER_MUMPS
endif
# Provide the compiler directives for PARDISO
USE_SOLVER_PARDISO=0
ifeq ($(USE_SOLVER_PARDISO), 1)
# Pardiso will be used (not the one from Intel)
PARDISO_DIR = $(HOME_DIR)
PARDISO_LIB = $(PARDISO_DIR)/lib
INCLUDE_FLAGS +=
LD_FLAGS += -L$(PARDISO_LIB) -Wl,-rpath,$(PARDISO_DIR)/lib -lpardiso500-MACOS-X86-64
ADDITIONAL_FLAGS += -DUSE_PARDISO -DUSE_SOLVER_PARDISO
#-DPARDISO_SCHUR_COMPLEMENT_PATCH
endif
# Provide the compiler directives for LAPACK
USE_LAPACK=0
ifeq ($(USE_LAPACK), 1)
LAPACK_DIR = $(LAPACK_ROOT)
LAPACK_INC = $(LAPACK_DIR)/LAPACKE/include
LAPACK_LIB = $(LAPACK_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(LAPACK_INC))
LIB_DIRECTIVES += -DLAPACK
LD_FLAGS += -L$(LAPACK_LIB) -llapacke -llapack -lrefblas -lgfortran -lm
endif
# Provide the compiler directives for SUITESPARSE
USE_SUITESPARSE=0
ifeq ($(USE_SUITESPARSE), 1)
SUITESPARSE_DIR = ${SUITESPARSE_ROOT}
SUITESPARSE_INC = $(SUITESPARSE_DIR)/include
SUITESPARSE_LIB = $(SUITESPARSE_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(SUITESPARSE_INC))
LD_FLAGS += -L$(SUITESPARSE_LIB) -lspqr -lcholmod -lcolamd -lcamd -lsuitesparseconfig -lamd -lccolamd -lmetis
endif
# Provide the compiler directives for PETSC
USE_PETSC=0
ifeq ($(USE_PETSC), 1)
PETSC_DIR = ${PETSC_ROOT}
PETSC_INC = $(PETSC_DIR)/include
PETSC_LIB = $(PETSC_DIR)/lib
INCLUDE_FLAGS += $(addprefix -I,$(PETSC_INC))
LD_FLAGS += -L$(PETSC_LIB) -L$(PETSC_DIR)/${PETSC_ARCH}/lib -lpetsc
ADDITIONAL_FLAGS += -DPETSC
ADDITIONAL_LD_FLAGS +=
endif