Getting the latest code
Prerequisites:
- Is git installed? If not, run
sudo apt install -y git
- Is build-essentials installed? If not, run
sudo apt install -y build-essentials
- Is ccache installed? If not, run
sudo apt install -y ccache
- Install the latest version of cmake: https://5k45h.wordpress.com/2020/03/16/upgrading-cmake/
Navigate to the directory where you want to download the repository (e.g. ~/Code/Sources) and run:
git clone https://github.com/ANTsX/ANTs.git
This creates a directory called ANTs with all the code.
Now create sub-directories for compilation:
mkdir ANTs/Build
and installation:
mkdir /opt/ANTs
(may require sudo
)
Enter the compilation directory:
cd ANTs/Build
Do the following:
cmake -DCMAKE_INSTALL_PREFIX=/opt/ANTs ../ 2>&1 | tee cmake.log
make -j 4 2>&1 | tee build.log
cd ANTS-build
make install 2>&1 | tee install.log
If the last step fails, try with sudo
.
After successful compilation and installation, add to PATH:
echo 'export ANTSPATH=/opt/ANTs/bin' >> ~/.bashrc
echo 'export PATH=${ANTSPATH}:$PATH' >> ~/.bashrc
Open a new terminal and run:
antsRegistration -h
Reference: https://github.com/ANTsX/ANTs/wiki/Compiling-ANTs-on-Linux-and-Mac-OS
One thought on “Installing ANTs on Ubuntu”