Building WarpX with Spack

As mentioned in the install section, WarpX can be installed using Spack. From the Spack web page: “Spack is a package management tool designed to support multiple versions and configurations of software on a wide variety of platforms and environments.”

Note

Quick-start hint for macOS users: Before getting started with Spack, please check what you manually installed in /usr/local. If you find entries in bin/, lib/ et al. that look like you manually installed MPI, HDF5 or other software at some point, then remove those files first.

If you find software such as MPI in the same directories that are shown as symbolic links then it is likely you brew installed software before. Run brew unlink … on such packages first to avoid software incompatibilities.

Spack is available from github. Spack only needs to be cloned and can be used right away - there are no installation steps. You can add binary caches for faster builds:

spack mirror add rolling https://binaries.spack.io/develop
spack buildcache keys --install --trust

Do not miss out on the official Spack tutorial if you are new to Spack.

The spack command, spack/bin/spack, can be used directly or spack/bin can be added to your PATH environment variable.

WarpX is built with the single command

spack install warpx

This will build the 3-D version of WarpX using the development branch. At the very end of the output from build sequence, Spack tells you where the WarpX executable has been placed. Alternatively, spack load warpx can be called, which will put the executable in your PATH environment variable.

WarpX can be built in several variants, see

spack info warpx
spack info py-warpx

for all available options.

For example

spack install warpx dims=2 build_type=Debug

will build the 2-D version and also turns debugging on.

See spack help --spec for all syntax details. Also, please consult the basic usage section of the Spack package manager for an extended introduction to Spack.

The Python version of WarpX is available through the py-warpx package.