2. Installation

2.1. Prerequisites

To install a minimal version of Onika, the following dependencies are required:

  • CMake ≥ 3.26

  • GCC ≥ 11.0.0 with full C++20 support

  • yaml-cpp version 0.6.3

    Warning

    yaml-cpp version 0.7.0 is not supported. Please use version 0.6.3.

  • CUDA (optional) Onika can be built without CUDA if GPU acceleration is not needed.

2.1.1. Installing yaml-cpp

Onika requires version 0.6.3 of yaml-cpp.

export CURRENT_HOME=$PWD
git clone --depth 1 --branch yaml-cpp-0.6.3 https://github.com/jbeder/yaml-cpp.git
mkdir ${CURRENT_HOME}/build-yaml-cpp && cd ${CURRENT_HOME}/build-yaml-cpp
cmake ../yaml-cpp/ \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-yaml-cpp \
    -DYAML_BUILD_SHARED_LIBS=ON \
    -YAML_CPP_BUILD_TESTS=OFF
make install -j 4
cd ${CURRENT_HOME}
export PATH_TO_YAML=$PWD/install-yaml-cpp

2.2. Installing Onika

You can install Onika either manually using CMake, or using Spack. CUDA support is optional.

export CURRENT_HOME=$PWD
git clone https://github.com/Collab4exaNBody/onika.git
mkdir ${CURRENT_HOME}/build-onika && cd ${CURRENT_HOME}/build-onika
cmake ${CURRENT_HOME}/onika \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-onika
make install -j 10

To check your installation:

source bin/setup-env.sh
./bin/onika-exec /dev/null

Output

Version : 1.4
MPI     : 1    process
CPU     : 20   cores (max 20) : 0-19
OpenMP  : 20   threads (v4.0)
SIMD    : SSE2
SOATL   : align=16 , vec=4


  █████╗ ███╗   ██╗██╗██╗  ██╗ █████╗     ██╗   ██╗ ██╗    ██████╗
 ██╔═══██╗████╗  ██║██║██║ ██╔╝██╔══██╗    ██║   ██║███║   ██╔═████╗
 ██║   ██║██╔██╗ ██║██║█████╔╝ ███████║    ██║   ██║╚██║   ██║██╔██║
 ██║   ██║██║╚██╗██║██║██╔═██╗ ██╔══██║    ╚██╗ ██╔╝ ██║   ████╔╝██║
 ╚██████╔╝██║ ╚████║██║██║  ██╗██║  ██║     ╚████╔╝  ██║██╗╚██████╔╝
        ╚═════╝ ╚═╝  ╚═══╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝      ╚═══╝   ╚═╝╚═╝ ╚═════╝
=========== GPU  ================
GPU  disabled
=================================

Internal unit system for default conversions
+-------------+-------------------+--------+
| Type        | Unit              | Symbol |
+-------------+-------------------+--------+
| length      | meter             | m      |
+-------------+-------------------+--------+
| mass        | kilogram          | kg     |
+-------------+-------------------+--------+
| time        | second            | s      |
+-------------+-------------------+--------+
| charge      | coulomb           | C      |
+-------------+-------------------+--------+
| temperature | kelvin            | K      |
+-------------+-------------------+--------+
| amount      | mol               | mol    |
+-------------+-------------------+--------+
| luminosity  | candela           | cd     |
+-------------+-------------------+--------+
| angle       | radian            | rad    |
+-------------+-------------------+--------+
| energy      | joule             | J      |
+-------------+-------------------+--------+