simbarras / tb23-gpu-opt-celeritas

Miror of my documentation repository for my bachelor thesis
https://gitlab.forge.hefr.ch/frederic.bapst/tb23-gpu-opt-celeritas
0 stars 0 forks source link

Compile the code #16

Closed simbarras closed 1 year ago

simbarras commented 1 year ago
simbarras commented 1 year ago

Module

Command Description
module load/unload {moduleName}/{modulePath} Load or unload a module. Good to add module load git in .bashrc
module list List loaded module
module available List available module to load
simbarras commented 1 year ago

Spack

Spack

Package/dependency manager for project. Standard in HPC.

Documentation: https://spack-tutorial.readthedocs.io/en/latest/index.html#

Install

Get source

git clone --depth=100 --branch=releases/v0.20 https://github.com/spack/spack.git ~/spack

Source project

echo ". ~/spack/share/spack/setup-env.sh" >> ~/.bashrc

Load new conf

exec bash

Command

Command Description
spack env create {envName} {envPath} Create a new environnement using a yaml file
spack env activate {envName} Activate a spack env
spack env deactivate Deactivate a spack env
spack concretize -f Show what will be installed
spack install Install the dependency for the environment
spack find Show installed dependency
spack config add packages:all:variants:"+cuda cuda_arch=80" Add CUDA to build Celeritas on Zeus
simbarras commented 1 year ago

Compile the code

To compile the code, there is a script with preset that checks all kinds of things for us. The test automatically launchs the test.

scripts/build.sh base

Preset:

Sourcing environment script at scripts/env/zeus.sh
loading cuda/11.8.0
Usage: scripts/build.sh PRESET [config_args...]
Available configure preses:

  "base"        - Zeus default options (GCC, debug)
  "reldeb-novg" - Zeus release with debug symbols and Orange
  "reldeb"      - Zeus release with debug symbols
  "ndebug-novg" - Zeus release with Orange
  "ndebug"      - Zeus release
  "default"     - Automatic options (debug with tests)
  "full"        - Full
  "minimal"     - Minimal

First build

Before the first build, the dependencies need to be installed.

To install the dependencies, run the follow the steps above:

Load the needed module to install dependencies.

module load cmake
module unload gcc
source /cvmfs/sft.cern.ch/lcg/contrib/gcc/11.3.0/x86_64-centos7-gcc11-opt/setup.sh

Set, create and activate the environment.

spack config add packages:all:variants:"+cuda cuda_arch=80"
spack env create celeritas scripts/spack.yaml
spack activate Celeritas

And then launch the installation. It will take many hours.

spack install

Now you may be ready to build the project