-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (48 loc) · 1.25 KB
/
Makefile
File metadata and controls
56 lines (48 loc) · 1.25 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
RM=rm
BUILD=build/
# Note, this preface is primarily aimed at figureing out which compiler to use if different environment variables aren't set
ifndef COMPILER
ifndef F90
ifdef FC
F90=${FC}
else
F90=gfortran # NOTE: if nothing is defined we default to gfortran
endif
$(info F90 undefined, changed to ${F90})
endif
ifeq (${F90},gfortran)
COMPILER=gnu
endif
ifeq (${F90},ifort)
COMPILER=intel
endif
endif
ifeq (${COMPILER}, gnu)
FFLAGS=-Ofast -fimplicit-none #-fopenmp # -O3
MODOUTPUT=-J $(BUILD)
ifeq (${MODE}, debug)
FFLAGS=-g -fcheck=all -fbacktrace -fimplicit-none
endif
ifeq (${MODE}, omp)
FFLAGS=-Ofast -fimplicit-none -fopenmp
LFLAGS=-lgomp
endif
endif
ifeq (${COMPILER}, intel)
FFLAGS=-O3 -xHost -u -qopenmp
LFLAGS=-qopenmp
MODOUTPUT=-module $(BUILD)
ifeq (${MODE}, debug)
FFLAGS=-debug -debug-parameters all -traceback -g -u -check all -check noarg_temp_created -CB
endif
endif
LDFLAGS=-L${NETCDF}/lib -lnetcdf -lnetcdff ${LFLAGS}
FCFLAGS=${FFLAGS} -c -I${NCAR_INC_NETCDF} ${MODOUTPUT}
all: lbm_basic
clean:
${RM} lbm_basic $(BUILD)*.o $(BUILD)*.mod
lbm_basic:$(BUILD)lbm_basic.o $(BUILD)io_routines.o
${F90} ${LDFLAGS} $^ -o $@
$(BUILD)lbm_basic.o: $(BUILD)io_routines.o
$(BUILD)%.o:%.f90
${F90} ${FCFLAGS} $< -o $@