.. _install-dependencies: Dependencies ============ pyAMReX depends on the following popular third party software. Please see installation instructions below. - a mature `C++17 `__ compiler, e.g., GCC 8.4+, Clang 7, NVCC 11.0, MSVC 19.15 or newer - `CMake 3.24.0+ `__ - `Git 2.18+ `__ - `AMReX `__: we automatically download and compile a copy - `pybind11 3.0.0+ `__: we automatically download and compile a copy - `Python 3.9+ `__ - `numpy 1.15+ `__ Optional dependencies include: - `MPI 3.0+ `__: for multi-node and/or multi-GPU execution - for on-node accelerated compute *one of either*: - `OpenMP 3.1+ `__: for threaded CPU execution or - `CUDA Toolkit 11.0+ (11.3+ recommended) `__: for Nvidia GPU support (see `matching host-compilers `_) or - `ROCm 5.2+ (5.5+ recommended) `__: for AMD GPU support - `CCache `__: to speed up rebuilds (For CUDA support, needs version 3.7.9+ and 4.2+ is recommended) - `Ninja `__: for faster parallel compiles - further `optional dependencies of AMReX `__ - `Python dependencies `__ - `mpi4py 2.1+ `__: for multi-node and/or multi-GPU execution - `cupy 11.2+ `__ - `numba 0.56+ `__ - `pandas 2+ `__: for DataFrame support - `torch 1.12+ `__ For all other systems, we recommend to use a **package dependency manager**: Pick *one* of the installation methods below to install all dependencies for pyAMReX development in a consistent manner. Conda (Linux/macOS/Windows) --------------------------- `Conda `__/`Mamba `__ are cross-compatible, user-level package managers. .. tip:: We recommend to configure your conda to use the faster ``libmamba`` `dependency solver `__. .. code-block:: bash conda update -n base conda conda install -n base conda-libmamba-solver conda config --set solver libmamba We recommend to deactivate that conda self-activates its ``base`` environment. This `avoids interference with the system and other package managers `__. .. code-block:: bash conda config --set auto_activate_base false .. tab-set:: .. tab-item:: With MPI (only Linux/macOS) .. code-block:: bash conda create -n pyamrex-cpu-mpich-dev -c conda-forge boost ccache cmake compilers git python numpy pandas scipy yt pkg-config make matplotlib mamba ninja mpich pip virtualenv conda activate pyamrex-cpu-mpich-dev # compile pyAMReX with -DAMReX_MPI=ON # for pip, use: export AMREX_MPI=ON .. tab-item:: Without MPI .. code-block:: bash conda create -n pyamrex-cpu-dev -c conda-forge boost ccache cmake compilers git python numpy pandas scipy yt pkg-config make matplotlib mamba ninja pip virtualenv conda activate pyamrex-cpu-dev # compile pyAMReX with -DAMReX_MPI=OFF # for pip, use: export AMREX_MPI=OFF For OpenMP support, you will further need: .. tab-set:: .. tab-item:: Linux .. code-block:: bash conda install -c conda-forge libgomp .. tab-item:: macOS or Windows .. code-block:: bash conda install -c conda-forge llvm-openmp For Nvidia CUDA GPU support, you will need to have `a recent CUDA driver installed `__ or you can lower the CUDA version of `the Nvidia cuda package `__ and `conda-forge to match your drivers `__ and then add these packages: .. code-block:: bash conda install -c nvidia -c conda-forge cuda cupy More info for `CUDA-enabled ML packages `__. Spack (Linux/macOS) ------------------- `Spack `__ is a user-level package manager. It is primarily written for Linux, with slightly less support for macOS, and future support for Windows. Please see `WarpX for now `__. Brew (macOS/Linux) ------------------ `Homebrew (Brew) `__ is a user-level package manager primarily for `Apple macOS `__, but also supports Linux. .. code-block:: bash brew update brew tap openpmd/openpmd brew install ccache brew install cmake brew install git brew install libomp brew unlink gcc brew link --force libomp brew install open-mpi If you also want to compile with PSATD in RZ, you need to manually install BLAS++ and LAPACK++: .. code-block:: bash sudo mkdir -p /usr/local/bin/ sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall sudo chmod a+x /usr/local/bin/cmake-easyinstall cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/blaspp.git \ -Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/lapackpp.git \ -Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON Compile pyAMReX with ``-DAMReX_MPI=ON``. For ``pip``, use ``export AMREX_MPI=ON``. APT (Debian/Ubuntu Linux) ------------------------- The `Advanced Package Tool (APT) `__ is a system-level package manager on Debian-based Linux distributions, including Ubuntu. .. tab-set:: .. tab-item:: With MPI (only Linux/macOS) .. code-block:: bash sudo apt update sudo apt install build-essential ccache cmake g++ git libhdf5-openmpi-dev libopenmpi-dev pkg-config python3 python3-matplotlib python3-numpy python3-pandas python3-pip python3-scipy python3-venv # optional: # for CUDA, either install # https://developer.nvidia.com/cuda-downloads (preferred) # or, if your Debian/Ubuntu is new enough, use the packages # sudo apt install nvidia-cuda-dev libcub-dev # compile pyAMReX with -DAMReX_MPI=ON # for pip, use: export AMREX_MPI=ON .. tab-item:: Without MPI .. code-block:: bash sudo apt update sudo apt install build-essential ccache cmake g++ git libhdf5-dev pkg-config python3 python3-matplotlib python3-numpy python3-pandas python3-pip python3-scipy python3-venv # optional: # for CUDA, either install # https://developer.nvidia.com/cuda-downloads (preferred) # or, if your Debian/Ubuntu is new enough, use the packages # sudo apt install nvidia-cuda-dev libcub-dev # compile pyAMReX with -DAMReX_MPI=OFF # for pip, use: export AMREX_MPI=OFF