Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@ jobs:
matrix:
include:
# test latest gcc and python
- {os: ubuntu-latest, FC: gcc, FC_V: 13, shell: bash}
- {os: macos-latest, FC: gcc, FC_V: 13, shell: bash}
- {os: windows-latest, FC: gcc, FC_V: 13, shell: pwsh}
- {os: ubuntu-latest, compiler: gcc, version: 13, shell: bash}
- {os: macos-latest, compiler: gcc, version: 13, shell: bash}
- {os: windows-latest, compiler: gcc, version: 13, shell: pwsh}
# test latest python and intel-classic
- {os: ubuntu-22.04, FC: intel-classic, FC_V: 2021.7, shell: bash}
- {os: macos-13, FC: intel-classic, FC_V: 2021.7, shell: bash}
- {os: windows-2022, FC: intel-classic, FC_V: 2021.7, shell: pwsh}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7, shell: bash}
- {os: macos-13, compiler: intel-classic, version: 2021.7, shell: bash}
- {os: windows-2022, compiler: intel-classic, version: 2021.7, shell: pwsh}
# test latest python and previous gcc
- {os: ubuntu-latest, FC: gcc, FC_V: 12, shell: bash}
- {os: ubuntu-latest, FC: gcc, FC_V: 11, shell: bash}
- {os: ubuntu-latest, compiler: gcc, version: 12, shell: bash}
- {os: ubuntu-latest, compiler: gcc, version: 11, shell: bash}
# test ifx
- {os: ubuntu-22.04, compiler: intel, version: "2025.0", shell: bash}
- {os: windows-2022, compiler: intel, version: "2025.0", shell: pwsh}

defaults:
run:
shell: ${{ matrix.shell }}
Expand All @@ -58,7 +62,7 @@ jobs:
uses: actions/checkout@v5

- uses: maxim-lobanov/setup-xcode@v1
if: ${{ (runner.os == 'macOS') && (matrix.FC == 'intel-classic') }}
if: ${{ (runner.os == 'macOS') && (matrix.compiler == 'intel-classic') }}
with:
xcode-version: "14.3.1"

Expand All @@ -77,11 +81,11 @@ jobs:
run: |
pixi run postinstall

- name: Setup ${{ matrix.FC }} ${{ matrix.FC_V }} on ${{ matrix.os }}
- name: Setup ${{ matrix.compiler }} ${{ matrix.version }} on ${{ matrix.os }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ matrix.FC }}
version: ${{ matrix.FC_V }}
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

- name: Download examples for pytest runs
run: |
Expand Down Expand Up @@ -110,7 +114,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-${{ matrix.os }}-${{ matrix.FC }}-${{ matrix.FC_V }}
name: failed-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
path: ./autotest/.failed

- name: Print coverage report before upload
Expand All @@ -133,13 +137,16 @@ jobs:
matrix:
include:
# test latest gcc and python
- {os: ubuntu-latest, FC: gcc, FC_V: 13, shell: bash}
- {os: macos-latest, FC: gcc, FC_V: 13, shell: bash}
- {os: windows-latest, FC: gcc, FC_V: 13, shell: pwsh}
- {os: ubuntu-latest, compiler: gcc, version: 13, shell: bash}
- {os: macos-latest, compiler: gcc, version: 13, shell: bash}
- {os: windows-latest, compiler: gcc, version: 13, shell: pwsh}
# test latest python and intel
- {os: ubuntu-22.04, FC: intel-classic, FC_V: 2021.7, shell: bash}
- {os: macos-13, FC: intel-classic, FC_V: 2021.7, shell: bash}
- {os: windows-2022, FC: intel-classic, FC_V: 2021.7, shell: pwsh}
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7, shell: bash}
- {os: macos-13, compiler: intel-classic, version: 2021.7, shell: bash}
- {os: windows-2022, compiler: intel-classic, version: 2021.7, shell: pwsh}
# test ifx
- {os: ubuntu-22.04, compiler: intel, version: "2025.0", shell: bash}
- {os: windows-2022, compiler: intel, version: "2025.0", shell: pwsh}
defaults:
run:
shell: ${{ matrix.shell }}
Expand All @@ -161,7 +168,7 @@ jobs:
uses: actions/checkout@v5

- uses: maxim-lobanov/setup-xcode@v1
if: ${{ (runner.os == 'macOS') && (matrix.FC == 'intel-classic') }}
if: ${{ (runner.os == 'macOS') && (matrix.compiler == 'intel-classic') }}
with:
xcode-version: "14.3.1"

Expand All @@ -180,11 +187,11 @@ jobs:
run: |
pixi run postinstall

- name: Setup ${{ matrix.FC }} ${{ matrix.FC_V }} on ${{ matrix.os }}
- name: Setup ${{ matrix.compiler }} ${{ matrix.version }} on ${{ matrix.os }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ matrix.FC }}
version: ${{ matrix.FC_V }}
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

- name: Install make
if: runner.os == 'Windows'
Expand All @@ -198,7 +205,7 @@ jobs:
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-schedule-${{ matrix.os }}-${{ matrix.FC }}-${{ matrix.FC_V }}
name: failed-schedule-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
path: autotest/.failed

- name: Print coverage report before upload
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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`).
`icl`, `icc`, `mpiifort`, `ifx`).

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
Expand Down Expand Up @@ -55,7 +55,7 @@ The help message identifies required positional arguments and optional arguments
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]
usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,ifx,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,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

Expand All @@ -70,9 +70,9 @@ positional arguments:

options:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
-fc {ifort,mpiifort,gfortran,ifx,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,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)
Expand Down Expand Up @@ -110,22 +110,22 @@ options:
--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
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
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
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
Expand Down
10 changes: 8 additions & 2 deletions autotest/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
test_fc_env = os.environ.get("FC")
if "win" in test_ostag:
meson_exclude = ["mt3dms", "vs2dt", "triangle", "gridgen", "sutra"]
elif "win" not in test_ostag and test_fc_env in ("ifort",):
elif "win" not in test_ostag and test_fc_env in (
"ifort",
"ifx",
):
meson_exclude = ["mf2000", "mf2005", "swtv4", "mflgr", "sutra"]
else:
meson_exclude = ["sutra"]
if "win" in test_ostag and test_fc_env in ("ifort",):
if "win" in test_ostag and test_fc_env in (
"ifort",
"ifx",
):
meson_exclude += ["mf2000", "mf2005", "swtv4", "mflgr"]

targets_meson = [t for t in targets if t not in meson_exclude]
Expand Down
9 changes: 5 additions & 4 deletions docs/build_apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ and options can be determined by executing:
```console
$ make-program --help

usage: make-program [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-dbl] [-dr] [-ff FFLAGS] [-cf CFLAGS] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--meson]
usage: make-program [-h] [-fc {ifort,mpiifort,gfortran,ifx,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,none}] [-dbl] [-dr] [-ff FFLAGS] [-cf CFLAGS] [-ad APPDIR] [-v] [--keep] [--zip ZIP]
[--meson]
targets

Download and build USGS MODFLOW and related programs.
Expand All @@ -18,9 +19,9 @@ positional arguments:

options:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
-fc {ifort,mpiifort,gfortran,ifx,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,none}
C/C++ compiler to use. (default is gcc)
-dbl, --double Force double precision. (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)
Expand Down Expand Up @@ -50,7 +51,7 @@ Examples:

Download and compile all programs in the ./temp subdirectory:
$ make-program : --appdir temp

```

`make-program` can be used to build MODFLOW 6, MODFLOW-2005, MODFLOW-NWT, MODFLOW-USG, MODFLOW-LGR, MODFLOW-2000,
Expand Down
94 changes: 32 additions & 62 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ 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]
usage: mfpymake [-h] [-fc {ifort,mpiifort,gfortran,ifx,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,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
Expand All @@ -43,89 +38,64 @@ positional arguments:
srcdir Path source directory.
target Name of target to create. (can include path)

optional arguments:
options:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
-fc {ifort,mpiifort,gfortran,ifx,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,icx,icpx,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)
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)
-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)
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)
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)
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)
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)
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)
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 overrides path defined target path
(default is None)
Target path that overrides 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 False)
--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)
--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
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
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
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
Expand Down
Loading
Loading