This is the easiest way to get NextGenPB running on your computer.
Quick Start Options
🏃 Very Impatient? Use a Precompiled Apptainer Image
If you’re eager to run simulations without compiling anything, use the ready-made .sif container image.
Prerequisite
- Install Apptainer (formerly Singularity):
https://apptainer.org/docs/
Download the image
You can download the generic image using the following command:
wget https://github.com/concept-lab/NextGenPB/releases/download/NextGenPB_v1.0.0/NextGenPB.sif
If you know the architecture of the machine where the container will run, you can download the image built specifically for that architecture. See the Downloads page for available versions.
➡️ Go to Running NextGenPB for execution details using the container.
🚶♂️ Prefer Customization? Build the Docker or Apptainer Image Yourself
This option is for advanced users who want to customize compiler flags, link libraries differently, or tweak performance settings.
Build the Docker image (if root access available)
sudo docker build -f Dockerfile -t <name_of_image>:latest .
To run the Docker image:
sudo docker run -v "$(pwd)":/App -w /App <name_of_image>:latest mpirun -np <number_of_processors> ngpb --prmfile options.prm
Build the Apptainer image (if root access available)
sudo apptainer build NextGenPB.sif recipe.def
To run the Apptainer image:
apptainer exec --pwd /App --bind /path/to/files/:/App /path/to/sif/NextGenPB.sif mpirun -np <number_of_processors> ngpb --prmfile options.prm
➡️ See the Running NextGenPB guide for execution details using the container.
Optimize for your hardware — native build
By default, both images are compiled with generic flags (-O2 -mtune=generic) for maximum portability.
If you are building on the same machine where the container will run, you can enable native CPU optimizations at build time.
Apptainer — pass NATIVE=true via --build-arg:
sudo apptainer build --build-arg NATIVE=true NextGenPB_native.sif recipe.def
Docker — pass the compiler flags directly via --build-arg:
sudo docker build --build-arg CFLAGS="-Ofast -mtune=native -march=native" -f Dockerfile -t <name_of_image>:latest .
A natively compiled image is not portable — it may crash or produce incorrect results on machines with a different CPU architecture.
Customize compiling flags to performance
✅ You’re now ready to run simulations with NextGenPB!
➡️ Go to running section to learn out to run the solver.