Skip to content

CMake installation

Minimal requirements

yaml-cpp

spack install yaml-cpp@0.6.3
spack load yaml-cpp@0.6.3
sudo apt install libyaml-cpp-dev
1
2
3
4
5
6
7
8
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 -DYAML_CPP_BUILD_TESTS=OFF
make install -j 4
cd ${CURRENT_HOME}
export PATH_TO_YAML=$PWD/install-yaml-cpp

You can then remove yaml-cpp and build-yaml-cpp. When building onika, exaNBody and exaDEM, add -DCMAKE_PREFIX_PATH=${PATH_TO_YAML} to the cmake commands.

onika and exaNBody

Your system must provide MPI. Then build onika and exaNBody:

export CURRENT_HOME=$PWD
git clone --branch v1.1.0 https://github.com/Collab4exaNBody/onika.git
git clone --branch v2.1.0 https://github.com/Collab4exaNBody/exaNBody.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 \
      -DONIKA_BUILD_CUDA=OFF
make install -j 10
export onika_DIR=${CURRENT_HOME}/install-onika
mkdir ${CURRENT_HOME}/build-exanb && cd ${CURRENT_HOME}/build-exanb
cmake ${CURRENT_HOME}/exaNBody -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-exanb \
      -DXNB_PARTICLE_TYPE_INT=uint32_t
make install -j 10
export exaNBody_DIR=${CURRENT_HOME}/install-exanb
rm -rf ${CURRENT_HOME}/build-onika ${CURRENT_HOME}/build-exanb

Replace 86 in -DCMAKE_CUDA_ARCHITECTURES by the compute capability of your GPU.

export CURRENT_HOME=$PWD
git clone --branch v1.1.0 https://github.com/Collab4exaNBody/onika.git
git clone --branch v2.1.0 https://github.com/Collab4exaNBody/exaNBody.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 \
      -DONIKA_BUILD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86
make install -j 10
export onika_DIR=${CURRENT_HOME}/install-onika
mkdir ${CURRENT_HOME}/build-exanb && cd ${CURRENT_HOME}/build-exanb
cmake ${CURRENT_HOME}/exaNBody -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-exanb \
      -DXNB_PARTICLE_TYPE_INT=uint32_t
make install -j 10
export exaNBody_DIR=${CURRENT_HOME}/install-exanb
rm -rf ${CURRENT_HOME}/build-onika ${CURRENT_HOME}/build-exanb

Copy the onika and exaNBody repositories on Topaze. You can load yaml-cpp with module load yaml-cpp/ and add -DCMAKE_PREFIX_PATH=/ccc/products/yaml-cpp-0.6.3/system/default/ to the cmake commands.

module load gnu/13.2.0 cuda/12.4 mpi/openmpi/4.1.6 cmake/3.29.6
cd $CCCSCRATCHDIR
export CURRENT_HOME=$PWD
# copy onika v1.1.0
# copy exaNBody v2.1.0
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 \
      -DONIKA_BUILD_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=80
make install -j 10
export onika_DIR=${CURRENT_HOME}/install-onika
mkdir ${CURRENT_HOME}/build-exanb && cd ${CURRENT_HOME}/build-exanb
cmake ${CURRENT_HOME}/exaNBody -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_HOME}/install-exanb \
      -DXNB_PARTICLE_TYPE_INT=uint32_t
make install -j 10
export exaNBody_DIR=${CURRENT_HOME}/install-exanb
rm -rf ${CURRENT_HOME}/build-onika ${CURRENT_HOME}/build-exanb

Optional dependencies

Building exaDEM

With onika_DIR and exaNBody_DIR set to the installation paths:

git clone https://github.com/Collab4exaNBody/exaDEM.git
mkdir build-exaDEM && cd build-exaDEM
cmake ../exaDEM -DCMAKE_BUILD_TYPE=Release
make -j 4
source bin/setup-env.sh

exaDEM itself has no GPU-specific cmake flag: GPU support is inherited from onika/exaNBody. Make sure onika_DIR and exaNBody_DIR point to installations built with -DONIKA_BUILD_CUDA=ON and the right -DCMAKE_CUDA_ARCHITECTURES (tab "Ubuntu GPU" above); the command is then the same as for the CPU build.

cmake ../exaDEM -DCMAKE_BUILD_TYPE=Release
make -j 4
source bin/setup-env.sh

See Spack installation to install spack itself.

git clone https://github.com/Collab4exaNBody/spack-repos.git
spack repo add spack-repos
spack install exadem

Warning

Load the exaDEM environment before running a job: source bin/setup-env.sh.

Historical note (versions ≤ 1.1.1 only)

In these releases, the maximum number of vertices per particle shape was 8 by default and could be changed with -DEXADEM_MAX_VERTICES=N. This option no longer exists.

./exaDEM --help plugins lists the plugins and their operators, for example:

+ exadem_force_fieldPlugin
  operator    cylinder_wall
  operator    gravity_force
  operator    contact_force
  operator    rigid_surface
+ exadem_ioPlugin
  operator    print_simulation_state
  operator    read_xyz
  operator    read_dump_particles

CEA supercomputers

Set export exaNBody_DIR=${path_to_exaNBody} and export onika_DIR=${path_to_onika} first.

module load yaml-cpp/0.6.3 gnu/13.2.0 mpi/openmpi/4.1.6
cmake ${path_to_exaDEM} -DCMAKE_BUILD_TYPE=Release
module load gnu/13.2.0 cuda/12.4 mpi/openmpi/4.1.6 cmake/3.29.6
cmake ${path_to_exaDEM} -DCMAKE_BUILD_TYPE=Release
module load yaml-cpp/0.6.3 gnu/13.2.0 mpi/openmpi/4.1.6
cmake ${path_to_exaDEM} -DCMAKE_BUILD_TYPE=Release