|
| 1 | +VERSION := $(shell grep . VERSION.txt | cut -f1 -d:) |
| 2 | +PROGRAM_NAME := project |
| 3 | + |
| 4 | +CC := g++ |
| 5 | +# CC := g++-mp-7 # typical macports compiler name |
| 6 | +# CC := g++-7 # typical homebrew compiler name |
| 7 | + |
| 8 | +# Check for environment definitions of compiler |
| 9 | +# e.g., on CC = g++-7 on OSX |
| 10 | +ifdef PHYSICELL_CPP |
| 11 | + CC := $(PHYSICELL_CPP) |
| 12 | +endif |
| 13 | + |
| 14 | +ARCH := native # best auto-tuning |
| 15 | +# ARCH := core2 # a reasonably safe default for most CPUs since 2007 |
| 16 | +# ARCH := corei7 |
| 17 | +# ARCH := corei7-avx # earlier i7 |
| 18 | +# ARCH := core-avx-i # i7 ivy bridge or newer |
| 19 | +# ARCH := core-avx2 # i7 with Haswell or newer |
| 20 | +# ARCH := nehalem |
| 21 | +# ARCH := westmere |
| 22 | +# ARCH := sandybridge # circa 2011 |
| 23 | +# ARCH := ivybridge # circa 2012 |
| 24 | +# ARCH := haswell # circa 2013 |
| 25 | +# ARCH := broadwell # circa 2014 |
| 26 | +# ARCH := skylake # circa 2015 |
| 27 | +# ARCH := bonnell |
| 28 | +# ARCH := silvermont |
| 29 | +# ARCH := skylake-avx512 |
| 30 | +# ARCH := nocona #64-bit pentium 4 or later |
| 31 | + |
| 32 | +# CFLAGS := -march=$(ARCH) -Ofast -s -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11 |
| 33 | +CFLAGS := -march=$(ARCH) -O3 -fomit-frame-pointer -mfpmath=both -fopenmp -m64 -std=c++11 |
| 34 | + |
| 35 | +COMPILE_COMMAND := $(CC) $(CFLAGS) |
| 36 | + |
| 37 | +BioFVM_OBJECTS := BioFVM_vector.o BioFVM_mesh.o BioFVM_microenvironment.o BioFVM_solvers.o BioFVM_matlab.o \ |
| 38 | +BioFVM_utilities.o BioFVM_basic_agent.o BioFVM_MultiCellDS.o BioFVM_agent_container.o |
| 39 | + |
| 40 | +PhysiCell_core_OBJECTS := PhysiCell_phenotype.o PhysiCell_cell_container.o PhysiCell_standard_models.o \ |
| 41 | +PhysiCell_cell.o PhysiCell_custom.o PhysiCell_utilities.o |
| 42 | + |
| 43 | +PhysiCell_module_OBJECTS := PhysiCell_SVG.o PhysiCell_pathology.o PhysiCell_MultiCellDS.o PhysiCell_various_outputs.o \ |
| 44 | +PhysiCell_pugixml.o PhysiCell_settings.o |
| 45 | + |
| 46 | +# put your custom objects here (they should be in the custom_modules directory) |
| 47 | + |
| 48 | +PhysiCell_custom_module_OBJECTS := .o |
| 49 | + |
| 50 | +pugixml_OBJECTS := pugixml.o |
| 51 | + |
| 52 | +PhysiCell_OBJECTS := $(BioFVM_OBJECTS) $(pugixml_OBJECTS) $(PhysiCell_core_OBJECTS) $(PhysiCell_module_OBJECTS) |
| 53 | +ALL_OBJECTS := $(PhysiCell_OBJECTS) $(PhysiCell_custom_module_OBJECTS) |
| 54 | + |
| 55 | +EXAMPLES := ./examples/PhysiCell_test_mechanics_1.cpp ./examples/PhysiCell_test_mechanics_2.cpp \ |
| 56 | + ./examples/PhysiCell_test_DCIS.cpp ./examples/PhysiCell_test_HDS.cpp \ |
| 57 | + ./examples/PhysiCell_test_cell_cycle.cpp ./examples/PhysiCell_test_volume.cpp |
| 58 | + |
| 59 | +all: |
| 60 | + make heterogeneity-sample |
| 61 | + make |
| 62 | + |
| 63 | +# sample projects |
| 64 | + |
| 65 | +template2D: |
| 66 | + cp ./sample_projects/template2D/custom_modules/* ./custom_modules/ |
| 67 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 68 | + cp ./sample_projects/template2D/main-2D.cpp ./main.cpp |
| 69 | + cp Makefile Makefile-backup |
| 70 | + cp ./sample_projects/template2D/Makefile . |
| 71 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 72 | + cp ./sample_projects/template2D/config/* ./config/ |
| 73 | + |
| 74 | +template3D: |
| 75 | + cp ./sample_projects/template3D/custom_modules/* ./custom_modules/ |
| 76 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 77 | + cp ./sample_projects/template3D/main-3D.cpp ./main.cpp |
| 78 | + cp Makefile Makefile-backup |
| 79 | + cp ./sample_projects/template3D/Makefile . |
| 80 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 81 | + cp ./sample_projects/template3D/config/* ./config/ |
| 82 | + |
| 83 | +# sample projects |
| 84 | + |
| 85 | +biorobots-sample: |
| 86 | + cp ./sample_projects/biorobots/custom_modules/* ./custom_modules/ |
| 87 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 88 | + cp ./sample_projects/biorobots/main-biorobots.cpp ./main.cpp |
| 89 | + cp Makefile Makefile-backup |
| 90 | + cp ./sample_projects/biorobots/Makefile . |
| 91 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 92 | + cp ./sample_projects/biorobots/config/* ./config/ |
| 93 | + |
| 94 | +cancer-biorobots-sample: |
| 95 | + cp ./sample_projects/cancer_biorobots/custom_modules/* ./custom_modules/ |
| 96 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 97 | + cp ./sample_projects/cancer_biorobots/main-cancer_biorobots.cpp ./main.cpp |
| 98 | + cp Makefile Makefile-backup |
| 99 | + cp ./sample_projects/cancer_biorobots/Makefile . |
| 100 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 101 | + cp ./sample_projects/cancer_biorobots/config/* ./config/ |
| 102 | + |
| 103 | +heterogeneity-sample: |
| 104 | + cp ./sample_projects/heterogeneity/custom_modules/* ./custom_modules/ |
| 105 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 106 | + cp ./sample_projects/heterogeneity/main-heterogeneity.cpp ./main.cpp |
| 107 | + cp Makefile Makefile-backup |
| 108 | + cp ./sample_projects/heterogeneity/Makefile . |
| 109 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 110 | + cp ./sample_projects/heterogeneity/config/* ./config/ |
| 111 | + |
| 112 | +cancer-immune-sample: |
| 113 | + cp ./sample_projects/cancer_immune/custom_modules/* ./custom_modules/ |
| 114 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 115 | + cp ./sample_projects/cancer_immune/main-cancer_immune_3D.cpp ./main.cpp |
| 116 | + cp Makefile Makefile-backup |
| 117 | + cp ./sample_projects/cancer_immune/Makefile . |
| 118 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 119 | + cp ./sample_projects/cancer_immune/config/* ./config/ |
| 120 | + |
| 121 | +virus-macrophage-sample: |
| 122 | + cp ./sample_projects/virus_macrophage/custom_modules/* ./custom_modules/ |
| 123 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 124 | + cp ./sample_projects/virus_macrophage/main-virus_macrophage.cpp ./main.cpp |
| 125 | + cp Makefile Makefile-backup |
| 126 | + cp ./sample_projects/virus_macrophage/Makefile . |
| 127 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 128 | + cp ./sample_projects/virus_macrophage/config/* ./config/ |
| 129 | + |
| 130 | +beta-testing: |
| 131 | + cp ./sample_projects/beta_testing/custom_modules/* ./custom_modules/ |
| 132 | + touch main.cpp && cp main.cpp main-backup.cpp |
| 133 | + cp ./sample_projects/beta_testing/main-beta.cpp ./main.cpp |
| 134 | + cp Makefile Makefile-backup |
| 135 | + cp ./sample_projects/beta_testing/Makefile . |
| 136 | + cp ./config/PhysiCell_settings.xml ./config/PhysiCell_settings-backup.xml |
| 137 | + cp ./sample_projects/beta_testing/config/* ./config/ |
| 138 | + |
| 139 | +# early examples for convergence testing |
| 140 | + |
| 141 | +physicell_test_mech1: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp |
| 142 | + $(COMPILE_COMMAND) -o test_mech1 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_1.cpp |
| 143 | + |
| 144 | +physicell_test_mech2: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp |
| 145 | + $(COMPILE_COMMAND) -o test_mech2 $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_mechanics_2.cpp |
| 146 | + |
| 147 | +physicell_test_DCIS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp |
| 148 | + $(COMPILE_COMMAND) -o test_DCIS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_DCIS.cpp |
| 149 | + |
| 150 | +physicell_test_HDS: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp |
| 151 | + $(COMPILE_COMMAND) -o test_HDS $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_HDS.cpp |
| 152 | + |
| 153 | +physicell_test_cell_cycle: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp |
| 154 | + $(COMPILE_COMMAND) -o test_cycle $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_cell_cycle.cpp |
| 155 | + |
| 156 | +PhysiCell_test_volume: $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp |
| 157 | + $(COMPILE_COMMAND) -o test_volume $(PhysiCell_OBJECTS) ./examples/PhysiCell_test_volume.cpp |
| 158 | + |
| 159 | +examples: $(PhysiCell_OBJECTS) |
| 160 | + $(COMPILE_COMMAND) -o ./examples/test_mech1 ./examples/PhysiCell_test_mechanics_1.cpp $(PhysiCell_OBJECTS) |
| 161 | + $(COMPILE_COMMAND) -o ./examples/test_mech2 ./examples/PhysiCell_test_mechanics_2.cpp $(PhysiCell_OBJECTS) |
| 162 | + $(COMPILE_COMMAND) -o ./examples/test_DCIS ./examples/PhysiCell_test_DCIS.cpp $(PhysiCell_OBJECTS) |
| 163 | + $(COMPILE_COMMAND) -o ./examples/test_HDS ./examples/PhysiCell_test_HDS.cpp $(PhysiCell_OBJECTS) |
| 164 | + $(COMPILE_COMMAND) -o ./examples/test_cycle ./examples/PhysiCell_test_cell_cycle.cpp $(PhysiCell_OBJECTS) |
| 165 | + $(COMPILE_COMMAND) -o ./examples/test_volume ./examples/PhysiCell_test_volume.cpp $(PhysiCell_OBJECTS) |
| 166 | + |
| 167 | +# PhysiCell core components |
| 168 | + |
| 169 | +PhysiCell_phenotype.o: ./core/PhysiCell_phenotype.cpp |
| 170 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_phenotype.cpp |
| 171 | + |
| 172 | +PhysiCell_digital_cell_line.o: ./core/PhysiCell_digital_cell_line.cpp |
| 173 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_digital_cell_line.cpp |
| 174 | + |
| 175 | +PhysiCell_cell.o: ./core/PhysiCell_cell.cpp |
| 176 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_cell.cpp |
| 177 | + |
| 178 | +PhysiCell_cell_container.o: ./core/PhysiCell_cell_container.cpp |
| 179 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_cell_container.cpp |
| 180 | + |
| 181 | +PhysiCell_standard_models.o: ./core/PhysiCell_standard_models.cpp |
| 182 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_standard_models.cpp |
| 183 | + |
| 184 | +PhysiCell_utilities.o: ./core/PhysiCell_utilities.cpp |
| 185 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_utilities.cpp |
| 186 | + |
| 187 | +PhysiCell_custom.o: ./core/PhysiCell_custom.cpp |
| 188 | + $(COMPILE_COMMAND) -c ./core/PhysiCell_custom.cpp |
| 189 | + |
| 190 | +# BioFVM core components (needed by PhysiCell) |
| 191 | + |
| 192 | +BioFVM_vector.o: ./BioFVM/BioFVM_vector.cpp |
| 193 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_vector.cpp |
| 194 | + |
| 195 | +BioFVM_agent_container.o: ./BioFVM/BioFVM_agent_container.cpp |
| 196 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_agent_container.cpp |
| 197 | + |
| 198 | +BioFVM_mesh.o: ./BioFVM/BioFVM_mesh.cpp |
| 199 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_mesh.cpp |
| 200 | + |
| 201 | +BioFVM_microenvironment.o: ./BioFVM/BioFVM_microenvironment.cpp |
| 202 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_microenvironment.cpp |
| 203 | + |
| 204 | +BioFVM_solvers.o: ./BioFVM/BioFVM_solvers.cpp |
| 205 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_solvers.cpp |
| 206 | + |
| 207 | +BioFVM_utilities.o: ./BioFVM/BioFVM_utilities.cpp |
| 208 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_utilities.cpp |
| 209 | + |
| 210 | +BioFVM_basic_agent.o: ./BioFVM/BioFVM_basic_agent.cpp |
| 211 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_basic_agent.cpp |
| 212 | + |
| 213 | +BioFVM_matlab.o: ./BioFVM/BioFVM_matlab.cpp |
| 214 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_matlab.cpp |
| 215 | + |
| 216 | +BioFVM_MultiCellDS.o: ./BioFVM/BioFVM_MultiCellDS.cpp |
| 217 | + $(COMPILE_COMMAND) -c ./BioFVM/BioFVM_MultiCellDS.cpp |
| 218 | + |
| 219 | +pugixml.o: ./BioFVM/pugixml.cpp |
| 220 | + $(COMPILE_COMMAND) -c ./BioFVM/pugixml.cpp |
| 221 | + |
| 222 | +# standard PhysiCell modules |
| 223 | + |
| 224 | +PhysiCell_SVG.o: ./modules/PhysiCell_SVG.cpp |
| 225 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_SVG.cpp |
| 226 | + |
| 227 | +PhysiCell_pathology.o: ./modules/PhysiCell_pathology.cpp |
| 228 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_pathology.cpp |
| 229 | + |
| 230 | +PhysiCell_MultiCellDS.o: ./modules/PhysiCell_MultiCellDS.cpp |
| 231 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_MultiCellDS.cpp |
| 232 | + |
| 233 | +PhysiCell_various_outputs.o: ./modules/PhysiCell_various_outputs.cpp |
| 234 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_various_outputs.cpp |
| 235 | + |
| 236 | +PhysiCell_pugixml.o: ./modules/PhysiCell_pugixml.cpp |
| 237 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_pugixml.cpp |
| 238 | + |
| 239 | +PhysiCell_settings.o: ./modules/PhysiCell_settings.cpp |
| 240 | + $(COMPILE_COMMAND) -c ./modules/PhysiCell_settings.cpp |
| 241 | + |
| 242 | +# user-defined PhysiCell modules |
| 243 | + |
| 244 | +# cleanup |
| 245 | + |
| 246 | +reset: |
| 247 | + rm -f *.cpp |
| 248 | + cp ./sample_projects/Makefile-default Makefile |
| 249 | + rm -f ./custom_modules/* |
| 250 | + touch ./custom_modules/empty.txt |
| 251 | + touch ALL_CITATIONS.txt |
| 252 | + rm ALL_CITATIONS.txt |
| 253 | + cp ./config/PhysiCell_settings_default.xml ./config/PhysiCell_settings.xml |
| 254 | + touch ./output/empty.txt |
| 255 | + |
| 256 | +clean: |
| 257 | + rm -f *.o |
| 258 | + rm -f $(PROGRAM_NAME)* |
| 259 | + |
| 260 | +data-cleanup: |
| 261 | + rm -f *.mat |
| 262 | + rm -f *.xml |
| 263 | + rm -f *.svg |
| 264 | + rm -f ./output/* |
| 265 | + touch ./output/empty.txt |
| 266 | + |
| 267 | +# archival |
| 268 | + |
| 269 | +zip: |
| 270 | + zip -r latest.zip Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/* |
| 271 | + cp latest.zip $$(date +%b_%d_%Y_%H%M).zip |
| 272 | + cp latest.zip VERSION_$(VERSION).zip |
| 273 | + mv *.zip archives/ |
| 274 | + |
| 275 | +tar: |
| 276 | + tar --ignore-failed-read -czf latest.tar Makefile* *.cpp *.h BioFVM/* config/* core/* custom_modules/* matlab/* modules/* sample_projects/* |
| 277 | + cp latest.tar $$(date +%b_%d_%Y_%H%M).tar |
| 278 | + cp latest.tar VERSION_$(VERSION).tar |
| 279 | + mv *.tar archives/ |
| 280 | + |
| 281 | +unzip: |
| 282 | + cp ./archives/latest.zip . |
| 283 | + unzip latest.zip |
| 284 | + |
| 285 | +untar: |
| 286 | + cp ./archives/latest.tar . |
| 287 | + tar -xzf latest.tar |
0 commit comments