pymake.pymake_build_apps module#

Build MODFLOW-based models and other utility software.

Targets are defined in the usgsprograms database (usgsprograms.toml), which can be queried using functions in the usgsprograms module. An example of using pymake.build_apps() to build MODFLOW 6 is:

import pymake
pymake.build_apps(["mf6",])

which will download the latest MODFLOW 6 software release, compile the code, and delete the downloaded files after successfully building the application. Multiple applications can be built by adding additional targets to the tuple in pymake.build_apps(). For example, MODFLOW 6 and MODFLOW-2005 could be built by specifying:

import pymake
pymake.build_apps(["mf6","mf2005"]))

Applications are built in the order they are listed in the list. All valid USGS applications are built if no list is passed to pymake.build_apps().

build_apps(targets=None, pymake_object=None, download_dir=None, appdir=None, verbose=None, double=False, mesondir=None, exclude=None, clean=True)[source]#

Build all of the current targets or a subset of targets.

Parameters:
  • targets (str or list of str) – targets to build. If targets is None, all current targets will be built. Default is None

  • pymake_object (Pymake()) – Pymake object created outside of build_apps

  • download_dir (str) – download directory path

  • appdir (str) – target path

  • double (bool) – force double precision. (default is False)

  • mesondir (str) – Main meson.build file path. the directory a target is downloaded to is used when mesondir is None (default is None)

  • exclude (str or list of str) – list of targets to exclude from build

  • clean (bool) – boolean determining of final download should be removed

Returns:

returncode – integer value indicating successful completion (0) or failure (>0)

Return type:

int