Skip to content

Latest commit

 

History

History
273 lines (210 loc) · 6.49 KB

File metadata and controls

273 lines (210 loc) · 6.49 KB

Setup PhysiCell on Linux

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.

🐧 Operating system library dependencies

✨ Update the package manager:

sudo apt update
sudo apt upgrade

✨ Install GCC (required by PhysiCell):

sudo apt install build-essential

✨ Install Image Magick (required by PhysiCell):

ImageMagick 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 imagemagick

Now try:

magick --version
  1. If ok: you have >= version 7 installed. You are all set!
  2. If you receive: Command 'magick' not found, try:
convert --version
  1. 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 '$*' > magick
chmod 775 magick
which magick

✨ Install FFmpeg, Tar, Gzip, and Unzip (required by PhysiCell):

sudo apt install ffmpeg tar gzip unzip

✨ Install the Qt 5 library (required by PhysiCell-Studio):

sudo apt install qtbase5-dev

✨ Install Python (required by PhysiCell-Studio and PhysiCell Data Loader):

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-pyqt5

🐧 Basic PhyiCell installation

✨ Install PhysiCell:

install='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.'
fi

✨ Test the PhyiCell installation with the template sample project:

Run this code line by line.

cd ~/src/PhysiCell
make data-cleanup clean reset  # ./config/PhysiCell_settings-backup.xml related Error can be ignored!
make template
make -j8
./project
make jpeg
make gif
make movie

🐧 Essential installation

We 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 PhysiCell-Studio:

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.'
fi

✨ Test the PhysiCell-Studio installation:

Run this code line by line.

cd ~/src/PhysiCell
pcvenv
pcstudio

✨ Official PhysiCell Studio manual:

🐧 Advanced installation

✨ Install PhysiCell Data Loader (pcdl) and iPython:

Run this code line by line.

pcvenv
pip3 install pcdl ipython

✨ Test the pcdl installation:

Fire up a python shell.

ipython

Inside the python shell write:

import pcdl
print(pcdl.__version__)
exit()

✨ Official pcdl manual:

🐧 IDE VSCode integration (optional)

  1. 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!

  2. 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
  1. Open the Folder:
File | Open Folder… | /home/<username>/src | Open
Yes, I trust the authors
  1. 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
  1. Link pcvenv (the python environment we generated above):
View | Command Palette… | Python: Select Interpreter | Enter interpreter path… | Find… | /home/<username>/src/pcvenv/bin/python3