Installation
There are three ways to install ForeFire. Which one you want depends on what you intend to do with it:
Method |
Use it when |
Section |
|---|---|---|
pip |
You want to run simulations or drive ForeFire from Python. |
|
Docker |
You are on Windows, or you want the web console with no setup. |
|
From source |
You need MPI coupling with Meso-NH, a CPU-tuned build, or you are working on ForeFire itself. |
Install with pip
This is the fastest route, and it needs no compiler, no CMake and no NetCDF installation of your own — NetCDF is bundled inside the wheel.
pip install forefire
Requirements
CPython 3.9 to 3.14. The free-threaded builds (
cp314t) are deliberately not published: the C++ core still keeps mutable global state, so a wheel advertising free-threading would silently re-enable the GIL on import.Linux on
x86_64oraarch64(manylinux_2_28or newer), or macOS 14+ on Apple Silicon.
There is no wheel for Intel macOS, musl-based Linux (Alpine), 32-bit targets, Windows or PyPy. On those platforms pip falls back to the source distribution, which needs the build prerequisites in Build from source. Windows users are better served by Docker — see Quick Start.
What you get
Both interfaces, from the one package:
forefire -v
import pyforefire as forefire
ff = forefire.ForeFire()
ff.execute("FireDomain[sw=(0,0,0);ne=(10000,10000,0);t=0]")
ff.addLayer("propagation", "Iso", "propagationModel")
ff.execute("startFire[loc=(5000,5000,0.0)]")
ff.execute("step[dt=1000]")
print(ff.execute("print[]"))
Note
The distribution on PyPI is called forefire; the importable module keeps
its historical name, pyforefire.
What you do not get
Published wheels are built with three options turned off, so a few things are only available in a source build:
MPI coupling. Fire-atmosphere runs with Meso-NH need
FOREFIRE_ENABLE_MPI, so they need a source build.CPU tuning. Wheels are built without
-march=native, so that they run on any machine of the right architecture. A source build withFOREFIRE_NATIVE_ARCH=ONwill be faster on the machine that built it.The
ANN_testhelper, built byFOREFIRE_BUILD_TOOLS.
Build from source
A native build, in exchange for managing the dependencies yourself. Two routes: the install script (Debian/Ubuntu only), or manual steps (any Unix-like system).
Prerequisites
A C++ compiler, such as
g++. On Debian/Ubuntu this comes withbuild-essential.CMake 3.15 or newer, and Make.
NetCDF — both the C library and the legacy C++4 API. The C++4 API is a separate package from the C library on every distribution, and it is the one people usually miss.
System
Packages
Debian/Ubuntu
apt install libnetcdf-dev libnetcdf-c++4-devFedora/RHEL
dnf install netcdf-devel netcdf-cxx4-develmacOS (Homebrew)
brew install netcdf netcdf-cxxThe library is named
netcdf_c++4everywhere except Homebrew, which calls itnetcdf-cxx4(netcdf-cxxin older bottles); CMake looks for all three. The olderlibnetcdf-cxx-legacy-devpackage is a different, pre-C++4 API and will not work.If NetCDF is installed somewhere CMake does not search, point at it with
-DNETCDF_HOME=/path/to/netcdf(and-DNETCDF_CXX_HOME=...if the C++ API lives elsewhere).
Option 1: the install script (Debian/Ubuntu)
install-forefire.sh automates the process on Debian-based systems.
Clone the repository:
git clone https://github.com/forefireAPI/forefire.git cd forefire
Run the install script:
Warning
This script requires
sudoprivileges to install system packages usingapt. Review the script if you have concerns.sudo bash install-forefire.sh
What the install script does:
Installs dependencies: runs
apt-get updateand installs the prerequisites listed above.Builds ForeFire using CMake and Make.
Reports the install location: usually
$PROJECT_ROOT/bin.(Optional) updates PATH:
Prompts you before doing anything, and only if you agree appends
export PATH=andexport FOREFIREHOME=lines to~/.bashrc.It detects the invoking user’s home directory even under
sudo, via$SUDO_USER.Note: this only modifies
.bashrc. Forzshorfish, configure the PATH manually (see below).
Option 2: manual build (any Linux/Unix-like system)
Use this if you are not on Debian/Ubuntu, prefer manual control, or do not want to run the install script.
Clone the repository:
git clone https://github.com/forefireAPI/forefire.git cd forefire
Install the prerequisites for your system, from the table above.
Configure and build:
cmake -S . -B build cmake --build build -jThe executable lands in
bin/forefire. Check it with:./bin/forefire -v
Build options
The build is driven by FOREFIRE_* CMake options; pass them at configure
time, for example cmake -S . -B build -DFOREFIRE_ENABLE_MPI=OFF.
Option |
Default |
Effect |
|---|---|---|
|
ON |
Fire-atmosphere coupling with Meso-NH, when MPI is found. Replaces the compiler with the MPI wrapper. |
|
ON |
|
|
OFF |
Build the |
|
OFF |
Link the core statically. |
|
ON |
Build the |
|
ON |
Fail early if the Git LFS test fixtures were not pulled. |
Wheel builds flip all six: MPI, native-arch, tools and the LFS check off, Python and the static core on. That is what makes a wheel run on a machine other than the one that built it.
Making ForeFire available system-wide
After a source build, forefire lives in the repository’s bin
directory. To run it from anywhere, add that directory to your PATH.
For the current terminal session:
# Execute this from the root of the forefire repository
export PATH=$PATH:`pwd`/bin
Permanently:
Add the following to your shell’s configuration file (~/.bashrc,
~/.zshrc, ~/.profile, or ~/.config/fish/config.fish), replacing
/path/to/forefire with the absolute path to the cloned repository.
export PATH="/path/to/forefire/bin:$PATH"
Optional: the install script also sets FOREFIREHOME, which some scripts
and components use to locate the repository.
export FOREFIREHOME="/path/to/forefire"
Then restart your terminal or reload the configuration, for example with
source ~/.bashrc.