Skip to content
Update Developer Installation authored by Shuran Wang's avatar Shuran Wang
[[_TOC_]] [[_TOC_]]
---- ----
# Docker Development Install # Docker Development Install
## Pre-requisites ## Pre-requisites
* If you haven't acquired a Mosek license yet, see [Mosek Requirement](Install#common-requirements). * If you haven't acquired a Mosek license yet, see [Mosek Requirement](Install#common-requirements).
* If you haven't installed Docker yet, see [Docker](docker). * If you haven't installed Docker yet, see [Docker](docker).
## Setting up the container ## Setting up the container
* Please follow the instructions in the [User Installation Guide](User-Installation#setting-up-a-container) on how to set up a docker container for PDT-SPACE on either Linux or Windows. * Please follow the instructions in the [User Installation Guide](User-Installation#setting-up-a-container) on how to set up a docker container for PDT-SPACE on either Linux or Windows.
* Once you run the docker image, you can find the source code of PDT-SPACE under ``/src/pdt-space``. You can start developing in this directory. The build system is under ``/src/pdt-space/Build``. * Once you run the docker image, you can find the source code of PDT-SPACE under ``/src/pdt-space``. You can start developing in this directory. The build system is under ``/src/pdt-space/Build``.
* The Intel Vtune profiling tool has been added to the docker image, to set up the environment source the script ``/opt/intel/oneapi/setvars.sh``. * The Intel Vtune profiling tool has been added to the docker image, to set up the environment source the script ``/opt/intel/oneapi/setvars.sh``.
# Native Development Install (Linux Only) # Native Development Install (Linux Only)
- Note: These instructions assume you have administrative privileges (``sudo``) on your machine. - Note: These instructions assume you have administrative privileges (``sudo``) on your machine.
- Note: We will use ``$HOME`` to refer to your home directory. - Note: We will use ``$HOME`` to refer to your home directory.
## Pre-requisites ## Pre-requisites
- git: ``sudo apt-get install git``. - git: ``sudo apt-get install git``.
- tar: ``sudo apt-get install tar``. - tar: ``sudo apt-get install tar``.
- cpuid: ``sudo apt-get install cpuid``. - cpuid: ``sudo apt-get install cpuid``.
- Modern compiler with ``C++11`` support (recen g++, clang, Ubuntu 16.04/Xenial and recent Mac OS clang work fine). - Modern compiler with ``C++20`` support (recen g++, clang, Ubuntu 24.04 and recent Mac OS clang work fine).
- git-lfs. - git-lfs.
- [CMake](cmake) version >= 3.12. - [CMake](cmake) version >= 3.28.3
- [Mosek Fusion C++ API](https://www.mosek.com/downloads/9.1.13/) version 9.1 - Mosek is the optimization library that PDT-SPACE uses to solve convex optimization problems. The library provides a free academic license for faculty and students that can be downloaded from their website. - [Mosek Fusion C++ API](https://www.mosek.com/downloads/11.0.13/) version 11.0 - Mosek is the optimization library that PDT-SPACE uses to solve convex optimization problems. The library provides a free academic license for faculty and students that can be downloaded from their website.
- [Boost](www.boost.org) version >= 1.58.0 with serialization, timer, date\_time, system, program\_options unit\_test\_framework compiled - [Boost](www.boost.org) version >= 1.83.0 with serialization, timer, date\_time, system, program\_options unit\_test\_framework compiled
(Ubuntu package ``libboost-all-dev``) (Ubuntu package ``libboost-all-dev``)
- [VTK](https://www.vtk.org) 7.1.1 - needs to be built from source (it uses CMake, so see section [CMake](cmake)) - [VTK](https://www.vtk.org) 9.4.1 - needs to be built from source (it uses CMake, so see section [CMake](cmake))
- [Eigen](eigen.tuxfamily.org/) version >= 3.0 - can be install using ``sudo apt-get install libeigen3-dev``. Eigen3 is a C++ template library for linear algebra. - [Eigen](eigen.tuxfamily.org/) version >= 3.0 - can be install using ``sudo apt-get install libeigen3-dev``. Eigen3 is a C++ template library for linear algebra.
- [FullMonteSW](gitlab.com/FullMonte/FullMonteSW) Fastest open-source tetrahedral Monte Carlo simulator for light propagation in biological tissues. Please, follow their [wiki](https://gitlab.com/FullMonte/FullMonteSW/-/wikis/Developer-Guide#native-development-install-linux-only) to see how to install it. - [FullMonteSW](gitlab.com/FullMonte/FullMonteSW) Fastest open-source tetrahedral Monte Carlo simulator for light propagation in biological tissues. Please, follow their [wiki](https://gitlab.com/FullMonte/FullMonteSW/-/wikis/Developer-Guide#native-development-install-linux-only) to see how to install it.
## Installing all Required Libraries, Packages and Software to run PDT-SPACE ## Installing all Required Libraries, Packages and Software to run PDT-SPACE
1. If you haven't already done so, install git by typing: ```sudo apt-get install git```. 1. If you haven't already done so, install git by typing: ```sudo apt-get install git```.
2. Install git-lfs. We need ``curl`` for this, so this package will also be installed. 2. Install git-lfs. We need ``curl`` for this, so this package will also be installed.
``` ```
> sudo apt-get install curl > sudo apt-get install curl
> curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash > curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
> sudo apt-get install git-lfs > sudo apt-get install git-lfs
``` ```
3. Install cmake by following the instructions in this [guide](CMake#from-source-recommended). 3. Install cmake by following the instructions in this [guide](CMake#from-source-recommended).
4. Install Mosek as follows: 4. Install Mosek as follows:
``` ```
> cd $HOME > cd $HOME
> curl -L https://download.mosek.com/stable/9.1.13/mosektoolslinux64x86.tar.bz2 -o mosek.tar.bz2 > curl -L https://download.mosek.com/stable/11.0.13/mosektoolslinux64x86.tar.bz2 -o mosek.tar.bz2
> tar -xjf mosek.tar.bz2 > tar -xjf mosek.tar.bz2
> cd mosek/9.1/tools/platform/linux64x86/src/fusion_cxx > cd /usr/local/mosek/11.0/tools/platform/linux64x86/src/fusion_cxx
> make install > make install
``` ```
This will install Mosek version 9.1.13 under ``$HOME/mosek/9.1/tools/platform/linux64x86``. This will install Mosek version 11.0.13 under ``$HOME/mosek/11.0/tools/platform/linux64x86``.
- **Note:** You still need to obtain a [Mosek License](https://www.mosek.com/products/academic-licenses/) and store it under your ``$HOME`` directory. - **Note:** You still need to obtain a [Mosek License](https://www.mosek.com/products/academic-licenses/) and store it under your ``$HOME`` directory.
5. Install boost 1.58 by typing: ``sudo apt-get install libboost-all-dev``. 5. Install boost 1.83 by typing: ``sudo apt-get install libboost-all-dev``.
6. Install VTK 7.1.1 by following the instructions in this [guide](vtk#how-to-install). 6. Install VTK 9.4.1 by following the instructions in this [guide](vtk#how-to-install).
7. Install FullMonteSW by following this [guide](https://gitlab.com/FullMonte/FullMonteSW/-/wikis/Developer-Guide#native-development-install-linux-only). We will refer to the build directory of FullMonteSW by ``$FULLMONTE_BUILD_DIR``. 7. Install FullMonteSW by following this [guide](https://gitlab.com/FullMonte/FullMonteSW/-/wikis/Developer-Guide#native-development-install-linux-only). We will refer to the build directory of FullMonteSW by ``$FULLMONTE_BUILD_DIR``.
## Installing PDT-SPACE ## Installing PDT-SPACE
0. Go to your home directory (or wherever you prefer your workspace to be). 0. Go to your home directory (or wherever you prefer your workspace to be).
``` ```
> cd $HOME > cd $HOME
``` ```
1. Clone the PDT-SPACE repository into your workspace directory. 1. Clone the PDT-SPACE repository into your workspace directory.
``` ```
> git clone https://gitlab.com/FullMonte/pdt-space.git > git clone https://gitlab.com/FullMonte/pdt-space.git
``` ```
2. Create a build directory for out-of-source build for PDT-SPACE. 2. Create a build directory for out-of-source build for PDT-SPACE.
``` ```
> mkdir -p pdt-space/Build/ReleaseGCC > mkdir -p pdt-space/Build/ReleaseGCC
``` ```
3. Test data requires Git LFS for download. You will need to run git-lfs in the source directory just once to set it up. 3. Test data requires Git LFS for download. You will need to run git-lfs in the source directory just once to set it up.
``` ```
> cd pdt-space > cd pdt-space
> git lfs install > git lfs install
``` ```
4. Go to the build directory and get the paths for ``g++`` and ``gcc``. 4. Go to the build directory and get the paths for ``g++`` and ``gcc``.
``` ```
> cd $HOME/pdt-space/Build/ReleaseGCC > cd $HOME/pdt-space/Build/ReleaseGCC
> export OUT_CXX = "$(which g++)" > export OUT_CXX = "$(which g++)"
> export OUT_C = "$(which gxx)" > export OUT_C = "$(which gxx)"
``` ```
5. Run the following command in the terminal: 5. Run the following command in the terminal:
``` ```
cpuid | grep -i avx | sort | uniq cpuid | grep -i avx | sort | uniq
``` ```
- If the results state that AVX2 is false, type ``AVX_ARCH = "AVX"``. Otherwise, type ``AVX_ARCH = "AVX2"``. - If the results state that AVX2 is false, type ``AVX_ARCH = "AVX"``. Otherwise, type ``AVX_ARCH = "AVX2"``.
6. Configure PDT-SPACE with ``cmake`` by executing the following: 6. Configure PDT-SPACE with ``cmake`` by executing the following:
``` ```
> cmake \ > cmake \
-DARCH=${AVX_ARCH} \ -DARCH=${AVX_ARCH} \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_COMPILER=/usr/bin/g++-13 \
-DCMAKE_CXX_COMPILER=${OUT_CXX} \ -DCMAKE_C_COMPILER=/usr/bin/gcc-13 \
-DCMAKE_C_COMPILER=${OUT_C} \ -DMOSEK_PREFIX=/usr/local/mosek-11.0.13/11.0/tools/platform/linux64x86 \
-DFullMonteSW_DIR=${FULLMONTESW_BUILD_DIR}/cmake \ -DCMAKE_BUILD_TYPE=Release \
-DMOSEK_PREFIX=$HOME/mosek/9.1/tools/platform/linux64x86 \ -DCMAKE_INSTALL_PREFIX=/usr/local/pdt-space \
-DRUN_TEST=OFF \ -DVTK_DIR=/usr/local/VTK-9.4.1/lib/cmake/vtk-9.4 \
../.. -DBOOST_ROOT=/usr/lib/x86_64-linux-gnu \
``` -DFullMonteSW_DIR=/usr/local/FullMonteSW/include \
- Once CMake runs without errors, you will have project files for your chosen generator in the build directory. -DUSE_CUDA=1 \
- **Note**: The above ``cmake`` command assumes that all the required libraries other than FullMonteSW and Mosek are installed globally using ``sudo`` privilages. If that's not the case, please look at the _CMAKE Variables_ section below that summarizes the important variables you need to supply for ``cmake``. -DRUN_TEST=OFF \
- **Note**: The above ``cmake`` command defaults to the build tool ``make``. If you want to use ``ninja`` for instance, you need to start the command with: ../..
``` ```
> cmake -G Ninja - Once CMake runs without errors, you will have project files for your chosen generator in the build directory.
``` - **Note**: The above ``cmake`` command assumes that all the required libraries other than FullMonteSW and Mosek are installed globally using ``sudo`` privilages. If that's not the case, please look at the _CMAKE Variables_ section below that summarizes the important variables you need to supply for ``cmake``.
7. Build PDT-SPACE: From your build directory, invoke your build tool (``make``, ``ninja``, etc) and the software should be built. - **Note**: The above ``cmake`` command defaults to the build tool ``make``. If you want to use ``ninja`` for instance, you need to start the command with:
``` ```
> make -j<NUM_THREADS> > cmake -G Ninja
``` ```
where ``<NUM_THREADS>`` is the number of threads available on your machine to use to speed up the compile time. 7. Build PDT-SPACE: From your build directory, invoke your build tool (``make``, ``ninja``, etc) and the software should be built.
```
### Notes: > make -j<NUM_THREADS>
- If the build system *generates correctly* and *then* fails, please log an issue in our bug tracker ([this wiki page](Fixing-bugs-and-adding-features)). It's not a bug if prerequisites are not installed (unless they are undocumented), or if they are installed but not provided to CMake. Please include the command line you used to run `cmake` or `ccmake`, a copy of `CMakeCache.txt` from your build directory, and the error text. Thank you! ```
- If you wish to install the software for use, it will be installed in the `CMAKE_INSTALL_PREFIX` dir when you run `make install`. Note this may require `sudo` if installing in `/usr` or other global dirs. where ``<NUM_THREADS>`` is the number of threads available on your machine to use to speed up the compile time.
### CMake Variables: ### Notes:
CMake variables can be specified on the command line in the form ``-D<var>=<value>``, eg. ``-DCMAKE_BUILD_TYPE=RELEASE`` - If the build system *generates correctly* and *then* fails, please log an issue in our bug tracker ([this wiki page](Fixing-bugs-and-adding-features)). It's not a bug if prerequisites are not installed (unless they are undocumented), or if they are installed but not provided to CMake. Please include the command line you used to run `cmake` or `ccmake`, a copy of `CMakeCache.txt` from your build directory, and the error text. Thank you!
Some useful/important variables are listed below: - If you wish to install the software for use, it will be installed in the `CMAKE_INSTALL_PREFIX` dir when you run `make install`. Note this may require `sudo` if installing in `/usr` or other global dirs.
|Variable |Values |Description | ### CMake Variables:
|----------------------|----------------------------------------------|---------------------------------------------------------| CMake variables can be specified on the command line in the form ``-D<var>=<value>``, eg. ``-DCMAKE_BUILD_TYPE=RELEASE``
|CMAKE\_BUILD\_TYPE |Release, Debug, Debug\_check or RelWithDebInfo|Build type (Recommended: Release for highest performance)| Some useful/important variables are listed below:
|Boost\_DIR |path |Directory prefix of Boost's ``include/boost`` and ``lib`` directories. May be omitted if they are in the standard location (eg. installed by package manager)|
|VTK\_DIR |path |The location of VTKConfig.cmake. May be omitted if installed globally. | |Variable |Values |Description |
|MOSEK\_PREFIX |path |Directory prefix of Mosek's ``h`` and ``bin`` directories| |----------------------|----------------------------------------------|---------------------------------------------------------|
|FullMonteSW\_DIR |path |The location of FullMonteSWConfig.cmake | |CMAKE\_BUILD\_TYPE |Release, Debug, Debug\_check or RelWithDebInfo|Build type (Recommended: Release for highest performance)|
|Eigen3\_DIR |path |The location of Eigen3Config.cmake | |Boost\_DIR |path |Directory prefix of Boost's ``include/boost`` and ``lib`` directories. May be omitted if they are in the standard location (eg. installed by package manager)|
|CMAKE\_INSTALL\_PREFIX |path |Location where files are installed when the ``install`` target is invoked | |VTK\_DIR |path |The location of VTKConfig.cmake. May be omitted if installed globally. |
|ARCH |AVX/AVX2 |Supported instruction architecture of the current machine | |MOSEK\_PREFIX |path |Directory prefix of Mosek's ``h`` and ``bin`` directories|
|FullMonteSW\_DIR |path |The location of FullMonteSWConfig.cmake |
# Next Steps |Eigen3\_DIR |path |The location of Eigen3Config.cmake |
|CMAKE\_INSTALL\_PREFIX |path |Location where files are installed when the ``install`` target is invoked |
|ARCH |AVX/AVX2 |Supported instruction architecture of the current machine |
# Next Steps
In order to verify your installation, please visit the [Running PDT-SPACE](Running-PDT-SPACE) tutorial. In order to verify your installation, please visit the [Running PDT-SPACE](Running-PDT-SPACE) tutorial.
\ No newline at end of file