fre.make.run_fremake_script module
run_fremake_script contains the main orchestration function, fremake_run, that executes all fre make sub-commands in the correct order to compile the model src code into an executable. fremake_run is the entry point called by fre make all.
For bare-metal platforms, fremake_run calls:
checkout_create — writes and optionally executes checkout.sh to clone all source repositories into [modelRoot]/[experiment]/src/
makefile_create — writes the root Makefile into [modelRoot]/[experiment]/[platform]-[target]/exec/
compile_create — writes compile.sh to the [modelRoot]/[experiment]/[platform]-[target]/exec/ and optionally executes the script
For container platforms, fremake_run calls: 1. checkout_create — writes and stages checkout.sh under tmp/[platform]/ 2. makefile_create — writes and stages the Makefile under tmp/[platform]/ 3. dockerfile_create — writes the Dockerfile and createContainer.sh,
and, if –execute is set, runs the build script to produce a Singularity image file (.sif).
- fre.make.run_fremake_script.fremake_run(yamlfile: str, platform: str, target: str, nparallel: int = 1, makejobs: int = 4, gitjobs: int = 4, no_parallel_checkout: bool | None = None, no_format_transfer: bool | None = False, execute: bool | None = False, verbose: bool | None = None, force_checkout: bool | None = False)
fremake_run runs all fre make sub-commands in sequence to produce a model executable (bare-metal) or a container image.
- Parameters:
yamlfile (str) – is the path to the model YAML file (e.g. am5.yaml).
platform (tuple[str]) – is one or more FRE platform strings as defined in platforms.yaml (e.g. ncrc5.intel23).
target (tuple[str]) – is one or more mkmf target strings (e.g. debug-openmp, repro-openmp, prod-openmp).
nparallel (int) – is the number of compile.sh scripts to execute concurrently when execute is True (bare-metal only). Defaults to 1.
makejobs (int) – is the number of Makefile recipes to run simultaneously, passed to make -j. Defaults to 4.
gitjobs (int) – is the number of git submodules to clone simultaneously, passed to git clone –jobs inside checkout.sh. Defaults to 4.
no_parallel_checkout (bool, optional) – is a flag where if True, clone source repositories sequentially Defaults to False to enable parallel checkout for bare-metal builds. Only sequential checkouts are available for container builds.
no_format_transfer (bool, optional) – is a flag where if True, skip the Docker-to-Singularity (.sif) format conversion in createContainer.sh. Defaults to False.
execute (bool, optional) – is a flag where if True, execute checkout.sh and compile.sh (bare-metal) or createContainer.sh (container) immediately after generation. Defaults to False.
verbose (bool, optional) – is a flag where if True, set logger level to DEBUG for detailed output. Defaults to False and sets logger level to INFO.
force_checkout (bool, optional) – is a flag where if True, for bare-metal: rename existing compile.sh before regenerating. For container: remove the existing Dockerfile before regenerating. Defaults to False.
- Raises:
ValueError – If a specified platform does not exist in platforms.yaml.