Installing ANTs on Ubuntu

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: