Skip to content

Commit

Permalink
Added save, load, pack, unpack, list-user-projects instructions in Ph…
Browse files Browse the repository at this point in the history
…ysiBoSS projects Makefile
  • Loading branch information
vincent-noel committed Jun 4, 2024
1 parent 7c57b5d commit 0371cde
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 2 deletions.
76 changes: 75 additions & 1 deletion sample_projects_intracellular/boolean/cancer_invasion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,78 @@ untar:

movie:
ffmpeg -r 25 -i output/snapshot%08d.svg -pix_fmt yuv420p output.mp4
vlc output.mp4
vlc output.mp4

# upgrade rules

SOURCE := PhysiCell_upgrade.zip
get-upgrade:
@echo $$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) > VER.txt
@echo https://github.com/MathCancer/PhysiCell/releases/download/$$(grep . VER.txt)/PhysiCell_V.$$(grep . VER.txt).zip > DL_FILE.txt
rm -f VER.txt
$$(curl -L $$(grep . DL_FILE.txt) --output PhysiCell_upgrade.zip)
rm -f DL_FILE.txt

PhysiCell_upgrade.zip:
make get-upgrade

upgrade: $(SOURCE)
unzip $(SOURCE) PhysiCell/VERSION.txt
mv -f PhysiCell/VERSION.txt .
unzip $(SOURCE) PhysiCell/core/*
cp -r PhysiCell/core/* core
unzip $(SOURCE) PhysiCell/modules/*
cp -r PhysiCell/modules/* modules
unzip $(SOURCE) PhysiCell/sample_projects/*
cp -r PhysiCell/sample_projects/* sample_projects
unzip $(SOURCE) PhysiCell/BioFVM/*
cp -r PhysiCell/BioFVM/* BioFVM
unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf
mv -f PhysiCell/documentation/User_Guide.pdf documentation
rm -f -r PhysiCell
rm -f $(SOURCE)

# use: make save PROJ=your_project_name
PROJ := my_project

save:
echo "Saving project as $(PROJ) ... "
mkdir -p ./user_projects
mkdir -p ./user_projects/$(PROJ)
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
cp Makefile ./user_projects/$(PROJ)
cp VERSION.txt ./user_projects/$(PROJ)
cp ./config/* ./user_projects/$(PROJ)/config
cp ./custom_modules/* ./user_projects/$(PROJ)/custom_modules

load:
echo "Loading project from $(PROJ) ... "
cp ./user_projects/$(PROJ)/main.cpp .
cp ./user_projects/$(PROJ)/Makefile .
cp ./user_projects/$(PROJ)/config/* ./config/
cp ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/

pack:
@echo " "
@echo "Preparing project $(PROJ) for sharing ... "
@echo " "
cd ./user_projects && zip -r $(PROJ).zip $(PROJ)
@echo " "
@echo "Share ./user_projects/$(PROJ).zip ... "
@echo "Other users can unzip $(PROJ).zip in their ./user_projects, compile, and run."
@echo " "

unpack:
@echo " "
@echo "Preparing shared project $(PROJ).zip for use ... "
@echo " "
cd ./user_projects && unzip $(PROJ).zip
@echo " "
@echo "Load this project via make load PROJ=$(PROJ) ... "
@echo " "

list-user-projects:
@echo "user projects::"
@cd ./user_projects && ls -dt1 * | grep . | sed 's!empty.txt!!'
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,81 @@ unzip:
untar:
cp ./archives/latest.tar .
tar -xzf latest.tar

movie:
ffmpeg -r 25 -i output/snapshot%08d.svg -pix_fmt yuv420p output.mp4
vlc output.mp4

# upgrade rules

SOURCE := PhysiCell_upgrade.zip
get-upgrade:
@echo $$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) > VER.txt
@echo https://github.com/MathCancer/PhysiCell/releases/download/$$(grep . VER.txt)/PhysiCell_V.$$(grep . VER.txt).zip > DL_FILE.txt
rm -f VER.txt
$$(curl -L $$(grep . DL_FILE.txt) --output PhysiCell_upgrade.zip)
rm -f DL_FILE.txt

PhysiCell_upgrade.zip:
make get-upgrade

upgrade: $(SOURCE)
unzip $(SOURCE) PhysiCell/VERSION.txt
mv -f PhysiCell/VERSION.txt .
unzip $(SOURCE) PhysiCell/core/*
cp -r PhysiCell/core/* core
unzip $(SOURCE) PhysiCell/modules/*
cp -r PhysiCell/modules/* modules
unzip $(SOURCE) PhysiCell/sample_projects/*
cp -r PhysiCell/sample_projects/* sample_projects
unzip $(SOURCE) PhysiCell/BioFVM/*
cp -r PhysiCell/BioFVM/* BioFVM
unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf
mv -f PhysiCell/documentation/User_Guide.pdf documentation
rm -f -r PhysiCell
rm -f $(SOURCE)

# use: make save PROJ=your_project_name
PROJ := my_project

save:
echo "Saving project as $(PROJ) ... "
mkdir -p ./user_projects
mkdir -p ./user_projects/$(PROJ)
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
cp Makefile ./user_projects/$(PROJ)
cp VERSION.txt ./user_projects/$(PROJ)
cp ./config/* ./user_projects/$(PROJ)/config
cp ./custom_modules/* ./user_projects/$(PROJ)/custom_modules

load:
echo "Loading project from $(PROJ) ... "
cp ./user_projects/$(PROJ)/main.cpp .
cp ./user_projects/$(PROJ)/Makefile .
cp ./user_projects/$(PROJ)/config/* ./config/
cp ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/

pack:
@echo " "
@echo "Preparing project $(PROJ) for sharing ... "
@echo " "
cd ./user_projects && zip -r $(PROJ).zip $(PROJ)
@echo " "
@echo "Share ./user_projects/$(PROJ).zip ... "
@echo "Other users can unzip $(PROJ).zip in their ./user_projects, compile, and run."
@echo " "

unpack:
@echo " "
@echo "Preparing shared project $(PROJ).zip for use ... "
@echo " "
cd ./user_projects && unzip $(PROJ).zip
@echo " "
@echo "Load this project via make load PROJ=$(PROJ) ... "
@echo " "

list-user-projects:
@echo "user projects::"
@cd ./user_projects && ls -dt1 * | grep . | sed 's!empty.txt!!'
76 changes: 75 additions & 1 deletion sample_projects_intracellular/boolean/tutorial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,78 @@ untar:

movie:
ffmpeg -r 25 -i output/snapshot%08d.svg -pix_fmt yuv420p output.mp4
vlc output.mp4
vlc output.mp4

# upgrade rules

SOURCE := PhysiCell_upgrade.zip
get-upgrade:
@echo $$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) > VER.txt
@echo https://github.com/MathCancer/PhysiCell/releases/download/$$(grep . VER.txt)/PhysiCell_V.$$(grep . VER.txt).zip > DL_FILE.txt
rm -f VER.txt
$$(curl -L $$(grep . DL_FILE.txt) --output PhysiCell_upgrade.zip)
rm -f DL_FILE.txt

PhysiCell_upgrade.zip:
make get-upgrade

upgrade: $(SOURCE)
unzip $(SOURCE) PhysiCell/VERSION.txt
mv -f PhysiCell/VERSION.txt .
unzip $(SOURCE) PhysiCell/core/*
cp -r PhysiCell/core/* core
unzip $(SOURCE) PhysiCell/modules/*
cp -r PhysiCell/modules/* modules
unzip $(SOURCE) PhysiCell/sample_projects/*
cp -r PhysiCell/sample_projects/* sample_projects
unzip $(SOURCE) PhysiCell/BioFVM/*
cp -r PhysiCell/BioFVM/* BioFVM
unzip $(SOURCE) PhysiCell/documentation/User_Guide.pdf
mv -f PhysiCell/documentation/User_Guide.pdf documentation
rm -f -r PhysiCell
rm -f $(SOURCE)

# use: make save PROJ=your_project_name
PROJ := my_project

save:
echo "Saving project as $(PROJ) ... "
mkdir -p ./user_projects
mkdir -p ./user_projects/$(PROJ)
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
cp Makefile ./user_projects/$(PROJ)
cp VERSION.txt ./user_projects/$(PROJ)
cp ./config/* ./user_projects/$(PROJ)/config
cp ./custom_modules/* ./user_projects/$(PROJ)/custom_modules

load:
echo "Loading project from $(PROJ) ... "
cp ./user_projects/$(PROJ)/main.cpp .
cp ./user_projects/$(PROJ)/Makefile .
cp ./user_projects/$(PROJ)/config/* ./config/
cp ./user_projects/$(PROJ)/custom_modules/* ./custom_modules/

pack:
@echo " "
@echo "Preparing project $(PROJ) for sharing ... "
@echo " "
cd ./user_projects && zip -r $(PROJ).zip $(PROJ)
@echo " "
@echo "Share ./user_projects/$(PROJ).zip ... "
@echo "Other users can unzip $(PROJ).zip in their ./user_projects, compile, and run."
@echo " "

unpack:
@echo " "
@echo "Preparing shared project $(PROJ).zip for use ... "
@echo " "
cd ./user_projects && unzip $(PROJ).zip
@echo " "
@echo "Load this project via make load PROJ=$(PROJ) ... "
@echo " "

list-user-projects:
@echo "user projects::"
@cd ./user_projects && ls -dt1 * | grep . | sed 's!empty.txt!!'

0 comments on commit 0371cde

Please sign in to comment.