Compilation

Setting up the environment

After having downloaded the code, ensure that all required external dependencies and modules are available. Bash setup scripts are available through ConfiX. These scripts automatically load the necessary modules for various toolchains and apply sensible default configuration parameters. They support several commonly used machines, which are detected automatically at runtime. You can use these scripts as a convenient starting point to tailor the code configuration to your specific environment and hardware. You can load the necessary modules and set default parameters by running:

export PROJECT_NAME=PARALLAX
$ source confix/bash_tools/<toolchain>_setup.sh

where <toolchain> can be, for example, intel or gnu. Setting the environment variable PROJECT_NAME is important for selecting PARALLAX specialisations.

Compilation

To configure, compile, and install the code to <INSTALL_DIR> using CMake, follow these steps:

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=<Debug, Release> ${TOOLCHAIN_CMAKE_OPTIONS} ${PROJECT_CMAKE_OPTIONS}
$ make -j
$ make install

This process will install the library files to the <INSTALL_DIR>/lib64 directory. Additionally, you will find several executables in the <INSTALL_DIR>/bin directory. The environment variables and hold configuration options set by the ConfiX bash scripts. You may add and/or override individual options (see below) by appending them at the end of the configuration command.

Advanced compilation options

The steps outlined above will install PARALLAX with default features and release flags. However, you can customize the build process by passing additional options during the CMake configuration. The most commonly used options include:

  • -DCMAKE_BUILD_TYPE=Debug: Compiles the code with debug flags enabled.
  • -DPARALLAX_ENABLE_UTESTS=ON: Enables unit tests. Additional unit test executables will be placed in the <INSTALL_DIR>/bin directory.
  • -DPARALLAX_ENABLE_PACCX=ON (under development): Enables the PARALLAX Accelerator library, which provides a GPU implementation of the field solver.
  • -DPARALLAX_ENABLE_MKL=OFF: Disables the MKL library. With this option, the MGMRES field solver is not available, but the PAccX solver can be used as an alternative.
  • -DPARALLAX_ENABLE_CERFACS=ON: Enables the GMRES 3D solver from Cerfacs as an alternative to the PIM solver.
  • -DPARALLAX_ENABLE_VTK=ON: Enables the VTKFortran library for 3D visualization support.
  • -DPARALLAX_ENABLE_FLARE=ON (under development): Enables an interface to the FLARE magnetic reconstruction tool. Note that the FLARE library is not automatically downloaded and must be installed separately.
  • -DPARALLAX_ENABLE_PETSC=ON: Compiles with PETSc as an alternative option for the field solver (for experimental purposes).