-
Clone project:
git clone https://github.com/freesurfer/samseg.git
-
Get the submodules:
git submodule init
git submodule update
-
Create a virtual environment using, e.g., conda:
conda create -n samseg python=3.9
-
Activate the virtual environment:
conda activate samseg
-
Install requirements:
python -m pip install -r requirements.txt
-
Install correct compilers for ITK v.4.13.2
conda install -c conda-forge gxx_linux-64=7.5 gcc_linux-64=7.5 sysroot_linux-64=2.17
-
Create the ITK build directory
mkdir ITK-build
cd ITK-build
-
Export compilers installed with conda:
export CC=<your_conda_path>/envs/samseg/bin/x86_64-conda_cos6-linux-gnu-gcc
export CC=<your_conda_path>/envs/samseg/bin/x86_64-conda_cos6-linux-gnu-g++
-
Run CMAKE:
cmake \ (samseg) -DBUILD_SHARED_LIBS=OFF \ -DBUILD_TESTING=OFF \ -DBUILD_EXAMPLES=OFF \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=../ITK-install \ ../ITK
-
Install:
make install
-
Build python wheel (or create and editable install using
develop
instead ofbdist_wheel
)ITK_DIR=ITK-install python setup.py bdist_wheel