Name | mfpymake JSON |
Version |
1.2.10
JSON |
| download |
home_page | None |
Summary | pymake is a Python package to compile MODFLOW-based models. |
upload_time | 2024-06-17 22:22:34 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | CC0 |
keywords |
modflow
groundwater
hydrogeology
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pymake
Python package for building MODFLOW-based programs from source files.
### Version 1.2.10
[![PyPI Version](https://img.shields.io/pypi/v/mfpymake.png)](https://pypi.python.org/pypi/mfpymake)
[![Anaconda Version](https://anaconda.org/conda-forge/mfpymake/badges/version.svg)](https://anaconda.org/conda-forge/mfpymake)
[![pymake continuous integration](https://github.com/modflowpy/pymake/workflows/pymake%20continuous%20integration/badge.svg)](https://github.com/modflowpy/pymake/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/modflowpy/pymake/branch/master/graph/badge.svg)](https://codecov.io/gh/modflowpy/pymake)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/fe4275a3cfb84acf9c84aba7b4ae2086)](https://www.codacy.com/gh/modflowpy/pymake/dashboard?utm_source=github.com&utm_medium=referral&utm_content=modflowpy/pymake&utm_campaign=Badge_Grade)
[![Documentation Status](https://readthedocs.org/projects/mfpymake/badge/?version=latest)](https://mfpymake.readthedocs.io/en/latest/?badge=latest)
This is a python package for compiling MODFLOW-based and other Fortran, C, and
C++ programs. The package determines the build order using a directed acyclic
graph and then compiles the source files using GNU compilers (`gcc`, `g++`,
`gfortran`), Clang compilers (`clang`, `clang++`), or the Intel compilers (`ifort`,
`icl`, `icc`, `mpiifort`).
pymake can be run from the command line or it can be called from within python.
By default, pymake sets the optimization level, Fortran flags, C/C++ flags, and
linker flags that are consistent with those used to compile MODFLOW-based
programs released by the USGS.
Note that if gfortran is used to compile MODFLOW-based codes, the `openspec.f`
and `FILESPEC.inc` (MT3DMS) files will automatically be changed to the
following so that binary files are created properly using standard Fortran:
```
c -- created by pymake.py
CHARACTER*20 ACCESS,FORM,ACTION(2)
DATA ACCESS/'STREAM'/
DATA FORM/'UNFORMATTED'/
DATA (ACTION(I),I=1,2)/'READ','READWRITE'/
c -- end of include file
```
## Command Line Usage
When pymake is installed, a `mfpymake` (or `mfpymake.exe` for Windows) program is installed.`mfpymake` can be used to
compile MODFLOW 6 from source files located on your computer directly from the command line using
the Intel Fortran compiler `ifort` from the root directory containing the `src` subdirectory by specifying:
```
mfpymake src/ mf6 -mc --subdirs -fc ifort
```
To see help for running from command line, use the following statement.
```
mfpymake -h
```
The help message identifies required positional arguments and optional arguments that can be provided to override
default values.
```
usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS]
[-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--meson] [--mesondir]
srcdir target
This is the pymake program for compiling fortran, c, and c++ source
files, such as the source files that come with MODFLOW. The program
works by building a directed acyclic graph of the module dependencies
and then compiling the source files in the proper order.
positional arguments:
srcdir Path source directory.
target Name of target to create. (can include path)
options:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
C/C++ compiler to use. (default is gcc)
-ar {ia32,ia32_intel64,intel64}, --arch {ia32,ia32_intel64,intel64}
Architecture to use for Intel and Microsoft compilers on Windows. (default is intel64)
-mc, --makeclean Clean temporary object, module, and source files when done. (default is False)
-dbl, --double Force double precision. (default is False)
-dbg, --debug Create debug version. (default is False)
-e, --expedite Only compile out of date source files. Clean must not have been used on previous build. (default is False)
-dr, --dryrun Do not actually compile. Files will be deleted, if --makeclean is used. Does not work yet for ifort. (default is False)
-sd, --subdirs Include source files in srcdir subdirectories. (default is None)
-ff FFLAGS, --fflags FFLAGS
Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal sign
(-ff='-O3'). (default is None)
-cf CFLAGS, --cflags CFLAGS
Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign
(-cf='-O3'). (default is None)
-sl {-lc,-lm}, --syslibs {-lc,-lm}
Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign (-sl='-libgcc').
(default is None)
-mf, --makefile Create a GNU make makefile. (default is False)
-md, --makefiledir GNU make makefile directory. (default is '.')
-cs COMMONSRC, --commonsrc COMMONSRC
Additional directory with common source files. (default is None)
-ef EXTRAFILES, --extrafiles EXTRAFILES
List of extra source files to include in the compilation. extrafiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-exf EXCLUDEFILES, --excludefiles EXCLUDEFILES
List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-so, --sharedobject Create shared object or dll on Windows. (default is False)
-ad APPDIR, --appdir APPDIR
Target path that overides path defined target path (default is None)
-v, --verbose Verbose output to terminal. (default is False)
--keep Keep existing executable. (default is False)
--zip ZIP Zip built executable. (default is None)
--inplace Source files in srcdir are used directly. (default is False)
--networkx Use networkx package to build Directed Acyclic Graph use to determine the order source files are compiled in. (default is False)
--meson Use meson to build executable. (default is False)
--mesondir meson directory. (default is '.')
Note that the source directory should not contain any bad
or duplicate source files as all source files in the source
directory, the common source file directory (srcdir2), and
the extra files (extrafiles) will be built and linked.
Files can be excluded by using the excludefiles command
line switch.
Examples:
Compile MODFLOW 6 from the root directory containing the
source files in subdirectories in the src/ subdirectory:
$ mfpymake src/ mf6 --subdirs
Compile MODFLOW 6 in the bin subdirectory using the Intel
Fortran compiler from the root directory containing the source
files in subdirectories in the the src/ subdirectory:
$ mfpymake src/ mf6 --subdirs -fc ifort --appdir bin
```
Note that command line arguments for Fortran flags, C/C++ flags, and syslib libraries should be enclosed in quotes and
start with a space prior to the first value (`-ff ' -O3'`) or use an equal sign separating the command line argument and
the values (`-ff='-O3'`). The command line argument to use an `-O3` optimization level when compiling MODFLOW 6 with
the `ifort` compiler would be:
```
mfpymake src/ mf6 -mc --subdirs -fc ifort -ff='-O3'
```
## From Python
### Script to compile MODFLOW 6
When using the pymake object (`Pymake()`) only the positional arguments
(`srcdir`, `target`) need to be specified in the script.
```python
import pymake
pm = pymake.Pymake()
pm.srcdir = '../src'
pm.target = 'mf6'
pm.include_subdirs = True
pm.build()
```
It is suggested that optional variables required for successful compiling and linking be manually specified in the
script to mininimize the potential for unsuccessful builds. For MODFLOW 6, subdirectories in the `src` subdirectory need
to be included and '`pm.include_subdirs = True`' has been specified in the script. Custom optimization levels and
compiler flags could be specified to get consistent builds.
Non-default values for the optional arguments can specified as command line arguments. For example, MODFLOW 6 could be
compiled using Intel compilers instead of the default GNU compilers with the script listed above by specifying:
```
python mymf6script.py -fc ifort -cc icc
```
## Automatic Download and Build
When pymake is installed, a `make-program` (or `make-program.exe` for Windows) program is installed. `make-program` can
be used to build MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, MODFLOW-LGR, MODFLOW-2000, MODPATH 6, MODPATH 7,
GSFLOW, VS2DT, MT3DMS, MT3D-USGS, SEAWAT, and SUTRA. Utility programs CRT, Triangle, and GRIDGEN can also
be built. `make-program` downloads the distribution file (requires an internet connection), unzips the file, sets the
pymake settings required to build the program, and compiles the program from the source files. Optional pymake command
line arguments can be used to customize the build (`-fc`, `-cc`, `--fflags`, etc.). For example, MODFLOW 6 could be
built using intel compilers and an `O3` optimization level by specifying:
```
make-program mf6 -fc=ifort --fflags='-O3'
```
See [pymake Read the Docs](https://mfpymake.readthedocs.io/en/1.2.4/build_apps.html#building-applications) for more
information.
## Installation
To install pymake using pip type:
```
pip install mfpymake
```
To install pymake using conda type:
```
conda install -c conda-forge mfpymake
```
To install the latest pymake release directly from the git repository type:
```
pip install https://github.com/modflowpy/pymake/zipball/master
```
To update your version of pymake with the latest development version from the git repository type:
```
pip install https://github.com/modflowpy/pymake/zipball/develop --upgrade
```
Raw data
{
"_id": null,
"home_page": null,
"name": "mfpymake",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "\"Joseph D. Hughes\" <jdhughes@usgs.gov>",
"keywords": "MODFLOW, groundwater, hydrogeology",
"author": null,
"author_email": "mfpymake Team <modflow@usgs.gov>",
"download_url": "https://files.pythonhosted.org/packages/96/09/1d27568a50a5b53f925a290b8cb1be9e15f193c715f1f3f1cf8f5138819e/mfpymake-1.2.10.tar.gz",
"platform": null,
"description": "# pymake\n\nPython package for building MODFLOW-based programs from source files.\n\n### Version 1.2.10\n\n[![PyPI Version](https://img.shields.io/pypi/v/mfpymake.png)](https://pypi.python.org/pypi/mfpymake)\n[![Anaconda Version](https://anaconda.org/conda-forge/mfpymake/badges/version.svg)](https://anaconda.org/conda-forge/mfpymake) \n[![pymake continuous integration](https://github.com/modflowpy/pymake/workflows/pymake%20continuous%20integration/badge.svg)](https://github.com/modflowpy/pymake/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/modflowpy/pymake/branch/master/graph/badge.svg)](https://codecov.io/gh/modflowpy/pymake)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/fe4275a3cfb84acf9c84aba7b4ae2086)](https://www.codacy.com/gh/modflowpy/pymake/dashboard?utm_source=github.com&utm_medium=referral&utm_content=modflowpy/pymake&utm_campaign=Badge_Grade)\n[![Documentation Status](https://readthedocs.org/projects/mfpymake/badge/?version=latest)](https://mfpymake.readthedocs.io/en/latest/?badge=latest) \n\nThis is a python package for compiling MODFLOW-based and other Fortran, C, and\nC++ programs. The package determines the build order using a directed acyclic\ngraph and then compiles the source files using GNU compilers (`gcc`, `g++`,\n`gfortran`), Clang compilers (`clang`, `clang++`), or the Intel compilers (`ifort`,\n`icl`, `icc`, `mpiifort`).\n\npymake can be run from the command line or it can be called from within python.\nBy default, pymake sets the optimization level, Fortran flags, C/C++ flags, and\nlinker flags that are consistent with those used to compile MODFLOW-based\nprograms released by the USGS.\n\nNote that if gfortran is used to compile MODFLOW-based codes, the `openspec.f`\nand `FILESPEC.inc` (MT3DMS) files will automatically be changed to the\nfollowing so that binary files are created properly using standard Fortran:\n\n```\nc -- created by pymake.py\nCHARACTER*20 ACCESS,FORM,ACTION(2)\nDATA ACCESS/'STREAM'/\nDATA FORM/'UNFORMATTED'/\nDATA (ACTION(I),I=1,2)/'READ','READWRITE'/\nc -- end of include file\n```\n\n## Command Line Usage\n\nWhen pymake is installed, a `mfpymake` (or `mfpymake.exe` for Windows) program is installed.`mfpymake` can be used to\ncompile MODFLOW 6 from source files located on your computer directly from the command line using\nthe Intel Fortran compiler `ifort` from the root directory containing the `src` subdirectory by specifying:\n\n```\nmfpymake src/ mf6 -mc --subdirs -fc ifort\n```\n\nTo see help for running from command line, use the following statement.\n\n```\nmfpymake -h\n```\n\nThe help message identifies required positional arguments and optional arguments that can be provided to override\ndefault values.\n\n```\nusage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS]\n [-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--meson] [--mesondir]\n srcdir target\n\nThis is the pymake program for compiling fortran, c, and c++ source\nfiles, such as the source files that come with MODFLOW. The program\nworks by building a directed acyclic graph of the module dependencies\nand then compiling the source files in the proper order.\n\npositional arguments:\n srcdir Path source directory.\n target Name of target to create. (can include path)\n\noptions:\n -h, --help show this help message and exit\n -fc {ifort,mpiifort,gfortran,none}\n Fortran compiler to use. (default is gfortran)\n -cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}\n C/C++ compiler to use. (default is gcc)\n -ar {ia32,ia32_intel64,intel64}, --arch {ia32,ia32_intel64,intel64}\n Architecture to use for Intel and Microsoft compilers on Windows. (default is intel64)\n -mc, --makeclean Clean temporary object, module, and source files when done. (default is False)\n -dbl, --double Force double precision. (default is False)\n -dbg, --debug Create debug version. (default is False)\n -e, --expedite Only compile out of date source files. Clean must not have been used on previous build. (default is False)\n -dr, --dryrun Do not actually compile. Files will be deleted, if --makeclean is used. Does not work yet for ifort. (default is False)\n -sd, --subdirs Include source files in srcdir subdirectories. (default is None)\n -ff FFLAGS, --fflags FFLAGS\n Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal sign\n (-ff='-O3'). (default is None)\n -cf CFLAGS, --cflags CFLAGS\n Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign\n (-cf='-O3'). (default is None)\n -sl {-lc,-lm}, --syslibs {-lc,-lm}\n Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign (-sl='-libgcc').\n (default is None)\n -mf, --makefile Create a GNU make makefile. (default is False)\n -md, --makefiledir GNU make makefile directory. (default is '.')\n -cs COMMONSRC, --commonsrc COMMONSRC\n Additional directory with common source files. (default is None)\n -ef EXTRAFILES, --extrafiles EXTRAFILES\n List of extra source files to include in the compilation. extrafiles can be either a list of files or the name of a text file that contains a list of files. (default is None)\n -exf EXCLUDEFILES, --excludefiles EXCLUDEFILES\n List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is None)\n -so, --sharedobject Create shared object or dll on Windows. (default is False)\n -ad APPDIR, --appdir APPDIR\n Target path that overides path defined target path (default is None)\n -v, --verbose Verbose output to terminal. (default is False)\n --keep Keep existing executable. (default is False)\n --zip ZIP Zip built executable. (default is None)\n --inplace Source files in srcdir are used directly. (default is False)\n --networkx Use networkx package to build Directed Acyclic Graph use to determine the order source files are compiled in. (default is False)\n --meson Use meson to build executable. (default is False)\n --mesondir meson directory. (default is '.')\n\nNote that the source directory should not contain any bad \nor duplicate source files as all source files in the source \ndirectory, the common source file directory (srcdir2), and \nthe extra files (extrafiles) will be built and linked. \nFiles can be excluded by using the excludefiles command \nline switch.\n\nExamples:\n\nCompile MODFLOW 6 from the root directory containing the \nsource files in subdirectories in the src/ subdirectory:\n\n$ mfpymake src/ mf6 --subdirs\n\nCompile MODFLOW 6 in the bin subdirectory using the Intel \nFortran compiler from the root directory containing the source \nfiles in subdirectories in the the src/ subdirectory:\n\n$ mfpymake src/ mf6 --subdirs -fc ifort --appdir bin\n```\n\nNote that command line arguments for Fortran flags, C/C++ flags, and syslib libraries should be enclosed in quotes and\nstart with a space prior to the first value (`-ff ' -O3'`) or use an equal sign separating the command line argument and\nthe values (`-ff='-O3'`). The command line argument to use an `-O3` optimization level when compiling MODFLOW 6 with\nthe `ifort` compiler would be:\n\n```\nmfpymake src/ mf6 -mc --subdirs -fc ifort -ff='-O3'\n```\n\n## From Python\n\n### Script to compile MODFLOW 6\n\nWhen using the pymake object (`Pymake()`) only the positional arguments\n(`srcdir`, `target`) need to be specified in the script.\n\n```python\nimport pymake\n\npm = pymake.Pymake()\npm.srcdir = '../src'\npm.target = 'mf6'\npm.include_subdirs = True\npm.build()\n```\n\nIt is suggested that optional variables required for successful compiling and linking be manually specified in the\nscript to mininimize the potential for unsuccessful builds. For MODFLOW 6, subdirectories in the `src` subdirectory need\nto be included and '`pm.include_subdirs = True`' has been specified in the script. Custom optimization levels and\ncompiler flags could be specified to get consistent builds.\n\nNon-default values for the optional arguments can specified as command line arguments. For example, MODFLOW 6 could be\ncompiled using Intel compilers instead of the default GNU compilers with the script listed above by specifying:\n\n```\npython mymf6script.py -fc ifort -cc icc\n```\n\n## Automatic Download and Build\n\nWhen pymake is installed, a `make-program` (or `make-program.exe` for Windows) program is installed. `make-program` can\nbe used to build MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, MODFLOW-LGR, MODFLOW-2000, MODPATH 6, MODPATH 7,\nGSFLOW, VS2DT, MT3DMS, MT3D-USGS, SEAWAT, and SUTRA. Utility programs CRT, Triangle, and GRIDGEN can also\nbe built. `make-program` downloads the distribution file (requires an internet connection), unzips the file, sets the\npymake settings required to build the program, and compiles the program from the source files. Optional pymake command\nline arguments can be used to customize the build (`-fc`, `-cc`, `--fflags`, etc.). For example, MODFLOW 6 could be\nbuilt using intel compilers and an `O3` optimization level by specifying:\n\n```\nmake-program mf6 -fc=ifort --fflags='-O3'\n```\n\nSee [pymake Read the Docs](https://mfpymake.readthedocs.io/en/1.2.4/build_apps.html#building-applications) for more\ninformation.\n\n## Installation\n\nTo install pymake using pip type:\n\n```\npip install mfpymake\n```\n\nTo install pymake using conda type:\n\n```\nconda install -c conda-forge mfpymake\n```\n\nTo install the latest pymake release directly from the git repository type:\n\n```\npip install https://github.com/modflowpy/pymake/zipball/master\n```\n\nTo update your version of pymake with the latest development version from the git repository type:\n\n```\npip install https://github.com/modflowpy/pymake/zipball/develop --upgrade\n```\n",
"bugtrack_url": null,
"license": "CC0",
"summary": "pymake is a Python package to compile MODFLOW-based models.",
"version": "1.2.10",
"project_urls": {
"Bug Tracker": "https://github.com/modflowpy/pymake/issues",
"Documentation": "https://mfpymake.readthedocs.io",
"Release Notes": "https://github.com/modflowpy/flopy/blob/develop/docs/version_changes.md",
"Source Code": "https://github.com/modflowpy/pymake"
},
"split_keywords": [
"modflow",
" groundwater",
" hydrogeology"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4395cd040486237e7cee4656ea456ef7de3b9b038c09cc9f87bd94b551533304",
"md5": "cd6733ee12cc5f1a5a906282678f5b77",
"sha256": "df022ba3ab2e642a46e27b304f0e3d2add340729a556f8bce8db41360712e9d1"
},
"downloads": -1,
"filename": "mfpymake-1.2.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cd6733ee12cc5f1a5a906282678f5b77",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 70893,
"upload_time": "2024-06-17T22:22:23",
"upload_time_iso_8601": "2024-06-17T22:22:23.227439Z",
"url": "https://files.pythonhosted.org/packages/43/95/cd040486237e7cee4656ea456ef7de3b9b038c09cc9f87bd94b551533304/mfpymake-1.2.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "96091d27568a50a5b53f925a290b8cb1be9e15f193c715f1f3f1cf8f5138819e",
"md5": "ae5acfcace5efd33c70ad1afec474eb6",
"sha256": "752a675995f6ac99a31949828d820c195222c02e0c574668ed0d744cc1ee03f9"
},
"downloads": -1,
"filename": "mfpymake-1.2.10.tar.gz",
"has_sig": false,
"md5_digest": "ae5acfcace5efd33c70ad1afec474eb6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 62257,
"upload_time": "2024-06-17T22:22:34",
"upload_time_iso_8601": "2024-06-17T22:22:34.875073Z",
"url": "https://files.pythonhosted.org/packages/96/09/1d27568a50a5b53f925a290b8cb1be9e15f193c715f1f3f1cf8f5138819e/mfpymake-1.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-17 22:22:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "modflowpy",
"github_project": "pymake",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mfpymake"
}