Convenience repository holding the shared Fortran utility library and the external libraries needed to run fast Earth system models, like CLIMBER-X and yelmox.
The repository bundles the FESM utility library together with three vendored
external libraries, each in its own folder holding the upstream source plus the
compiled serial / omp install prefixes:
fesm-utils/
fftw/ fftw-3.3.10/ fftw-serial/ fftw-omp/ # FFTW (autotools)
lis/ lis-2.1.11/ lis-serial/ lis-omp/ # LIS solver (autotools)
SHTns/ shtns-3.7.5/ shtns-serial/ shtns-omp/ # SHTns (autotools)
src/ test/ include-serial/ include-omp/ ... # the utils library
config/ Makefile common.mk libs.mk legacy/ # build configuration
Makefile # generated by configme
- utils (
src/, compiled intoinclude-{serial,omp}/libfesmutils.a) — a self-contained collection of Fortran modules (coordinates, mapping, ncio, …). - fftw, lis, SHTns — vendored upstream libraries, each built by its
own autotools
configure/make/make installinto<lib>/<lib>-{serial,omp}.
Everything is driven from a single root Makefile, generated per machine by
configme. A serial and an OpenMP variant
coexist side by side; pick one with openmp=0 (default) or openmp=1.
configme is the single source of machine/compiler truth (Fortran flags,
netCDF autodetection). It generates the root Makefile from the tracked
template config/Makefile:
configme install fesm-utils -m macbook -c gfortran # clone + configure + build
# or, in an existing checkout, just (re)generate the Makefile:
configme config fesm-utils -m macbook -c gfortranOne consistent interface for everything, selecting the variant with openmp=:
make fftw openmp=0 # build serial FFTW -> fftw/fftw-serial
make lis openmp=1 # build OpenMP LIS -> lis/lis-omp
make shtns openmp=0 # build serial SHTns -> SHTns/shtns-serial
make libs openmp=0 # fftw + lis + shtns, one variant
make fesmutils-static openmp=0 # build the utils library (libfesmutils.a)
make usage # list the main targetsNotes:
- Build the external libraries serially (a one-time autotools build — do not
pass
-jtomake libs). SHTns links the FFTW built here, sofftwmust be installed beforeshtns. - On clusters,
module loadyour compiler + netCDF toolchain first — the library builds and netCDF autodetection use the environment already loaded in your shell.
Two kinds of build config, both selected by machine/compiler:
- Fortran + netCDF (for the utils library) — lives in
configme's machine/compiler fragments and is auto-detected (nf-config/nc-config).configmebakes it into the generatedMakefile. - C-library autotools quirks (for fftw/lis/shtns) — live in
config/libs.mk, keyed on$(MACHINE)/$(COMPILER)(whichconfigmewrites into the Makefile). This one file is the home for every autotools quirk: the macOS Homebrew-gcc pick, the autoconf C-standard pins, the Intel runtime-lib fix, and the SHTns kernel-compiler /-marchhandling. To support a new machine, add a block there and aconfigmefragment for the Fortran side.
Override either on the command line for a one-off:
make fftw openmp=1 MACHINE=dkrz_levante COMPILER=ifxThe utils library can still be configured the old way — a template + a
per-host fragment under config/legacy/:
python config.py config/legacy/macbook_gfortran # writes ./Makefile
make clean
make fesmutils-static openmp=0A symlink can be made to this repository for use within, e.g., CLIMBER-X:
cd climber-x/
ln -s /path/to/fesm-utils ./Downstream builds reference the install prefixes directly, e.g.
fesm-utils/include-serial (utils), fesm-utils/fftw/fftw-serial,
fesm-utils/lis/lis-serial, fesm-utils/SHTns/shtns-serial.
Mainly relevant for maintainers, or to try a different upstream version. Unpack
the source into the matching container folder (fftw/, lis/, SHTns/):
### FFTW
wget https://www.fftw.org/fftw-3.3.10.tar.gz
tar -xvf fftw-3.3.10.tar.gz -C fftw/
rm fftw-3.3.10.tar.gz
### LIS
wget https://www.ssisc.org/lis/dl/lis-2.1.11.zip
unzip lis-2.1.11.zip -d lis/
rm lis-2.1.11.zipThen build with make as described above.