MacOS installation guide

The objective of this guide is to thoroughly describe all the steps required to install CIANNA for computing methods C_NAIV and C_BLAS over a fresh MacOS (26.0.1) install with a M2 chip. While depicted for this configuration, the steps are identical for a wide range of Apple Silicon chip and MacOS versions.

This guide is not a replacement for the Installation instructions page, which contains more details on some points and presents the installation process in a more generic way.

System Information


For this guide, we used a desktop workstation equipped with the following hardware:

Optionnal step : Homebrew installation


CIANNA has very few dependencies but some, like openBLAS, might be difficult to install on Mac1. We therefore advise to install the Homebrew package manager that will make the installation easier by giving access to proven dependencies :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then we will install the following dependencies using brew2 :
brew install openblas cmake python3 python-setuptools numpy

CIANNA installation


Both the pip and cmake installation detailed in the installation instructions are available at this point. For the sake of the example, we will install CIANNA through cmake by doing :
git clone https://github.com/Deyht/CIANNA.git
cd CIANNA
cmake -B build
cmake --build build
The library will then be installed in CIANNA/build/ and can be loaded in any python script using:
import sys
sys.path.insert(0,glob.glob('path/to/CIANNA/build/')[-1])
import CIANNA
You can check the installation by running one of the example scripts in the CIANNA/examples/ folder. For some of them you will need additional python dependencies. For example one can run the MNIST examples :
brew install python3-matplotlib wget
cd examples/MNIST/
python3 mnist_train.py
  1. Although another implementation of the BLAS standard exists natively on MAC. It is called Apple Accelerate and can be found automatically by CIANNA with the cmake installation method.
  2. The clang C compiler and git should already be installed but it is possible to install gcc and git through brew too.