Skip to content

Commit

Permalink
* fix for meson mixed-language projects
Browse files Browse the repository at this point in the history
* add mf6dev, zbud6dev, and libmf6dev
* remove default double precision builds for mfusg, mf2005, mflgr, and mfnwt
  • Loading branch information
jdhughes-usgs committed Aug 7, 2023
1 parent 5218644 commit 9f76b0e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:

- name: Set CXX (temporary)
if: runner.os == 'Windows'
run: echo "CXX=icl" >> $GITHUB_ENV
run: |
echo "CC=icl" >> $GITHUB_ENV
echo "CXX=icl" >> $GITHUB_ENV
- name: Setup Graphviz
if: runner.os == 'Linux'
Expand Down
3 changes: 2 additions & 1 deletion pymake/cmds/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"zip",
"keep",
"dryrun",
"meson",
)
COM_ARG_KEYS = ("fc", "cc", "fflags", "cflags", "zip", "keep", "dryrun")
COM_ARG_KEYS = ("fc", "cc", "fflags", "cflags", "zip", "keep", "dryrun",)


def main() -> None:
Expand Down
4 changes: 2 additions & 2 deletions pymake/pymake_build_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def build_apps(

# set double precision flag and whether the executable name
# can be modified
if target in ["swtv4"]:
if target in ("swtv4",):
update_target_name = False
else:
update_target_name = True
Expand All @@ -214,7 +214,7 @@ def build_apps(
pmobj.inplace = True

# set target and srcdir
pmobj.target = target
pmobj.target = target.replace("dev", "")
pmobj.srcdir = os.path.join(
download_dir, code_dict[target].dirname, code_dict[target].srcdir
)
Expand Down
6 changes: 3 additions & 3 deletions pymake/pymake_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _get_standard_arg_dict():
"action": "store_true",
},
"makefiledir": {
"tag": ("-md", "--makefile-dir"),
"tag": ("-md", "--makefiledir"),
"help": "GNU make makefile directory. (default is '.')",
"default": ".",
"choices": None,
Expand Down Expand Up @@ -256,14 +256,14 @@ def _get_standard_arg_dict():
"action": "store_true",
},
"meson": {
"tag": ("--mb", "--meson-build"),
"tag": ("--meson",),
"help": """Use meson to build executable. (default is False)""",
"default": False,
"choices": None,
"action": "store_true",
},
"mesondir": {
"tag": ("-mbd", "--mesonbuild-dir"),
"tag": ("--mesondir",),
"help": "meson directory. (default is '.')",
"default": ".",
"choices": None,
Expand Down
4 changes: 3 additions & 1 deletion pymake/utils/_meson_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ def _create_main_meson_build(
optlevel_int = int(optlevel.replace("-O", "").replace("/O", ""))

main_meson_file = Path(mesondir) / "meson.build"
if verbose:
print(f"Creating main meson.build file {main_meson_file}")
with open(main_meson_file, "w") as f:
line = f"project(\n\t'{target}',\n"
for language in languages:
Expand Down Expand Up @@ -609,7 +611,7 @@ def _create_main_meson_build(

# get list of include directories
include_text = ""
if "cpp" in languages:
if "cpp" in languages or "c" in languages:
include_dirs = []
for key, value in source_path_dict.items():
for root, dirs, files in os.walk(value):
Expand Down
11 changes: 7 additions & 4 deletions pymake/utils/usgsprograms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ gridgen , 1.0.02 , True , https://water.usgs.gov/water-resources/software
crt , 1.3.1 , True , https://water.usgs.gov/ogw/CRT/CRT_1.3.1.zip , CRT_1.3.1 , SOURCE , True , False , False
sutra , 3.0 , True , https://water.usgs.gov/water-resources/software/sutra/SUTRA_3_0_0.zip , SutraSuite , SUTRA_3_0/source , True , False , False
mf2000 , 1.19.01, True , https://water.usgs.gov/nrp/gwsoftware/modflow2000/mf2k1_19_01.tar.gz , mf2k.1_19 , src , True , False , False
mf2005 , 1.12.00, True , https://github.com/MODFLOW-USGS/mf2005/releases/download/v.1.12.00/MF2005.1_12u.zip , MF2005.1_12u , src , True , True , False
mfusg , 1.5 , True , https://water.usgs.gov/water-resources/software/MODFLOW-USG/mfusg1_5.zip , mfusg1_5 , src , True , True , False
mf2005 , 1.12.00, True , https://github.com/MODFLOW-USGS/mf2005/releases/download/v.1.12.00/MF2005.1_12u.zip , MF2005.1_12u , src , True , False , False
mfusg , 1.5 , True , https://water.usgs.gov/water-resources/software/MODFLOW-USG/mfusg1_5.zip , mfusg1_5 , src , True , False , False
zonbudusg , 1.5 , True , https://water.usgs.gov/water-resources/software/MODFLOW-USG/mfusg1_5.zip , mfusg1_5 , src/zonebudusg , True , False , False
swtv4 , 4.00.05, True , https://water.usgs.gov/water-resources/software/SEAWAT/swt_v4_00_05.zip , swt_v4_00_05 , source , False , True , False
mp6 , 6.0.1 , True , https://water.usgs.gov/water-resources/software/MODPATH/modpath.6_0_01.zip , modpath.6_0 , src , True , False , False
mflgr , 2.0.0 , True , https://water.usgs.gov/ogw/modflow-lgr/modflow-lgr-v2.0.0/mflgrv2_0_00.zip , mflgr.2_0 , src , True , True , False
mflgr , 2.0.0 , True , https://water.usgs.gov/ogw/modflow-lgr/modflow-lgr-v2.0.0/mflgrv2_0_00.zip , mflgr.2_0 , src , True , False , False
zonbud3 , 3.01 , True , https://water.usgs.gov/water-resources/software/ZONEBUDGET/zonbud3_01.exe , Zonbud.3_01 , Src , True , False , False
mfnwt1.1.4 , 1.1.4 , False , https://water.usgs.gov/water-resources/software/MODFLOW-NWT/MODFLOW-NWT_1.1.4.zip , MODFLOW-NWT_1.1.4 , src , True , False , False
mfnwt , 1.3.0 , True , https://water.usgs.gov/water-resources/software/MODFLOW-NWT/MODFLOW-NWT_1.3.0.zip , MODFLOW-NWT , src , True , True , False
mfnwt , 1.3.0 , True , https://water.usgs.gov/water-resources/software/MODFLOW-NWT/MODFLOW-NWT_1.3.0.zip , MODFLOW-NWT , src , True , False , False
mfusg_gsi , 2.1.1 , True , https://www.gsienv.com/wp-content/uploads/2023/04/USG-Transport-V_2.1.1.zip , USGT-v2-1-1-source , . , True , False , False
mf6dev , 6.5.0.dev0 , False , https://github.com/MODFLOW-USGS/modflow6/archive/refs/heads/develop.zip , modflow6-develop , src , True , False , False
zbud6dev , 6.5.0.dev0 , False , https://github.com/MODFLOW-USGS/modflow6/archive/refs/heads/develop.zip , modflow6-develop , utils/zonebudget/src, True , False , False
libmf6dev , 6.5.0.dev0 , False , https://github.com/MODFLOW-USGS/modflow6/archive/refs/heads/develop.zip , modflow6-develop , srcbmi , True , False , True

0 comments on commit 9f76b0e

Please sign in to comment.