This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
110 lines (87 loc) · 2.41 KB
/
Makefile
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
#=======================================================================
# Makefile for Imcompact3D
#=======================================================================
# Choose pre-processing options
# -DSHM - enable shared-memory implementation
# -DDOUBLE_PREC - use double-precision
OPTIONS =
# Choose an FFT engine, available options are:
# fftw3 - FFTW version 3.x
# generic - A general FFT algorithm (no 3rd-party library needed)
FFT= generic
# Paths to FFTW 3
FFTW3_PATH= # full path of FFTW installation if using fftw3 engine above
FFTW3_INCLUDE = -I$(FFTW3_PATH)/include
FFTW3_LIB = -L$(FFTW3_PATH)/lib -lfftw3 -lfftw3f
# Specify Fortran and C compiler names and flags here
# Normally, use MPI wrappers rather than compilers themselves
# Supply a Fortran pre-processing flag together with optimisation level flags
# Some examples are given below:
#FC =
#OPTFC =
#CC =
#CFLAGS =
# PGI
#FC = ftn
#OPTFC = -fast -O3 -Mpreprocess
#CC = cc
#CFLAGS = -O3
# PathScale
#FC = ftn
#OPTFC = -Ofast -cpp
#CC = cc
#CFLAGS = -O3
# GNU
FC = mpif90
OPTFC = -O3 -funroll-loops -ftree-vectorize -fcray-pointer -cpp
CC = mpicc
CFLAGS = -O3
# Intel
FC = mpiifort
OPTFC = -cpp -O3 -xHost -ipo -static
CC = mpiicc
CFLAGS = -cpp -O3 -xHost -ipo -static
# Cray
#FC = ftn
#OPTFC = -e Fm
#CC = cc
#CFLAGS =
#-----------------------------------------------------------------------
# Normally no need to change anything below
# include PATH
ifeq ($(FFT),generic)
INC=
else ifeq ($(FFT),fftw3)
INC=$(FFTW3_INCLUDE)
endif
# library path
ifeq ($(FFT),generic)
LIBFFT=
else ifeq ($(FFT),fftw3)
LIBFFT=$(FFTW3_LIB)
endif
# List of source files
SRC = decomp_2d.f90 glassman.f90 fft_$(FFT).f90 module_param.f90 io.f90 variables.f90 poisson.f90 schemes.f90 convdiff.f90 incompact3d.f90 navier.f90 derive.f90 parameters.f90 tools.f90 visu.f90
#-----------------------------------------------------------------------
# Normally no need to change anything below
ifneq (,$(findstring DSHM,$(OPTIONS)))
SRC := FreeIPC.f90 $(SRC)
OBJ = $(SRC:.f90=.o) alloc_shm.o FreeIPC_c.o
else
OBJ = $(SRC:.f90=.o)
endif
all: incompact3d
alloc_shm.o: alloc_shm.c
$(CC) $(CFLAGS) -c $<
FreeIPC_c.o: FreeIPC_c.c
$(CC) $(CFLAGS) -c $<
incompact3d : $(OBJ)
$(FC) -O3 -o $@ $(OBJ) $(LIBFFT)
%.o : %.f90
$(FC) $(OPTFC) $(OPTIONS) $(INC) -c $<
.PHONY: clean
clean:
rm -f *.o *.mod incompact3d
.PHONY: realclean
realclean: clean
rm -f *~ \#*\#