fre.make.create_compile_script module

Retrieves information from the resolved YAML configuration to generate the compile.sh in the [modelRoot]/[experiment name]/[platform-target]/exec directory, where

  • modelRoot is defined in the platforms.yaml

  • experiment name is defined in compile.yaml

  • platform and target are passed via Click options

The compile.sh script

  1. Sets the src_dir

  2. Sets the bld_dir

  3. Sets the mkmf_template

  4. Loads/unloads modules to set-up the compile environment

  5. Calls mkmf to generate Makefiles for each model component defined in the compile.yaml

  6. Calls make to generate the model executable

fre.make.create_compile_script.compile_create(yamlfile: str, platform: tuple[str], target: tuple[str], makejobs: int = 4, nparallel: int = 1, execute: bool | None = False, verbose: bool | None = None)

This function compile_create generates the compile script for bare-metal build.

Parameters:
  • yamlfile (str) – Model compile YAML file

  • platform (tuple of strings) – FRE platform; defined in the platforms yaml

  • target (tuple of strings) – Predefined FRE targets

  • makejobs (int) – Number of recipes from the Makefile to run in parallel (default 4); corresponds to -j option in make

  • nparallel (int) – Number of compile.sh scripts to run in parallel (default 1)

  • execute (bool) – If True, execute the created compile.sh script to build a model executable

  • verbose (bool) – If True, increase verbosity output

Raises:

ValueError

  • Error if platform does not exist in platforms yaml configuration

  • Error if the mkmf template defined in platforms yaml does not exist