-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-mpiifort-scorep
138 lines (108 loc) · 3.48 KB
/
Makefile-mpiifort-scorep
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
137
138
#*robodoc*b* CGPACK/Makefile-mpiifort-scorep
# NAME
# Makefile-mpiifort-scorep
# SYNOPSIS
#$Id: Makefile-mpiifort-scorep 382 2017-03-22 11:41:51Z mexas $
FC= scorep mpiifort
# PURPOSE
# Build/install CGPACK instrumented for profiling/tracing with TAU
# on the University of Bristol BlueCrystal
# computer with Intel Fortran compiler (mpiifort).
# AUTHOR
# Anton Shterenlikht
# COPYRIGHT
# See LICENSE
# NOTES
# This makefile is to build CGPACK for use with ParaFEM.
# According to Intel, when mixing MPI with coarrays, the
# easiest approach is to build the coarray library with
# "-coarray=single", and let the MPI parts of the program
# set up the MPI environment. See also:
# https://software.intel.com/en-us/forums/topic/559446
# SOURCE
FFLAGS= -c -qopt-report -assume realloc_lhs \
-O2 -debug full -g -traceback -free -warn \
-coarray=distributed -coarray-config-file=xx14.conf
#-std08 -warn stderrors -fast
CGPACK= cgpack
MYLIB= lib$(CGPACK).a
LIBDIR= $(HOME)/lib
MODDIR= $(HOME)/mod
# level 1
L1_SRC= cgca_m1co.f90
L1_MOD= $(L1_SRC:.f90=.mod)
L1_OBJ= $(L1_SRC:.f90=.o)
# level 2 modules and submodules
L2_SRC_MOD= cgca_m2alloc.f90 cgca_m2gb.f90 cgca_m2geom.f90 \
cgca_m2glm.f90 cgca_m2hx.f90 cgca_m2lnklst.f90 \
cgca_m2out.f90 cgca_m2pck.f90 \
cgca_m2phys.f90 cgca_m2red.f90 cgca_m2rnd.f90 \
cgca_m2rot.f90 cgca_m2stat.f90
L2_SRC_SUBMOD= m2out_sm2_mpi.f90 # m2out_sm1.f90 - only for Cray
L2_SRC= $(L2_SRC_MOD) $(L2_SRC_SUBMOD)
L2_OBJ= $(L2_SRC:.f90=.o)
L2_MOD= $(L2_SRC_MOD:.f90=.mod)
L2_SUBMOD= cgca_m2out@m2out_sm2_mpi.smod
# cgca_m2out@m2out_sm1.smod - only for Cray
# level 3 modules and submodules
L3_SRC_MOD= cgca_m3clvg.f90 cgca_m3gbf.f90 cgca_m3nucl.f90 \
cgca_m3pfem.f90 cgca_m3sld.f90
L3_SRC_SUBMOD= m3clvg_sm1.f90 m3clvg_sm2.f90 m3sld_sm1.f90
# don't build m3clvg_sm3.f90 with ifort 16.0.0 - uses collectives
# don't build m3pfem_sm1.f90 with ifort 16.0.0 - uses collectives
L3_SRC= $(L3_SRC_MOD) $(L3_SRC_SUBMOD)
L3_OBJ= $(L3_SRC:.f90=.o)
L3_MOD= $(L3_SRC_MOD:.f90=.mod)
L3_SUBMOD= cgca_m3clvg@m3clvg_sm1.smod \
cgca_m3clvg@m3clvg_sm2.smod \
cgca_m3sld@m3sld_sm1.smod
# level 4
L4_SRC= cgca_m4fr.f90
L4_MOD= $(L4_SRC:.f90=.mod)
L4_OBJ= $(L4_SRC:.f90=.o)
# top level
LTOP_SRC= cgca.f90
LTOP_MOD= $(LTOP_SRC:.f90=.mod)
LTOP_OBJ= $(LTOP_SRC:.f90=.o)
ALL_MOD= $(L1_MOD) $(L2_MOD) $(L3_MOD) $(L4_MOD) $(LTOP_MOD)
ALL_SUBMOD= $(L2_SUBMOD) $(L3_SUBMOD)
ALL_OBJ= $(L1_OBJ) $(L2_OBJ) $(L3_OBJ) $(L4_OBJ) $(LTOP_OBJ)
ALL_CLEAN= *.mod *.smod *.o *.optrpt $(MYLIB)
.SUFFIXES:
.SUFFIXES: .f90 .mod .o
all: $(MYLIB)
.f90.mod:
$(FC) $(FFLAGS) $<
.f90.o:
$(FC) $(FFLAGS) $<
# module dependencies
$(L2_MOD) $(L2_OBJ): $(L1_MOD)
$(L3_MOD) $(L3_OBJ): $(L2_MOD) $(L2_SUBMOD)
$(L4_MOD) $(L4_OBJ): $(L3_MOD) $(L3_SUBMOD)
$(LTOP_MOD) $(LTOP_OBJ): $(L4_MOD)
$(MYLIB): $(MOD_LTOP) $(OBJ_LTOP)
# Submodule dependencies
# level 2
m2out_sm1.o m2out_sm2_mpi.o: cgca_m2out.mod cgca_m2out.o
# level 3
m3clvg_sm1.o m3clvg_sm2.o: cgca_m3clvg.mod cgca_m3clvg.o
m3sld_sm1.o: cgca_m3sld.mod cgca_m3sld.o
$(MYLIB): $(ALL_OBJ)
@if [ -e $(MYLIB) ]; then \
rm $(MYLIB); \
fi
ar -r $(MYLIB) $(ALL_OBJ)
install: $(MYLIB) $(ALL_MOD) $(ALL_SUBMOD)
@if [ -e $(LIBDIR)/$(MYLIB) ]; then \
echo $(LIBDIR)/$(MYLIB) already exists; \
echo run \"make deinstall\" first; \
exit 1; \
fi
cp $(MYLIB) $(LIBDIR)
cp $(ALL_MOD) $(ALL_SUBMOD) $(MODDIR)
deinstall:
cd $(LIBDIR) && rm $(MYLIB)
cd $(MODDIR) && rm $(ALL_MOD) $(ALL_SUBMOD)
clean:
rm $(ALL_CLEAN)
#*roboend*