|
Size: 6125
Comment:
|
← Revision 15 as of 2021-10-26 19:16:55 ⇥
Size: 6807
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 2: | Line 2: |
| This writup presents easy-to-follow instructions on how to build CC3D 4.x.x on Linux | This write-up presents easy-to-follow instructions on how to build CC3D 4.x.x on Linux |
| Line 6: | Line 6: |
| * conda installation - use python 3.7 installer for 64-bit linux from this webpage https://conda.io/miniconda.html | * conda installation - use python 3.7 installer for 64-bit linux from this webpage https://conda.io/miniconda.html (installing conda is described below in the section "Installing conda") |
| Line 10: | Line 10: |
| '''Important''' For this tutorial to work you need to make sure that '''libGLU.so''' is in the '''/usr/lib64'''. On Ubuntu this library will be installed in '''/usr/lib/x86_64-linux-gnu''' | '''Important''': for this tutorial to work you need to make sure that '''libGLU.so''' is in the '''/usr/lib64'''. On Ubuntu this library will be installed in '''/usr/lib/x86_64-linux-gnu''' |
| Line 18: | Line 18: |
| If you are on '''CentOS 7.x''' or '''RedHat 7.x''' you may have more work to do but it is fairly straightforward because you will need to create more symbolic links for completeness we are listing the commands necessary to accomplish this task: | If you are on '''CentOS 7.x''' or '''RedHat 7.x''' you may have more work to do, but it is fairly straightforward. You will need to create more symbolic links as shown below: |
| Line 32: | Line 32: |
| Of course you need to do it as super user and keep in mind that the library numbers (.so.x) may vary depending on your system version | |
| Line 33: | Line 34: |
| ==Cloning essential repositories== | == Cloning essential repositories == |
| Line 45: | Line 47: |
| '''Important''': you can find useful CC3D linux setup/compilation details inside '''<your_home_dir>/cc3d_build_scripts/linux/400''' folder. Those are internal notes and the content of them is relayed here but in case we missed some details it is not a bad idea to look into this folder. |
|
| Line 54: | Line 59: |
| ==Instaling conda== | == Instaling conda == |
| Line 83: | Line 88: |
| conda install -c conda-forge numpy scipy pandas jinja2 webcolors vtk=8.2 pyqt pyqtgraph deprecated qscintilla2 jinja2 chardet cmake swig | conda install -c conda-forge numpy scipy pandas jinja2 webcolors vtk=8.2 pyqt pyqtgraph deprecated qscintilla2 jinja2 chardet cmake swig=3 requests |
| Line 86: | Line 91: |
| Additionally we will need to install libroadrunner (solves SBML models) using '''pip''' by typing | vtk packages from conda-forge repository depends on Threading Building Blocks library (tbb). However, conda package does not include all dependencies needed to compile and link c++ modules that rely on vtk. To alleviate this we build conda package that fixex issues with tb installation. All you need to do is to install ''tbb_full_dev'' package from ''compucell3d'' anaconda channel by running: {{{ conda install -c compucell3d tbb_full_dev }}} Additionally we will need to install '''libroadrunner''' (solves SBML models) and '''antimony''' (make SBML model specification much easier and elegant) using '''pip''' by typing |
| Line 90: | Line 101: |
| pip install antimony | |
| Line 105: | Line 117: |
| ==Adding TBB to conda environment== | |
| Line 107: | Line 118: |
| TBB is s C library so all we need to do is to grab binaries for linux from https://github.com/intel/tbb/blob/master/download.md For our purposes we used this direct link to grab pre-build windows tbb libraries https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb43_20150611oss_lin.tgz Assuming we are building 64-bit application we copy ``include/tbb`` directory of the tbb binaries into ``<conda_root>/envs/cc3d_2020/include/vtk-8.2`` . In your case the exact location of conda environment you are creating might be different . The important part is to go from the root of the environment - in my case ``<conda_root>/envs/cc3d_2020`` to ``include/vtk-8.2``. Next we copy make a soft link to existing '''tbb.so.2''' library by running {{{ cd <conda_root>/envs/cc3d_2020/lib ln -s libtbb.so.2 libtbb.so }}} ==Fixing Qt hard-coded paths in qt.conf== |
== Fixing Qt hard-coded paths in qt.conf (optional - needed only if you plan to redistribute your cc3d package) == |
| Line 145: | Line 131: |
| ==Compiling== | == Compiling == |
| Line 151: | Line 137: |
| conda activate cc3d_2020 | conda activate base |
| Line 155: | Line 141: |
| python build.py --prefix=<your_home_dir>/410_auto --source-root=<your_home_dir>/CC3D_PY3_GIT --build-dir=<your_home_dir>/400_auto_build --version=4.0.0 --cores=2 --conda-env-name=cc3d_2020 | python build.py --prefix=<your_home_dir>/410_auto --source-root=<your_home_dir>/CC3D_PY3_GIT --build-dir=<your_home_dir>/410_auto_build --version=4.1.0 --cores=2 --conda-env-name=cc3d_2020 |
| Line 157: | Line 143: |
'''Important''' It is important to activate base conda environment before using script ''build.py''. The script figures out the path to conda environment using a method that will not work properly if you are in ''cc3d_2020'' environment. |
|
| Line 160: | Line 148: |
| ==Bundling compiled binaries for distribution to another machine== | == Testing == You can test your installation with; {{{ cd <your_home_dir>/410_auto runScript.sh }}} Which should return the option list for CompCell3D via that script. To do an actual run using a demo try: {{{ runScript.sh -i ./Demos/cellsort_project_py_step_new_style/cellsort_2D.cc3d -f 11 -fs 12 -fr 13 }}} This will write in your CC3DWorkspace folder named "cellsort_2D_cc3d_MM_DD_YYYY_HH_MM_SS", restart files every 13 steps and VTK files every 11 steps. ---- |
| Line 163: | Line 167: |
Of course you need to do it as super user and keep in mind that the library numbers (.so.x) may vary depending on your system version |
Building CompuCell3D 4.x.x on Linux
This write-up presents easy-to-follow instructions on how to build CC3D 4.x.x on Linux
Prerequisites
conda installation - use python 3.7 installer for 64-bit linux from this webpage https://conda.io/miniconda.html (installing conda is described below in the section "Installing conda")
- git
- c++ compiler (gcc/g+= version 4.6+)
Important: for this tutorial to work you need to make sure that libGLU.so is in the /usr/lib64. On Ubuntu this library will be installed in /usr/lib/x86_64-linux-gnu In this case you may have to create symbolic link (you have to be sudo to do that)
ln -s /usr/lib/x86_64-linux-gnu /usr/lib64
If you are on CentOS 7.x or RedHat 7.x you may have more work to do, but it is fairly straightforward. You will need to create more symbolic links as shown below:
cd /usr/lib64 ln -s libXt.so.6 libXt.so ln -s libGLU.so.1 libGLU.so ln -s libGL.so.1 libGL.so ln -s libXext.so.6 libXext.so ln -s libX11.so.6 libX11.so ln -s libICE.so.6 libICE.so ln -s libSM.so.6 libSM.so
Of course you need to do it as super user and keep in mind that the library numbers (.so.x) may vary depending on your system version
Cloning essential repositories
First let's make sure we have cloned a repository that contains CC3D documentation and useful build CC3D scripts for various operating systems. We do this by running the following commands:
cd git clone https://github.com/CompuCell3D/cc3d_build_scripts.git
The repository will be cloned to <your_home_dir>/cc3d_build_scripts
Important: make sure to replace <your_home_dir> with actual path to your home directory
Important: you can find useful CC3D linux setup/compilation details inside <your_home_dir>/cc3d_build_scripts/linux/400 folder. Those are internal notes and the content of them is relayed here but in case we missed some details it is not a bad idea to look into this folder.
Next let's clone actual CC3D repository:
mkdir <your_home_dir>/CC3D_PY3_GIT cd <your_home_dir>/CC3D_PY3_GIT git clone https://github.com/CompuCell3D/CompuCell3D.git .
Instaling conda
To install conda/miniconda on your machine please follow the instructions indicated on this page:
https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
After you successfully install conda first thing we will do is to create python virtual environment where we will store all the dependencies for compiling and running CC3D:
conda create -n cc3d_2020 python=3.7
After the environment cc3d_2020 is created we will activate it. BTW you can call this environment whatever you want. Just keep the names meaningful to you:
source activate cc3d_2020
or
conda activate cc3d_2020
Let's install CC3D dependencies this environment to enable compilation of CC3D:
conda install -c conda-forge numpy scipy pandas jinja2 webcolors vtk=8.2 pyqt pyqtgraph deprecated qscintilla2 jinja2 chardet cmake swig=3 requests
vtk packages from conda-forge repository depends on Threading Building Blocks library (tbb). However, conda package does not include all dependencies needed to compile and link c++ modules that rely on vtk. To alleviate this we build conda package that fixex issues with tb installation. All you need to do is to install tbb_full_dev package from compucell3d anaconda channel by running:
conda install -c compucell3d tbb_full_dev
Additionally we will need to install libroadrunner (solves SBML models) and antimony (make SBML model specification much easier and elegant) using pip by typing
pip install libroadrunner pip install antimony
If you need specific version of libroadrunner you can always type , for example:
pip install libroadrunner==1.5.24
where we specified version 1.5.24 following two equal signs.
At this point we are almost ready to install compile CC3D but we need to do few minor patches. It happens sometimes that packages coming from conda channels are not 100% ready for use during compilations so we need to fix them. Fortunately the steps required to do so are minor
Fixing Qt hard-coded paths in qt.conf (optional - needed only if you plan to redistribute your cc3d package)
To ensure that we can run cc3d on other systems we need to copy qt.conf from <your home dir>/cc3d_build_scripts/linux/400/conda_patches folder into <conda_root>/envs/cc3d_2020/bin or simply replace the content of <conda_root>/envs/cc3d_2020/bin/qt.conf with the following text:
[Paths] Prefix = ../ Binaries = ../bin Libraries = ../lib Headers = ../include/qt
Compiling
Once you completed above steps by far the easiest way to compile CC3Dis to use automatic script build.py from <your home dir>/cc3d_build_scripts/linux/400/ folder. To do so do the following:
conda activate base cd <your home dir>/cc3d_build_scripts/linux/400/ python build.py --prefix=<your_home_dir>/410_auto --source-root=<your_home_dir>/CC3D_PY3_GIT --build-dir=<your_home_dir>/410_auto_build --version=4.1.0 --cores=2 --conda-env-name=cc3d_2020
Important It is important to activate base conda environment before using script build.py. The script figures out the path to conda environment using a method that will not work properly if you are in cc3d_2020 environment.
After the the script finishes you should have a copy of CC3D in <your_home_dir>/410_auto
Testing
You can test your installation with;
cd <your_home_dir>/410_auto runScript.sh
Which should return the option list for CompCell3D via that script. To do an actual run using a demo try:
runScript.sh -i ./Demos/cellsort_project_py_step_new_style/cellsort_2D.cc3d -f 11 -fs 12 -fr 13
This will write in your CC3DWorkspace folder named "cellsort_2D_cc3d_MM_DD_YYYY_HH_MM_SS", restart files every 13 steps and VTK files every 11 steps.
Important: You may need to apply additional fix apply on newer linuxes (Ununtu 18.04 RedHat 7.5) This is related to the issue of that shows up during the compilation and is related to SWIG complaining that it is unable find "swig.swg" file (and few others). The temporary solution is to uninstall system swig and install swig from source by following download links from www.swig.org. Alternatively you may fix it by specifying proper path to SWIG_DIR in the CMake dialog - make sure you toggle Advanced box and type Swig in CMake search box to display this setting
CompuCell3D