-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
189 lines (136 loc) · 6.1 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
VERSION := $(shell grep . VERSION.txt | cut -f1 -d:)
PROGRAM_NAME := OT_2D
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 := OT_2D.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)
# compile the project
all: main.cpp $(ALL_OBJECTS)
$(COMPILE_COMMAND) -o $(PROGRAM_NAME) $(ALL_OBJECTS) main.cpp
# 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: ./BioFVM/BioFVM_basic_agent.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_basic_agent.cpp
BioFVM_matlab.o: ./BioFVM/BioFVM_matlab.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_matlab.cpp
BioFVM_MultiCellDS.o: ./BioFVM/BioFVM_MultiCellDS.cpp
$(COMPILE_COMMAND) -c ./BioFVM/BioFVM_MultiCellDS.cpp
pugixml.o: ./BioFVM/pugixml.cpp
$(COMPILE_COMMAND) -c ./BioFVM/pugixml.cpp
# standard PhysiCell modules
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
OT_2D.o: ./custom_modules/OT_2D.cpp
$(COMPILE_COMMAND) -c ./custom_modules/OT_2D.cpp
# 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