-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.in
executable file
·63 lines (51 loc) · 2.16 KB
/
Makefile.in
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
# Get RBC3D root directory
WORK_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
# Package directories (shouldn't need to change these)
PETSC_DIR = $(WORK_DIR)/packages/petsc-3.21.3
PETSC_ARCH = $(PETSC_DIR)/arch-linux-c-opt
SPHEREPACK_DIR = $(WORK_DIR)/packages/spherepack3.2
LAPACK_DIR = $(WORK_DIR)/packages/lapack-3.11
# if netcdf-fortran is manually installed, uncomment line below and comment the other one
# NETCDF_DIR = $(WORK_DIR)/packages/NETCDF_INST
NETCDF_DIR = $(NETCDF_FORTRANROOT)
# if fftw is manually installed, use this instead
# FFTW_DIR = $(WORK_DIR)/packages/fftw-3.3.10/build
FFTW_DIR = $(FFTWROOT)
# Makedependf90 binary
MAKEDEPEND_BIN = $(WORK_DIR)/packages/makedepf90/makedepf90
vpath $(WORK_DIR)/common
# Includes
PETSC_INCLUDE = $(PETSC_DIR)/include
PETSC_ARCH_INCLUDE = $(PETSC_ARCH)/include
NETCDF_INCLUDE = $(NETCDF_DIR)/include
# If you installed FFTW in packages through install/install-phoenix.sh
# run: export FFTWROOT=`pwd`/packages/fftw-3.3.10/build from RBC3D root directory in terminal
# or make a variable in this file
FFTW_INCLUDE = $(FFTW_DIR)/include
COMMON_INCLUDE = -I$(WORK_DIR)/common
# you can remove -I$(FFTW_DIR) if you module loaded fftw
INCLUDE = $(COMMON_INCLUDE) -I$(PETSC_INCLUDE) -I$(PETSC_ARCH_INCLUDE) -I$(NETCDF_INCLUDE) -I$(FFTW_INCLUDE)
# Libraries
COMMON_LIB = $(WORK_DIR)/common/libcommon.a
SPHPK_LIB = -L$(SPHEREPACK_DIR)/lib -lspherepack
FFTW_LIB = -L$(FFTW_DIR)/lib -lfftw3
NETCDF_LIB = -L$(NETCDF_DIR)/lib -lnetcdff
PETSC_LIB = -Wl,-rpath,$(PETSC_ARCH)/lib -L$(PETSC_ARCH)/lib -lpetsc -lstdc++
MKL_LIB = -L$(MKL_ROOT)lib/intel64/ -lmkl_gf_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl
BLAS_LIB = -L$(BLAS_DIR) -lrefblas
LAPACK_LIB = -L$(LAPACK_DIR) -llapack -lrefblas
# Compiler and linker
FC = mpif90
# remove -fallow-argument-mismatch if during compilation you have a problem with it (due to old gnu compilers)
NICE = -fallow-argument-mismatch -freal-4-real-8
DEBUG =
OPTS = -O3
FFLAGS = $(NICE) $(DEBUG) $(OPTS) $(PROF) $(INCLUDE)
LDFLAGS = $(NICE) $(DEBUG) $(OPTS) $(PROF) -Wl,--copy-dt-needed-entries
%.o : %.F90
$(FC) $(FFLAGS) -c $<
%.o : %.F
$(FC) $(FFLAGS) -c $<
# Archiving
AR = ar ru
RANLIB = ranlib