.. _install-developers: .. _building-cmake: .. _building-cmake-intro: Developers ========== `CMake `_ is our primary build system. If you are new to CMake, `this short tutorial `_ from the HEP Software foundation is the perfect place to get started. If you just want to use CMake to build the project, jump into sections `1. Introduction `__, `2. Building with CMake `__ and `9. Finding Packages `__. Dependencies ------------ Before you start, you will need a copy of the WarpX source code: .. code-block:: bash git clone https://github.com/ECP-WarpX/WarpX.git $HOME/src/warpx cd $HOME/src/warpx WarpX depends on popular third party software. * On your development machine, :ref:`follow the instructions here `. * If you are on an HPC machine, :ref:`follow the instructions here `. .. toctree:: :hidden: dependencies Compile ------- From the base of the WarpX source directory, execute: .. code-block:: bash # find dependencies & configure # see additional options below, e.g. # -DWarpX_PYTHON=ON # -DCMAKE_INSTALL_PREFIX=$HOME/sw/warpx cmake -S . -B build # compile, here we use four threads cmake --build build -j 4 **That's it!** A 3D WarpX binary is now in ``build/bin/`` and :ref:`can be run ` with a :ref:`3D example inputs file `. Most people execute the binary directly or copy it out. If you want to install the executables in a programmatic way, run this: .. code-block:: bash # for default install paths, you will need administrator rights, e.g. with sudo: cmake --build build --target install You can inspect and modify build options after running ``cmake -S . -B build`` with either .. code-block:: bash ccmake build or by adding arguments with ``-D