Dependencies
ImpactX depends on the following popular third party software. Please see installation instructions below.
a mature C++17 compiler, e.g., GCC 7, Clang 7, NVCC 11.0, MSVC 19.15 or newer
AMReX: we automatically download and compile a copy
WarpX: we automatically download and compile a copy
Optional dependencies include:
MPI 3.0+: for multi-node and/or multi-GPU execution
CUDA Toolkit 11.0+: for Nvidia GPU support (see matching host-compilers)
OpenMP 3.1+: for threaded CPU execution
FFTW3: for spectral solver support
openPMD-api 0.14.2+: we automatically download and compile a copy of openPMD-api for openPMD I/O support
CCache: to speed up rebuilds (needs 3.7.9+ for CUDA)
Ninja: for faster parallel compiles
Install
Pick one of the installation methods below to install all dependencies for ImpactX development in a consistent manner.
Conda (Linux/macOS/Windows)
With MPI (only Linux/macOS):
conda create -n impactx-dev -c conda-forge ccache cmake compilers git "openpmd-api=*=mpi_mpich*" python mpich numpy scipy yt "fftw=*=mpi_mpich*" matplotlib mamba ninja numpy pandas pytest scipy
conda activate impactx-dev
Without MPI:
conda create -n impactx-nompi-dev -c conda-forge ccache cmake compilers git openpmd-api python numpy scipy yt fftw matplotlib mamba ninja numpy pandas scipy
conda activate impactx-nompi-dev
# compile ImpactX with -DImpactX_MPI=OFF
Note
A general option to deactivate that conda self-activates its base environment. This avoids interference with the system and other package managers.
conda config --set auto_activate_base false
Spack (macOS/Linux)
spack env create impactx-dev
spack env activate impactx-dev
spack add adios2 # for openPMD
spack add ccache
spack add cmake
spack add fftw
spack add hdf5 # for openPMD
spack add mpi
spack add pkgconfig # for fftw
spack add python
spack add py-pip
spack add py-setuptools
spack add py-wheel
# OpenMP support on macOS
[[ $OSTYPE == 'darwin'* ]] && spack add llvm-openmp
# optional: Linux only
#spack add cuda
spack install
python3 -m pip install matplotlib numpy openpmd-api pandas pytest scipy
In new terminals, re-activate the environment with spack env activate impactx-dev
again.
Brew (macOS/Linux)
brew update
brew install adios2 # for openPMD
brew install ccache
brew install cmake
brew install fftw
brew install git
brew install hdf5-mpi # for openPMD
brew install libomp # for OpenMP
brew install pkg-config # for fftw
brew install open-mpi
brew install python
python3 -m pip install matplotlib yt scipy numpy openpmd-api
Apt (Debian/Ubuntu)
sudo apt update
sudo apt install build-essential ccache cmake g++ git libfftw3-mpi-dev libfftw3-dev libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-pandas python3-scipy