This document describes the PhysiCell installation on a Debian Linux distribution. If you run on another flavor, please adjust accordingly.
We will install everything PhysiCell related under the ~/src folder. If you prefer another folder name, please adjust the commands accordingly.
sudo apt update
sudo apt upgradesudo apt install build-essentialImageMagick is used for making jpeg and gif images from PhysiCell svg image output.
The PhysiCell Makefile is written for ImageMagick >= version 7, which requires a magick command in front of each ImageMagick command (e.g. magick convert instead of convert).
Many Linux distributions ship with ImageMagick version 6.
This is why we might have to tewak a bit the installation.
sudo apt install imagemagickNow try:
magick --version- If ok: you have >= version 7 installed. You are all set!
- If you receive: Command 'magick' not found, try:
convert --version- If ok: you have version 6 or less installed.
If and only if you have <= version 6 installed, you can follow the instruction below to generate a magick command that simply passes everything to the next command. This will make the PhysiCell Makefile work for you too.
cd to the folder where you have your manual installed binaries. e.g. ~/.local/bin/
Run this code line by line.
echo '$*' > magickchmod 775 magickwhich magicksudo apt install ffmpeg tar gzip unzipsudo apt install qtbase5-dev
Python is most probably already installed, but pip, venv, and the pyqt5 binding might be missing (required to install PhysiCell-Studio and pcdl).
sudo apt install python3-pip python3-venv python3-pyqt5install='Y'
uart='None'
if [ -d ~/src/PhysiCell ]
then
echo "WARNING : /home/$USER/src/PhysiCell already exists! do you wanna re-install? data will be lost! [Y,N]"
read uart
else
uart='Y'
fi
if [ $install == $uart ]
then
mkdir -p ~/src
cd ~/src
curl -L https://github.com/MathCancer/PhysiCell/archive/refs/tags/$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt).zip > download.zip
unzip download.zip
rm download.zip
rm -fr PhysiCell
mv PhysiCell-$(curl https://raw.githubusercontent.com/MathCancer/PhysiCell/master/VERSION.txt) PhysiCell
else
echo 'installation terminated.'
fiRun this code line by line.
cd ~/src/PhysiCellmake data-cleanup clean reset # ./config/PhysiCell_settings-backup.xml related Error can be ignored!make templatemake -j8./projectmake jpegmake gifmake movieWe will generate a python3 environment with the default python installation, where we will install all PhysiCell modelling related python libraries. We will name this python3 environment pcvenv (PhysiCell virtual environment).
install='Y'
uart='None'
if [ -d ~/src/PhysiCell-Studio ]
then
echo "WARNING : /home/$USER/src/PhysiCell-Studio already exists! do you wanna re-install? data will be lost! [Y,N]"
read uart
else
uart='Y'
fi
if [ $install == $uart ]
then
cd ~/src
python3 -m venv pcvenv
if ! grep -Fq 'alias pcvenv=' ~/.bash_aliases
then
echo "alias pcvenv=\"source /home/$USER/src/pcvenv/bin/activate\"" >> ~/.bash_aliases
fi
source /home/$USER/src/pcvenv/bin/activate
curl -L https://github.com/PhysiCell-Tools/PhysiCell-Studio/archive/refs/tags/v$(curl https://raw.githubusercontent.com/PhysiCell-Tools/PhysiCell-Studio/refs/heads/main/VERSION.txt).zip > download.zip
unzip download.zip
rm download.zip
rm -fr PhysiCell-Studio
mv PhysiCell-Studio-$(curl https://raw.githubusercontent.com/PhysiCell-Tools/PhysiCell-Studio/refs/heads/main/VERSION.txt) PhysiCell-Studio
pip3 install -r PhysiCell-Studio/requirements.txt
cd ~/src/pcvenv/bin/
echo "python3 /home/$USER/src/PhysiCell-Studio/bin/studio.py \$*" > pcstudio
chmod 775 pcstudio
cd ~/src
else
echo 'installation terminated.'
fiRun this code line by line.
cd ~/src/PhysiCellpcvenvpcstudioRun this code line by line.
pcvenvpip3 install pcdl ipythonFire up a python shell.
ipythonInside the python shell write:
import pcdl
print(pcdl.__version__)
exit()-
Install vs code, either from your operating system’s distrio or from https://code.visualstudio.com/ . Note: flatpack will not work; it cannot handle the pcvenv virtual python environment correctly that we generated!
-
Generate a vs code profile for physicell:
File | New Window with Profile
Name: physicell
Icon: choose something cool.
Create
Add Folder: /home/<username>/src
click the profile icon (default is a gearwheel) on the left side bottom corner.
Profile > physicell
- Open the Folder:
File | Open Folder… | /home/<username>/src | Open
Yes, I trust the authors
- Install the official python and C++ extensions into the profile:
click the profile icon (default is a gearwheel) on the left side bottom corner.
Profile > physicell
Extension: Python Install
Extension: C/C++ Install
- Link pcvenv (the python environment we generated above):
View | Command Palette… | Python: Select Interpreter | Enter interpreter path… | Find… | /home/<username>/src/pcvenv/bin/python3