fre.make.create_makefile_script module
For a bare-metal build:
Create the Makefile used for model compilation in the
[modelRoot]/[experiment name]/[platform]-[target]/exec
folder.
For a container build:
Create the Makefile used for model compilation in the
./tmp/[platform] directory.
modelRootis defined in the platforms.yamlexperiment nameis defined in compile.yamlplatformandtargetare passed via Click options
The Makefile
Sets the
SRCROOTSets the
BUILDROOTSets the
MK_TEMPLATE_PATHThis path is defined in the platforms.yaml and refers to a template in the mkmf repository.
Sets the build and linking recipes that adhere to the following structure:
[target]: [prerequisites] [recipe]
For more information about the Makefile, see the fre-cli glossary: https://github.com/NOAA-GFDL/fre-cli/blob/main/docs/glossary.rst
- fre.make.create_makefile_script.makefile_create(yamlfile: str, platform: tuple[str], target: tuple[str])
This function makefile_create generates the top level Makefile for the source code that is specified in the model compile YAML file.
- Parameters:
yamlfile (str) – Model compile YAML file
platform (tuple of strings) – FRE platforms that are defined in the platforms.yaml
target (tuple of strings) – Predefined FRE targets
- Raises:
ValueError – Error if platform does not exist in platforms yaml configuration
Note
If additional library dependencies are defined in the compile.yaml file:
For a container build, where library dependencies are defined via the “container_addlibs” key in the compile.yaml, a linkline.sh script will be generated to determine paths for the additional -L/[path to libraries] and -l[library name] located inside the container to the Makefile.
Example: container_addlibs: [‘darcy’]
For a bare-metal build, library flags, -L/[path to libraries] and -l[library name], are defined via the “baremetal_linkerflags” key in the compile.yaml and added to the link line in the Makefile.
Example: baremetal_linkerflags: [“-L/derbyshire/pemberly -ldarcy”]