CMake Build Instructions

Overview

  • Create a binary directory and enter it. This will contain the results of your build (the libraries and executables).

    mkdir XGC-bin
    cd XGC-bin
    
  • Run CMake to configure a build of XGC. Additional settings can be passed as -D flags.

    cmake /path/to/XGC-Devel
    

    To interactively edit configuration settings, use ccmake for a CLI or cmake-gui for a GUI.

  • Build XGC

    make
    

Managing dependencies

XGC depends on ADIOS, PETSc, FFTW.

Local Development

Using system-installed dependencies

You will need to provide CMake with the location of XGC’s dependencies if they

are already installed on your system.

cmake
  -DADIOS1_ROOT=<path to ADIOS1>
  -DPETSc_ROOT=<path to PETSc>
  -DFFTW_ROOT=<path to FFTW>
<path to XGC-Devel>

Superbuild

XGC can download, build, and install its dependencies for you. We call this feature a superbuild. To enable this feature, pass -DBUILD_DEPENDENCIES=ON to cmake when configuring the build.

cmake /path/to/XGC-Devel -DBUILD_DEPENDENCIES=ON
make

This tells CMake to download and build all of the dependencies before building XGC.

Building at HPC facilities

If you are building XGC at an HPC facility then XGC’s dependencies have likely already been installed for you.

XGC’s CMake build system knows where to find these dependencies at the following HPC facilities:

  • cori_haswell

  • cori_knl

  • edison

  • greene

  • titan

If you set the environment variable XGC_PLATFORM to one of these values then CMake will automatically find XGC’s dependencies for you.

export XGC_PLATFORM=greene
cmake /path/to/XGC-Devel
make -j