MacOS installation

MacOS Sonoma 14.3

Here are the instructions to build Octopus on MacOS, adding Mac specific details to the general instructions. This guide assumes you are using the latest MacOS version, i.e. Sonoma 14.3. NOTE WELL: Building Octopus on MacOS is not fully supported, so even if you follow this instruction thoroughly, the installation might fail. Even if the installation is successful, it is still likely that many tests in ‘make check’ will fail.

This guide was tested on an Apple M1 Pro chip, but it should be compatible with an Inter processor. However, you should check the installation folder for Homebrew.

Before Installing

First of all, you need to install Xcode Command Line Tools. This provides Apple’s developer tools, including compilers. This is required to install the package manager required to install Octopus. To install Xcode Command Line Tools, open the Terminal app and execute xcode-select --install

Find out the architecture of your CPU: To do that it’s enough to click on the Apple logo in the top left corner and select the first item in the drop-down (About this Mac…). Then look at the information for the chip, if it says Apple M1/M1 Pro/M2 then the architecture is arm64, otherwise, it’s x86_64 (Intel CPU)

Choose the package manager that you want to use

It is possible to install Octopus with the two most know package managers for MacOS, HomeBrew and MacPorts.
Once you chose it, please follow the instructions on the package manager’s website to correctly install it on your machine.
Finally, close and reopen your terminal to make changes effective.

Choose the installation mode, manual or automatic

Irrespective of the package manager that you chose, you can either perform a manual or an automatic installation of Octopus.

Get Octopus

After choosing the package manager and installing it, and after choosing your preferred installation method, it is time to get Octopus.
Create a folder in your favorite location and open a Terminal window in that folder. To do this, type cd then drag and drop the folder from the Finder to the Terminal.

Get the source code

GIT CLONE: To use git clone you will need to have git installed on your local computer and to have a GitLab account. The official repository page is Octopus-code. Then execute in the terminal:

git clone https://gitlab.com/octopus-code/octopus.git

DOWNLOAD SOURCE: Go to the releases and download the latest version. Place the downloaded tar.gz file and place it in the folder you created. Then extract all files by double clicking or using the terminal command tar xzf octopus-14.tar.gz

Automatic installation

In this section the automatic installation mode will be described. You may skip this section if you chose to install manually.
The scripts are located in the Octopus repository, as

Finally, remember to check on Homebrew website for the compatibility of the packages with your architecture To do it, got to https://formulae.brew.sh/ and type the formula you want to install (e.g. libxc).

It is possible to install Octopus with the two most known package managers for MacOS, HomeBrew and MacPorts.
Once you chose it, please follow the instructions on the package manager’s website to correctly install it on your machine.
Finally, close and reopen your terminal to make changes effective.

Depending on what package manager you installed installed, Homebrew or MacPorts, use the corresponding shell script. If you installed both of them, please only run one of the two scripts. They can be run with the following command from the terminal:

./build_octopus_macos_brew.sh
./build_octopus_macos_macports.sh

Both offer some installation options, which may be specified after the command above

For example, if you want to install Octopus with Homebrew in your favourite folder, with debug flags and requiring the installation of libraries you should run:

./build_octopus_macos_brew.sh --prefix=<path_to_favourite_folder> -l -d

After understanding the installation options, follow these steps:

  1. Open the terminal where you want to install Octopus. Create a folder that will contain the result of the build:
mkdir <folder_name>
cd <folder_name>
  1. Copy the installation script here
cp <path_to_octopus>/scripts/build/build_octopus_macos_brew.sh .
  1. Change the terminal type to bash using:
exec bash
  1. Run the script using the commands below. Then enjoy a long coffee!
./build_octopus_macos_brew.sh --root-path=<path_to_octopus> <options>

Manual installation

In this section the manual installation of Octopus will be described. Please be aware that Octopus has many dependencies, thus it is likely that you will encounter errors at some stage of the process.

  1. Configuring the workspace
export PATH=<needed_path>:$PATH
  1. Install libraries (skip this step if you already have them installed)
  1. Create the configure script and run it. To do that, go to the Octopus root folder and run
autoreconf -i

Then run it with

./configure <configure options>

You can find the configure options by running configure --help Here are some common issues that can happen:

  1. Run make and make install to build Octopus

Congratulations! You now have Octopus running on your computer
Go to the tutorials to start learning how to use it.