-
Notifications
You must be signed in to change notification settings - Fork 1
/
SWMMComponent.pro
347 lines (261 loc) · 9.3 KB
/
SWMMComponent.pro
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
#Author Caleb Amoa Buahin
#Email [email protected]
#Date 2016 - 2019
#License GNU Lesser General Public License (see <http: //www.gnu.org/licenses/> for details).
#EPA SWMM Model Component
TEMPLATE = lib
VERSION = 1.0.0
TARGET = SWMMComponent
QT -= gui
DEFINES += SWMMCOMPONENT_LIBRARY
DEFINES += USE_OPENMP
DEFINES += USE_MPI
SWMM_VERSION = 5.1.012
#DEFINES += QT_NO_VERSION_TAGGING
CONFIG += c++11
CONFIG += debug_and_release
CONFIG += optimize_full
contains(DEFINES,SWMMCOMPONENT_LIBRARY){
TEMPLATE = lib
message("Compiling as library")
} else {
TEMPLATE = app
CONFIG-=app_bundle
message("Compiling as application")
}
win32{
INCLUDEPATH += $$PWD/graphviz/win32/include \
$$(MSMPI_INC)/
}
PRECOMPILED_HEADER = ./include/stdafx.h
INCLUDEPATH += .\
./include \
./../SWMM/include \
./../SWMM/$$SWMM_VERSION/include \
./../HydroCouple/include \
./../HydroCoupleSDK/include
HEADERS += ./include/stdafx.h\
./include/swmmcomponent_global.h \
./include/swmmcomponent.h \
./include/swmmcomponentinfo.h \
./include/swmmobjectitems.h \
./include/swmmtimeseriesexchangeitems.h \
./include/pondedareainput.h \
./include/nodesurfaceflowoutput.h \
./include/nodewseinput.h \
./include/nodepondeddepthinput.h \
./include/conduitbankxsectareaoutput.h \
./include/linkoutput.h \
./include/linkinput.h
SOURCES +=./src/stdafx.cpp \
./src/swmmcomponent.cpp \
./src/swmmcomponentinfo.cpp \
./src/swmmtimeseriesexchangeitems.cpp \
./src/pondedareainput.cpp \
./src/nodesurfaceflowoutput.cpp \
./src/nodewseinput.cpp \
./src/nodepondeddepthinput.cpp \
./src/main.cpp \
./src/conduitbankxsectareaoutput.cpp \
./src/linkoutput.cpp \
./src/linkinput.cpp
macx{
INCLUDEPATH += /usr/local \
/usr/local/include \
/usr/local/include/gdal
LIBS += -L/usr/local/lib -lgdal \
-L/usr/local/lib -lnetcdf-cxx4
contains(DEFINES,USE_OPENMP){
QMAKE_CC = /usr/local/opt/llvm/bin/clang
QMAKE_CXX = /usr/local/opt/llvm/bin/clang++
QMAKE_LINK = /usr/local/opt/llvm/bin/clang++
QMAKE_CFLAGS+= -fopenmp
QMAKE_LFLAGS+= -fopenmp
QMAKE_CXXFLAGS+= -fopenmp
INCLUDEPATH += /usr/local/opt/llvm/lib/clang/5.0.0/include
LIBS += -L /usr/local/opt/llvm/lib -lomp
message("OpenMP enabled")
} else {
message("OpenMP disabled")
}
contains(DEFINES,USE_MPI){
QMAKE_CC = /usr/local/bin/mpicc
QMAKE_CXX = /usr/local/bin/mpicxx
QMAKE_LINK = /usr/local/bin/mpicxx
QMAKE_CFLAGS += $$system(/usr/local/bin/mpicc --showme:compile)
QMAKE_CXXFLAGS += $$system(/usr/local/bin/mpic++ --showme:compile)
QMAKE_LFLAGS += $$system(/usr/local/bin/mpic++ --showme:link)
LIBS += -L/usr/local/lib/ -lmpi
message("MPI enabled")
} else {
message("MPI disabled")
}
}
linux{
INCLUDEPATH += /usr/include \
../gdal/include
contains(DEFINES,UTAH_CHPC){
INCLUDEPATH += /uufs/chpc.utah.edu/sys/installdir/hdf5/1.8.17-c7/include \
/uufs/chpc.utah.edu/sys/installdir/netcdf-c/4.3.3.1/include \
/uufs/chpc.utah.edu/sys/installdir/netcdf-cxx/4.3.0-c7/include
LIBS += -L/uufs/chpc.utah.edu/sys/installdir/hdf5/1.8.17-c7/lib -l:libhdf5.so.10.2.0 \
-L/uufs/chpc.utah.edu/sys/installdir/netcdf-c/4.4.1/lib -l:libnetcdf.so.11.0.3 \
-L/uufs/chpc.utah.edu/sys/installdir/netcdf-cxx/4.3.0-c7/lib -l:libnetcdf_c++4.so.1.0.3
message("Compiling on CHPC")
}
contains(DEFINES,USE_OPENMP){
QMAKE_CFLAGS += -fopenmp
QMAKE_LFLAGS += -fopenmp
QMAKE_CXXFLAGS += -fopenmp
LIBS += -L/usr/lib/x86_64-linux-gnu -lgomp
message("OpenMP enabled")
} else {
message("OpenMP disabled")
}
contains(DEFINES,USE_MPI){
QMAKE_CC = mpicc
QMAKE_CXX = mpic++
QMAKE_LINK = mpic++
QMAKE_CFLAGS += $$system(/usr/local/bin/mpicc --showme:compile)
QMAKE_CXXFLAGS += $$system(/usr/local/bin/mpic++ --showme:compile)
QMAKE_LFLAGS += $$system(/usr/local/bin/mpic++ --showme:link)
LIBS += -L/usr/local/lib/ -lmpi
message("MPI enabled")
} else {
message("MPI disabled")
}
}
win32{
contains(DEFINES,USE_OPENMP){
QMAKE_CFLAGS += /openmp
QMAKE_CXXFLAGS += /openmp
message("OpenMP enabled")
} else {
message("OpenMP disabled")
}
#Windows vspkg package manager installation path
VCPKGDIR = C:/vcpkg/installed/x64-windows
INCLUDEPATH += $${VCPKGDIR}/include \
$${VCPKGDIR}/include/gdal
message ($$(VCPKGDIR))
CONFIG(debug, debug|release) {
LIBS += -L$${VCPKGDIR}/debug/lib -lgdald \
-L$${VCPKGDIR}/debug/lib -lnetcdf \
-L$${VCPKGDIR}/debug/lib -lnetcdf-cxx4
contains(DEFINES,USE_MPI){
LIBS += -L$${VCPKGDIR}/debug/lib -lmsmpi
message("MPI enabled")
} else {
message("MPI disabled")
}
} else {
LIBS += -L$${VCPKGDIR}/lib -lgdal \
-L$${VCPKGDIR}/lib -lnetcdf \
-L$${VCPKGDIR}/lib -lnetcdf-cxx4
contains(DEFINES,USE_MPI){
LIBS += -L$${VCPKGDIR}/lib -lmsmpi
message("MPI enabled")
} else {
message("MPI disabled")
}
}
QMAKE_CXXFLAGS += /MP
QMAKE_LFLAGS += /incremental /debug:fastlink
}
CONFIG(debug, debug|release) {
win32 {
QMAKE_CXXFLAGS += /MDd /O2
}
macx {
QMAKE_CXXFLAGS += -O1
}
linux {
QMAKE_CXXFLAGS += -O3
}
DESTDIR = ./build/debug
OBJECTS_DIR = $$DESTDIR/.obj
MOC_DIR = $$DESTDIR/.moc
RCC_DIR = $$DESTDIR/.qrc
UI_DIR = $$DESTDIR/.ui
macx{
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/build/debug/*HydroCoupleSDK.* ./build/debug/";
QMAKE_POST_LINK += "cp -a ./../SWMM/build/debug/*SWMM.* ./build/debug/";
LIBS += -L./../HydroCoupleSDK/build/debug -lHydroCoupleSDK.1.0.0
LIBS += -L./../SWMM/build/debug -lSWMM.$$SWMM_VERSION
}
linux{
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/build/debug/*HydroCoupleSDK.* ./build/debug/";
QMAKE_POST_LINK += "cp -a ./../SWMM/build/debug/*SWMM.* ./build/debug/";
LIBS += -L./../HydroCoupleSDK/build/debug -l:libHydroCoupleSDK.so.1.0.0
LIBS += -L./../SWMM/build/debug -l:libSWMM.so.$$SWMM_VERSION
}
win32{
QMAKE_POST_LINK += "copy /B .\..\HydroCoupleSDK\build\debug\HydroCoupleSDK* .\build\debug &&"
QMAKE_POST_LINK += "copy /B .\..\SWMM\build\debug\SWMM* .\build\debug"
LIBS += -L./../HydroCoupleSDK/build/debug -lHydroCoupleSDK1
LIBS += -L./../SWMM/build/debug -lSWMM5
}
}
CONFIG(release, debug|release) {
RELEASE_EXTRAS = ./build/release
OBJECTS_DIR = $$RELEASE_EXTRAS/.obj
MOC_DIR = $$RELEASE_EXTRAS/.moc
RCC_DIR = $$RELEASE_EXTRAS/.qrc
UI_DIR = $$RELEASE_EXTRAS/.ui
win32 {
QMAKE_CXXFLAGS += /MD
}
macx{
LIBS += -L./../HydroCoupleSDK/lib/macx -lHydroCoupleSDK.1.0.0
LIBS += -L./../SWMM/lib/macx -lSWMM.$$SWMM_VERSION
}
linux{
LIBS += -L./../HydroCoupleSDK/lib/linux -l:libHydroCoupleSDK.so.1.0.0
LIBS += -L./../SWMM/lib/linux -l:libSWMM.so.$$SWMM_VERSION
}
win32{
LIBS += -L./../HydroCoupleSDK/lib/win32 -lHydroCoupleSDK1
LIBS += -L./../SWMM/lib/win32 -lSWMM5
}
contains(DEFINES,SWMMCOMPONENT_LIBRARY){
#MacOS
macx{
DESTDIR = lib/macx
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/lib/macx/*HydroCoupleSDK* ./lib/macx/";
QMAKE_POST_LINK += "cp -a ./../SWMM/lib/macx/*SWMM* ./lib/macx/";
}
#Linux
linux{
DESTDIR = lib/linux
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/lib/linux/*HydroCoupleSDK* ./lib/linux/";
QMAKE_POST_LINK += "cp ./../SWMM/lib/linux/*SWMM* ./lib/linux/";
}
#Windows
win32{
DESTDIR = lib/win32
QMAKE_POST_LINK += "copy /B .\..\HydroCoupleSDK\lib\win32\HydroCoupleSDK* .\lib\win32 &&"
QMAKE_POST_LINK += "copy /B .\..\SWMM\lib\win32\SWMM* .\lib\win32"
}
} else {
#MacOS
macx{
DESTDIR = bin/macx
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/lib/macx/*HydroCoupleSDK* ./bin/macx/";
QMAKE_POST_LINK += "cp -a ./../SWMM/lib/macx/*SWMM* ./bin/macx/";
}
#Linux
linux{
DESTDIR = bin/linux
QMAKE_POST_LINK += "cp -a ./../HydroCoupleSDK/lib/linux/*HydroCoupleSDK* ./bin/linux/";
QMAKE_POST_LINK += "cp -a ./../SWMM/lib/linux/*SWMM* ./bin/linux/";
}
#Windows
win32{
DESTDIR = bin/win32
QMAKE_POST_LINK += "copy /B .\..\HydroCoupleSDK\lib\win32\HydroCoupleSDK* .\bin\win32 &&"
QMAKE_POST_LINK += "copy /B .\..\SWMM\lib\win32\SWMM* .\bin\win32"
}
}
}
RESOURCES += \
resources/swmmcomponent.qrc