nptool components are compiled and installed using the CMake build system, so be sure to have a working CMake installation before starting. The only dependencies of the nptool framework are the following executable: curl, cmake, make (or ninja) and git.

Most plugin are based on root at the moment. If ROOT is not installed the compilation can proceed but most plugin will not be available. ROOT 6 compiled with C++17 is required to install the root plugin.

NB: For this add the flag -DCMAKE_CXX_STANDARD=17 when compiling ROOT. If ROOT is compiled with another C++ standard, you will have errors, most likely about the string_view template.

In order to run simulation, a recent installation of Geant4 is needed. If you want to use GDML format in nptool, Geant4 should be installed with GDML support.

Getting the code

Using git

The recommended method to obtain the source code is to use git. This is an easy way to access the last version of the code. First make sure you have git installed. If not, use your package manager to get it. Then go to the directory where you want to install the nptool package and do:

git clone

This will create the nptool folder with the latest version of the nptool base framework. This framework contain all the base application and functionality, and will allow to install and managed the requested plugins (detectors, libraries,…).


Preparing the build

We recommand to use an nptool out of source build. You can choose where to put the build and install directory, in this manual we assume you will create them inside the nptool folder. We then run cmake to generate the build file

cd nptool
mkdir build install
cmake -B build -DCMAKE_INSTALL_PREFIX=install ./

If you are using google-ninja, you can add the -GNinja flag to the cmake command.

Compilation and installation

We can now run the compilation and installation of the framework, using the appropriate command with your generator:

make -C build install

The framework is now compiled and installed inside the install directory.

Environment setup

By sourcing all the necessary environment variable will be created.

NB: this source should not happen within the nptool folder.

source <path_to_nptool>/install/bin/

This command could be add to your .bashrc:

source <path_to_nptool>/nptool/install/bin/

You now need to create an environment folder where nptool can install the requested plugin, in this case we will create the default environment:

nptool --new-env default

This will create the new folder ~/.local/nptool/default and populate it with the necessary folder and files. All installation of new plugin will happen in this folder.