-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
151 lines (114 loc) · 5.6 KB
/
Makefile
File metadata and controls
151 lines (114 loc) · 5.6 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
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
139
140
141
142
143
144
145
146
147
148
149
150
# for C++
CXX=g++
CXXFLAGS = -pthread -g -fPIC
# for Fortran
F90=ifort
F90COPTS = -r8 -assume no2underscore -fPIC $(shell eval-pkg-config --cflags ual-ifort) -shared-intel
F90LIBS = $(shell eval-pkg-config --libs ual-ifort) -lm
F90INCLUDES = $(shell eval-pkg-config --cflags ual-ifort)
F90ETSINCLUDES = $(shell eval-pkg-config --libs itmtypes-ifort)
# all files
ifeq ($(ITM_ENVIRONMENT_LOADED), yes)
CXXFLAGS += $(shell eval-pkg-config --cflags ual-cpp-gnu hdf5-cpp-gnu itmconstants)
CXXFLAGS +=-DITM_CONSTANTS
CXXFLAGS += -I$(ITM_XMLLIB_DIR)/$(ITM_XMLLIB_VERSION)/$(DATAVERSION)/include/
LDFLAGS = $(shell eval-pkg-config --libs ual-cpp-gnu hdf5-cpp-gnu xmllib-$(ITM_INTEL_OBJECTCODE))
CXXFLAGS += $(shell eval-pkg-config --cflags xmllib-$(ITM_INTEL_OBJECTCODE)) -lTreeShr -lTdiShr -lXTreeShr
#CXXFLAGS += -Wl,-rpath=/gw/switm/hdf5/1.8.17/gcc-6.1/lib -L/gw/switm/hdf5/1.8.17/lib -I/gw/switm/hdf5/1.8.17/include -lhdf5 -lhdf5_cpp
all: libRunafluid.a libEfieldEdit.a
# google test
test: runafluid.o distinit.o cpo_utils.o codeparams.o critical_field.o control.o dreicer.o hdf5export.o avalanche.o test/test_phys.o test/test_cpo.o
$(CXX) $(LDFLAGS) -L$(GTEST)/ -lgtest_main $^ -lgtest -o test.bin
test/test.o: test/test.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
test/test_cpo.o: test/test_cpo.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
# test developing files
d: libRunafluid.a libEfieldEdit.a test/libTeEdit.a test/libNeEdit.a test/libqeexpdecay.a
dev: libRunafluid.a libEfieldEdit.a test/libTeEdit.a test/libNeEdit.a test/libqeexpdecay.a
devonly: test/libTeEdit.a test/libNeEdit.a test/libqeexpdecay.a
fortran: test/libNewDistSlice.a
$(info *** Compiler set to ITM *** )
else ifeq ($(IMAS_ENVIRONMENT_LOADED), yes)
CXXFLAGS += $(shell pkg-config --cflags imas-cpp blitz imas-constants-cpp)
LDFLAGS = $(shell pkg-config --libs imas-cpp blitz)
all: libRunafluid_imas.a
# google test
test: runafluid_imas.o distinit_imas.o ids_utils.o critical_field.o control.o dreicer.o avalanche.o test/test_phys.o test/create_hdf5.o
$(CXX) $(LDFLAGS) -L$(GTEST)/ -lgtest_main $^ -lgtest -o test.bin
test/test_imas.o: test/test.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
test/test_ids.o: test/test_ids.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
# test developing files
d: libRunafluid_imas.a libEfieldEdit_imas.a test/libTeEdit_imas.a test/libNeEdit_imas.a
dev: libRunafluid_imas.a libEfieldEdit_imas.a test/libTeEdit_imas.a test/libNeEdit_imas.a
$(info *** Compiler set to IMAS *** )
else
CXXFLAGS += $(shell pkg-config --cflags imas-cpp blitz)
LDFLAGS = $(shell pkg-config --libs imas-cpp blitz)
all: libRunafluid_imas.a
# google test
test: runafluid_imas.o distinit_imas.o ids_utils.o critical_field.o control.o dreicer.o avalanche.o test/test_phys.o test/test_ids.o
$(CXX) $(LDFLAGS) -L$(GTEST)/ -lgtest_main $^ -lgtest -o test.bin
test/test_imas.o: test/test.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
test/test_ids.o: test/test_ids.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
# test developing files
d: libRunafluid_imas.a libEfieldEdit_imas.a test/libTeEdit_imas.a test/libNeEdit_imas.a
dev: libRunafluid_imas.a libEfieldEdit_imas.a test/libTeEdit_imas.a test/libNeEdit_imas.a
$(info *** Compiler set to IMAS (no imasconstants) *** )
endif
# Runafluid actor
libRunafluid.a: runafluid.o distinit.o cpo_utils.o codeparams.o hdf5export.o critical_field.o control.o dreicer.o avalanche.o
ar -rvs $@ $^
libRunafluid_imas.a: runafluid_imas.o distinit_imas.o ids_utils.o critical_field.o control.o dreicer.o avalanche.o
ar -rvs $@ $^
libEfieldEdit.a: efieldedit.o cpo_utils.o critical_field.o
ar -rvs $@ $^
libEfieldEdit_imas.a: efieldedit_imas.o ids_utils.o critical_field.o
ar -rvs $@ $^
#google test phys
test/test_phys.o: test/test_phys.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
test/test_cpo.o: test/test_cpo.cpp
$(CXX) -include UALClasses.h $(CXXFLAGS) -I$(GTEST)/include/ -c -o $@ $^
# test C++ files
test/libTeEdit.a: test/te_edit.o cpo_utils.o
ar -rvs $@ $^
test/libNeEdit.a: test/ne_edit.o cpo_utils.o
ar -rvs $@ $^
test/libqeimpEdit.a: test/qe_imp_edit.o cpo_utils.o
ar -rvs $@ $^
test/libqeexpdecay.a: test/qe_expdecay.o cpo_utils.o
ar -rvs $@ $^
test/libteexpdecay.a: test/te_expdecay.o cpo_utils.o
ar -rvs $@ $^
# test C++ files for IMAS
test/libTeEdit_imas.a: test/te_edit_imas.o ids_utils.o
ar -rvs $@ $^
test/libNeEdit_imas.a: test/ne_edit_imas.o ids_utils.o
ar -rvs $@ $^
test/libqeimpEdit_imas.a: test/qe_imp_edit_imas.o ids_utils.o
ar -rvs $@ $^
test/libqeexpdecay_imas.a: test/qe_expdecay_imas.o ids_utils.o
ar -rvs $@ $^
test/libteexpdecay_imas.a: test/te_expdecay_imas.o ids_utils.o
ar -rvs $@ $^
# compile C++ files
.o: .cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^
# new distribution CPO array (Fortran)
test/libnewdist.a: test/newdist.o
ar -rvs $@ $^
test/newdist.o: test/newdist.f90
$(F90) $(F90COPTS) -c -o $@ $^ ${F90INCLUDES} $(F90LIBS)
# new distribution CPO slice (Fortran)
test/libNewDistSlice.a: test/newdist_slice.o
ar -rvs $@ $^
test/newdist_slice.o: test/newdist_slice.f90
$(F90) $(F90COPTS) -c -o $@ $^ ${F90INCLUDES} $(F90LIBS)
# delete old files
clean:
rm *.a *.o test/*.a test/*.o #test/*.bin