forked from pradas/PhysiBoSSa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
338 lines (264 loc) · 13.5 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
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
VERSION := $(shell grep . VERSION.txt | cut -f1 -d:)
PROGRAM_NAME := project
CC := g++
# CC := g++-mp-7 # typical macports compiler name
# CC := g++-7 # typical homebrew compiler name
# Check for environment definitions of compiler
# e.g., on CC = g++-7 on OSX
ifdef PHYSICELL_CPP
CC := $(PHYSICELL_CPP)
endif
ARCH := native # best auto-tuning
# ARCH := core2 # a reasonably safe default for most CPUs since 2007
# ARCH := corei7
# ARCH := corei7-avx # earlier i7
# ARCH := core-avx-i # i7 ivy bridge or newer
# ARCH := core-avx2 # i7 with Haswell or newer
# ARCH := nehalem
# ARCH := westmere
# ARCH := sandybridge # circa 2011
# ARCH := ivybridge # circa 2012
# ARCH := haswell # circa 2013
# ARCH := broadwell # circa 2014
# ARCH := skylake # circa 2015
# ARCH := bonnell
# ARCH := silvermont
# ARCH := skylake-avx512
# ARCH := nocona #64-bit pentium 4 or later
# CFLAGS := -march=$(ARCH) -Ofast -s -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11
CFLAGS := -march=$(ARCH) -O3 -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11
COMPILE_COMMAND := $(CC) $(CFLAGS)
BioFVM_OBJECTS := BioFVM_vector.o BioFVM_mesh.o BioFVM_microenvironment.o BioFVM_solvers.o BioFVM_matlab.o \
BioFVM_utilities.o BioFVM_basic_agent.o BioFVM_MultiCellDS.o BioFVM_agent_container.o
PhysiCell_core_OBJECTS := PhysiCell_phenotype.o PhysiCell_cell_container.o PhysiCell_standard_models.o \
PhysiCell_cell.o PhysiCell_custom.o PhysiCell_utilities.o PhysiCell_constants.o
PhysiCell_module_OBJECTS := PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o \
PhysiCell_pugixml.o PhysiCell_settings.o
# put your custom objects here (they should be in the custom_modules directory)
PhysiCell_custom_module_OBJECTS := .o
pugixml_OBJECTS := pugixml.o
PhysiCell_OBJECTS := $(BioFVM_OBJECTS) $(pugixml_OBJECTS) $(PhysiCell_core_OBJECTS) $(PhysiCell_module_OBJECTS)
ALL_OBJECTS := $(PhysiCell_OBJECTS) $(PhysiCell_custom_module_OBJECTS)
EXAMPLES := ./examples/PhysiCell_test_mechanics_1.cpp ./examples/PhysiCell_test_mechanics_2.cpp \
./examples/PhysiCell_test_DCIS.cpp ./examples/PhysiCell_test_HDS.cpp \
./examples/PhysiCell_test_cell_cycle.cpp ./examples/PhysiCell_test_volume.cpp
all:
make heterogeneity-sample
make
# sample projects
list-projects:
@echo "Sample projects: template2D template3D biorobots-sample cancer-biorobots-sample heterogeneity-sample"
@echo " cancer-immune-sample virus-macrophage-sample template spheroid-TNF-v2 drug-AGS template_BM"
template2D:
cp ./sample_projects/template2D/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/template2D/main-2D.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/template2D/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/template2D/config/* ./config/
template3D:
cp ./sample_projects/template3D/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/template3D/main-3D.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/template3D/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/template3D/config/* ./config/
template:
cp ./sample_projects/template/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/template/main.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/template/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/template/config/* ./config/
# sample projects
biorobots-sample:
cp ./sample_projects/biorobots/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/biorobots/main-biorobots.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/biorobots/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/biorobots/config/* ./config/
cancer-biorobots-sample:
cp ./sample_projects/cancer_biorobots/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/cancer_biorobots/main-cancer_biorobots.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/cancer_biorobots/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/cancer_biorobots/config/* ./config/
heterogeneity-sample:
cp ./sample_projects/heterogeneity/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/heterogeneity/main-heterogeneity.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/heterogeneity/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/heterogeneity/config/* ./config/
cancer-immune-sample:
cp ./sample_projects/cancer_immune/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/cancer_immune/main-cancer_immune_3D.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/cancer_immune/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/cancer_immune/config/* ./config/
virus-macrophage-sample:
cp ./sample_projects/virus_macrophage/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/virus_macrophage/main-virus_macrophage.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/virus_macrophage/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/virus_macrophage/config/* ./config/
beta-testing:
cp ./sample_projects/beta_testing/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/beta_testing/main-beta.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/beta_testing/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp ./sample_projects/beta_testing/config/* ./config/
spheroid-TNF-v2:
cp ./sample_projects/spheroid_TNF_v2/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/spheroid_TNF_v2/main-spheroid_TNF.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/spheroid_TNF_v2/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/spheroid_TNF_v2/config/* ./config/
mkdir ./scripts/
cp ./sample_projects/spheroid_TNF_v2/scripts/* ./scripts/
drug-AGS:
cp ./sample_projects/drug_AGS/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/drug_AGS/main-drug_AGS.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/drug_AGS/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/drug_AGS/config/* ./config/
mkdir ./scripts/
cp ./sample_projects/drug_AGS/scripts/* ./scripts/
template_BM:
cp ./sample_projects/template_BM/custom_modules/* ./custom_modules/
touch main.cpp && cp main.cpp main-backup.cpp
cp ./sample_projects/template_BM/main-template_BM.cpp ./main.cpp
cp Makefile Makefile-backup
cp ./sample_projects/template_BM/Makefile .
cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml
cp -r ./sample_projects/template_BM/config/* ./config/
mkdir ./scripts/
cp ./sample_projects/template_BM/scripts/* ./scripts/
# early examples for convergence testing
physicell_test_mech1: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp
$(COMPILE_COMMAND) -o test_mech1 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp
physicell_test_mech2: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp
$(COMPILE_COMMAND) -o test_mech2 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp
physicell_test_DCIS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp
$(COMPILE_COMMAND) -o test_DCIS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp
physicell_test_HDS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp
$(COMPILE_COMMAND) -o test_HDS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp
physicell_test_cell_cycle: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp
$(COMPILE_COMMAND) -o test_cycle $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp
PhysiCell_test_volume: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp
$(COMPILE_COMMAND) -o test_volume $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp
examples: $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_mech1 ./examples/PhysiCell_test_mechanics_1.cpp $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_mech2 ./examples/PhysiCell_test_mechanics_2.cpp $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_DCIS ./examples/PhysiCell_test_DCIS.cpp $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_HDS ./examples/PhysiCell_test_HDS.cpp $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_cycle ./examples/PhysiCell_test_cell_cycle.cpp $(PhysiCell_OBJECTS)
$(COMPILE_COMMAND) -o ./examples/test_volume ./examples/PhysiCell_test_volume.cpp $(PhysiCell_OBJECTS)
# PhysiCell core components
PhysiCell_phenotype.o: ./core/PhysiCell_phenotype.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_phenotype.cpp
PhysiCell_digital_cell_line.o: ./core/PhysiCell_digital_cell_line.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_digital_cell_line.cpp
PhysiCell_cell.o: ./core/PhysiCell_cell.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_cell.cpp
PhysiCell_cell_container.o: ./core/PhysiCell_cell_container.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_cell_container.cpp
PhysiCell_standard_models.o: ./core/PhysiCell_standard_models.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_standard_models.cpp
PhysiCell_utilities.o: ./core/PhysiCell_utilities.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_utilities.cpp
PhysiCell_custom.o: ./core/PhysiCell_custom.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_custom.cpp
PhysiCell_constants.o: ./core/PhysiCell_constants.cpp
$(COMPILE_COMMAND) -c ./core/PhysiCell_constants.cpp
# BioFVM core components (needed by PhysiCell)
BioFVM_vector.o: ./BioFVM/BioFVM_vector.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_vector.cpp
BioFVM_agent_container.o: ./BioFVM/BioFVM_agent_container.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_agent_container.cpp
BioFVM_mesh.o: ./BioFVM/BioFVM_mesh.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_mesh.cpp
BioFVM_microenvironment.o: ./BioFVM/BioFVM_microenvironment.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_microenvironment.cpp
BioFVM_solvers.o: ./BioFVM/BioFVM_solvers.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_solvers.cpp
BioFVM_utilities.o: ./BioFVM/BioFVM_utilities.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_utilities.cpp
BioFVM_basic_agent.o: ./BioFFilenames will look like output00000000_cells_physicell.mM_basic_agent.cpp
$(COMPILE_COMMAND) -c ./Filenames will look like output00000000_cells_physicell.mioFVM_basic_agent.cpp
BioFVM_matlab.o: ./BioFVM/BiFilenames will look like output00000000_cells_physicell.mlab.cpp
$(COMPILE_COMMAND) -c ./Filenames will look like output00000000_cells_physicell.mioFVM_matlab.cpp
BioFVM_MultiCellDS.o: ./BioFFilenames will look like output00000000_cells_physicell.mM_MultiCellDS.cpp
$(COMPILE_COMMAND) -c ./Filenames will look like output00000000_cells_physicell.mioFVM_MultiCellDS.cpp
pugixml.o: ./BioFVM/pugixml.Filenames will look like output00000000_cells_physicell.m
$(COMPILE_COMMAND) -c ./Filenames will look like output00000000_cells_physicell.mugixml.cpp
# standard PhysiCell modulesFilenames will look like output00000000_cells_physicell.m
PhysiCell_SVG.o: ./modules/PhysiCell_SVG.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_SVG.cpp
PhysiCell_pathology.o: ./modules/PhysiCell_pathology.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_pathology.cpp
PhysiCell_MultiCellDS.o: ./modules/PhysiCell_MultiCellDS.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_MultiCellDS.cpp
PhysiCell_various_outputs.o: ./modules/PhysiCell_various_outputs.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_various_outputs.cpp
PhysiCell_pugixml.o: ./modules/PhysiCell_pugixml.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_pugixml.cpp
PhysiCell_settings.o: ./modules/PhysiCell_settings.cpp
$(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp
# user-defined PhysiCell modules
# cleanup
reset:
rm -f *.cpp
cp ./sample_projects/Makefile-default Makefile
rm -f ./custom_modules/*
touch ./custom_modules/empty.txt
touch ALL_CITATIONS.txt
rm ALL_CITATIONS.txt
cp ./config/PhysiCell_settings-backup.xml ./config/PhysiCell_settings.xml
clean:
rm -f *.o
rm -f $(PROGRAM_NAME)*
data-cleanup:
rm -f *.mat
rm -f *.xml
rm -f *.svg
rm -rf ./output
mkdir ./output
touch ./output/empty.txt
# archival
checkpoint:
zip -r $$(date +%b_%d_%Y_%H%M).zip Makefile *.cpp *.h config/*.xml custom_modules/*
zip:
zip -r latest.zip Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/*
cp latest.zip $$(date +%b_%d_%Y_%H%M).zip
cp latest.zip VERSION_$(VERSION).zip
mv *.zip archives/
tar:
tar --ignore-failed-read -czf latest.tar Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/*
cp latest.tar $$(date +%b_%d_%Y_%H%M).tar
cp latest.tar VERSION_$(VERSION).tar
mv *.tar archives/
unzip:
cp ./archives/latest.zip .
unzip latest.zip
untar:
cp ./archives/latest.tar .
tar -xzf latest.tar