GNUmake Build System (Legacy)
CMake is our primary build system. In this section, we describe our legacy build scripts - do not use them unless you used them before.
WarpX is built on AMReX, which also provides support for a Linux-centric set of build scripts implemented in GNUmake. Since we sometimes need to move fast and test highly experimental compilers and Unix derivates on core components of WarpX, this set of build scripts is used by some of our experienced developers.
On the long-term, these scripts do not scale to the full feature set of WarpX and its dependencies. Please see the CMake-based developer section instead.
This page describes the most basic build with GNUmake files and points to instructions for more advanced builds.
Downloading the source code
Clone the source codes of WarpX, and its dependencies AMReX and PICSAR into one
single directory (e.g.
mkdir warpx_directory cd warpx_directory git clone https://github.com/ECP-WarpX/WarpX.git git clone https://github.com/ECP-WarpX/picsar.git git clone https://github.com/ECP-WarpX/warpx-data.git git clone https://github.com/AMReX-Codes/amrex.git
The warpx-data repository is currently only needed for MCC cross-sections.
WarpX requires a C/C++ compiler (e.g., GNU, LLVM or Intel) and an MPI implementation (e.g., OpenMPI or MPICH).
Start a GNUmake build by
cd-ing into the directory
WarpX and type
make -j 4
This will generate an executable file in the
Compile-time vs. run-time options
WarpX has multiple compile-time and run-time options. The compilation
options are set in the file
GNUmakefile. The default
options correspond to an optimized code for 3D geometry. The main compile-time
2: Geometry of the simulation (note that running an executable compiled for 3D with a 2D input file will crash).
TRUE: Compiling in
DEBUGmode can help tremendously during code development.
TRUE: Compile the Pseudo-Spectral Analytical Time Domain Maxwell solver. Requires an FFT library.
TRUE: Compile for 2D axisymmetric geometry.
FALSE: Whether to compile with MPI support.
FALSE: Whether to compile with OpenMP support.
FALSE: Whether to compile for Nvidia GPUs (requires CUDA).
FALSE: Whether to support openPMD for I/O (requires openPMD-api).
FALSE: Whether to initialize MPI with thread multiple support. Required to use asynchronous IO with more than
amrex.async_out_nfiles(by default, 64) MPI tasks. Please see data formats for more information.
PRECISION=FLOAT USE_SINGLE_PRECISION_PARTICLES=TRUE: Switch from default double precision to single precision (experimental).
For a description of these different options, see the corresponding page in the AMReX documentation.
Alternatively, instead of modifying the file
GNUmakefile, you can directly pass the options in command line ; for instance:
make -j 4 USE_OMP=FALSE
In order to clean a previously compiled version (typically useful for troubleshooting, if you encounter unexpected compilation errors):
before re-attempting compilation.