pymake.pymake_build_apps module#

Function to build MODFLOW-based models and other utility software based on targets defined in the usgsprograms database (usgsprograms.txt). The usgsprograms database 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, meson=False, mesondir='.', 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)

  • meson (bool) – boolean indicating that the executable should be built using the meson build system. (default is False)

  • mesondir (str) – Main meson.build file path

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

Returns:

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

Return type:

int