.. _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 ImpactX source code: .. code-block:: bash git clone https://github.com/BLAST-ImpactX/impactx.git $HOME/src/impactx cd $HOME/src/impact ImpactX 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 .. note:: Preparation: make sure you work with up-to-date Python tooling. .. code-block:: bash python3 -m pip install -U pip python3 -m pip install -U build packaging setuptools[core] wheel pytest pytest-benchmark python3 -m pip install -U -r examples/requirements.txt Compile ------- From the base of the ImpactX source directory, execute: .. code-block:: bash # find dependencies & configure # see additional options below, e.g. # -DCMAKE_INSTALL_PREFIX=$HOME/sw/impactX cmake -S . -B build -DImpactX_PYTHON=ON # compile, here we use four threads cmake --build build -j 4 That's all! ImpactX binaries are now in ``build/bin/``. Most people execute these binaries directly or copy them 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: # this installs the application cmake --build build --target install # this installs the Python bindings via "python3 -m pip install ..." cmake --build build --target pip_install -j 4 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