Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Wiki
    • For developers
  • Compile OPAL

Last edited by snuverink_j Feb 09, 2023
Page history

Compile OPAL


Introduction

Compiling OPAL can be quite challenging due to all the required libraries. Even if some libraries are available on the system, this doesn’t mean that they can be used for compiling OPAL due to missing features.

NOTE: In the code snippets below we use the environment variables SRC_DIR and PREFIX. Whereby SRC_DIR must be set to the directory OPAL will be build in and PREFIX to the OPAL installation directory.

Get the OPAL sources

Clone the OPAL Git repository

mkdir -p "${SRC_DIR}/OPAL"
cd "${SRC_DIR}/OPAL"
git clone https://gitlab.psi.ch/OPAL/src.git

Select the OPAL branch you want to compile. The current stable branch is OPAL-2022.1:

cd "${SRC_DIR}/OPAL/src"
git checkout OPAL-2022.1

To checkout the (unstable) development branch run:

cd "${SRC_DIR}/OPAL/src"
git checkout master

To get a list of all available branches, you can run the command

git branch -a

from inside your clone.

Configure OPAL

OPAL uses CMake to configure the build process. You can either pass options to cmake or you can run the command ccmake in the build directory after calling cmake.

mkdir -p "${SRC_DIR}/OPAL/build" && cd "$_"
CC=mpicc CXX=mpicxx cmake \
        --prefix="${PREFIX}" \
        "${SRC_DIR}/OPAL/src"

The following table shows the most important options:

CMAKE_BUILD_TYPE

build type can be either Debug, Release, RelWithDebInfo or MinSizeRel

CMAKE_INSTALL_PREFIX

prefix for installation

BUILD_OPAL_UNIT_TESTS

enable the unit-tests

requires google-test >= 1.10.0

ENABLE_AMR

enable AMR solver

requires AMReX (release 18.07)

ENABLE_AMR_MG_SOLVER

enable AMR multigrid solver

requires trilinos >= 12.x and AMReX (release 18.07)

ENABLE_BANDRF

compile BANDRF field conversion scripts

ENABLE_OPAL_FEL

enable full-wave solver

requires MITHRA 2.0

ENABLE_SAAMG_SOLVER

enable SAAMG solver

requires trilinos >= 12.x and parmetis >= 4.0.3

Compile and install OPAL

cd "${SRC_DIR}/OPAL/build"
make -j ${NJOBS}
make install
Clone repository
  • Examples
    • FFA
    • RFPhotoInjector
    • cyclotron
    • regressiontestexamples
  • FFA school prerequisites
  • For Developers
    • CodingStyle
    • Compile OPAL at CSCS
    • Compile OPAL
    • Compile required software
    • File Format for stat Storage
    • Most Used Directories in the Code
    • OPAL Development Workflow
    • Pmodules
    • Release Procedure
    • Setup build environment at PSI
View All Pages