MacOS installation

MacOS Monterey 12.6

Here the general instructions for building Octopus on MacOS. This guide assumes you are using the latest MacOS version, i.e. Monterey 12.6.

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

Install HomeBrew. To do that, just follow the procedure on the website.

You may also need to install Xcode Command Line Tools. In case you need it, it is enough to 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)

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).

Now open the Terminal app and follow the procedure below:

Install required and optinal libraries

Install compilers
Install libraries

Clone and compile Octopus

Now we shall start compiling Octopus. You may want to restart your Mac. Then, 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 create an SSH key and a GitLab account. Then execute:

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

DOWNLOAD SOURCE: Go to the releases and download the lastest version. Place the downloaded tsr.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-13.tar.gz

Compile the code

Execute:

mkdir local_build
cd local_build
cp ../octopus/scripts/build/build_octopus_macos.sh ./
source build_octopus_macos.sh

Now Octopus was installed in ../installed/bin

Execute Octopus

Create a folder and a file called “inp” in it. Put all options (https://www.octopus-code.org/documentation/main/) required for your calculation.

Due to some error with rapidxml library, please always set: PseudopotentialSet = 0
You can still use a pseudopotential by:

  1. Using the species block:
%Species
 'C' | species_pseudo | file | “path_to_file”
%
  1. Setting
PseudopotentialSet = hscv_lda

Execute Octopus in serial by running:

<path_to_octopus_installation>/octopus

Execute Octopus in parallel by running

/opt/homebrew/bin/mpirun -n 4 <path_to_octopus_installation>/octopus

where -n 4 tells the number of processors you wish to use (in this case 4).