Installation and building¶
Requirements¶
A C++17 compiler (GCC or Clang) with OpenMP support.
CMake ≥ 3.10.
Network access at configure time: the build automatically downloads several dependencies through CMake
FetchContent/ExternalProject.
Bundled / fetched dependencies¶
The CMakeLists.txt pulls in the following automatically:
Dependency |
Version |
Purpose |
|---|---|---|
4.0.2 |
Equilibrium gas-phase chemistry (built as |
|
pinned commit |
Mie theory for dust absorption/scattering efficiencies. |
|
3.4.0 (header-only) |
Dense linear algebra for the Henyey structure solver. |
|
3.4.0 (header-only) |
Parsing of the |
|
20250000.3 |
Automatic differentiation for the Henyey Jacobian. Built and installed
in isolation via |
FastChem internally uses Eigen, which leads to an important build constraint:
Warning
Do not add -march=native to the build flags. FastChem’s bundled
Eigen breaks (alignment / vectorisation faults) when compiled with it. The
Release configuration deliberately uses only -O3 -DNDEBUG -funroll-loops,
and -ffast-math is also omitted to keep the radiative-transfer results
bit-reproducible. If architecture-specific vectorisation is ever needed,
scope it to individual radiative-transfer translation units — never apply it
globally where FastChem/Eigen is compiled.
Building¶
The project follows the standard out-of-source CMake workflow:
$ mkdir build
$ cd build
$ cmake ..
$ make -j
The first cmake .. will clone and build FastChem, LX-MIE, Eigen, toml++ and
CppAD; subsequent builds reuse them. The executable is written into the
source directory as agb_wind (the CMake RUNTIME_OUTPUT_DIRECTORY is
set to the source tree, and the runtime RPATH is pointed at
cppad-install/lib so the loader finds libcppad_lib.so).
The default and only configured build type is Release.
Self-test¶
A built-in self-test validates the Henyey structure solver’s automatic- differentiation Jacobian and Newton/eigenvalue machinery without needing a full model:
$ ./agb_wind --selftest
This checks the analytic (CppAD) Jacobian against central finite differences for
the Φ equation, the coupled Φ``+dust-moment system and the mass-loss
eigenvalue row, runs a transonic eigenvalue solve, and exercises the grey
(Lucy) bootstrap. It exits ``0 on success.
Running a model¶
Pass the path to a model folder (containing a config.toml) as the single
command-line argument:
$ ./agb_wind IRC10216/
See Running a model for the directory layout and Configuration (config.toml) for the full configuration reference.