From f6ba0a5fab0f0c9c1765e4986f7ad834547985b2 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Fri, 24 Jan 2025 16:55:51 -0500 Subject: [PATCH] Autoconf: Ice-ocean autodetect FMS API configure.ice_ocean.ac was modified to automatically detect the FMS API. This replaces the --framework flag, which forced the user to manually select the appropriate config_src/infra directory. Now, the appropriate directory is based on the FMS library detected during configuration. This will prevent possible FMS1/2 API mixups during compilation. The ice-ocean and AM2-coupler configure.ac files have also been moved out of ac/ and into their respective directories. --- coupled_AM2_LM3_SIS2/Makefile | 2 +- {ac => coupled_AM2_LM3_SIS2}/configure.coupled.ac | 0 ice_ocean_SIS2/Makefile | 2 +- {ac => ice_ocean_SIS2}/configure.ice_ocean.ac | 8 ++++++++ 4 files changed, 10 insertions(+), 2 deletions(-) rename {ac => coupled_AM2_LM3_SIS2}/configure.coupled.ac (100%) rename {ac => ice_ocean_SIS2}/configure.ice_ocean.ac (98%) diff --git a/coupled_AM2_LM3_SIS2/Makefile b/coupled_AM2_LM3_SIS2/Makefile index 7f6ec559e..921b48906 100644 --- a/coupled_AM2_LM3_SIS2/Makefile +++ b/coupled_AM2_LM3_SIS2/Makefile @@ -14,7 +14,7 @@ LM3_BUILD ?= ../shared/LM3/build # Autoconf configuration MOM_CODEBASE ?= ../src/MOM6 MAKEFILE_IN ?= $(MOM_CODEBASE)/ac/Makefile.in -CONFIGURE_AC ?= ../ac/configure.coupled.ac +CONFIGURE_AC ?= configure.coupled.ac M4DIR ?= $(MOM_CODEBASE)/ac/m4 MAKEDEP ?= $(MOM_CODEBASE)/ac/makedep diff --git a/ac/configure.coupled.ac b/coupled_AM2_LM3_SIS2/configure.coupled.ac similarity index 100% rename from ac/configure.coupled.ac rename to coupled_AM2_LM3_SIS2/configure.coupled.ac diff --git a/ice_ocean_SIS2/Makefile b/ice_ocean_SIS2/Makefile index bfd1020c4..baafb6e9d 100644 --- a/ice_ocean_SIS2/Makefile +++ b/ice_ocean_SIS2/Makefile @@ -14,7 +14,7 @@ LAND_BUILD ?= ../shared/land_null/build # Autoconf configuration MOM_CODEBASE ?= ../src/MOM6 MAKEFILE_IN ?= $(MOM_CODEBASE)/ac/Makefile.in -CONFIGURE_AC ?= ../ac/configure.ice_ocean.ac +CONFIGURE_AC ?= configure.ice_ocean.ac M4DIR ?= $(MOM_CODEBASE)/ac/m4 MAKEDEP ?= $(MOM_CODEBASE)/ac/makedep diff --git a/ac/configure.ice_ocean.ac b/ice_ocean_SIS2/configure.ice_ocean.ac similarity index 98% rename from ac/configure.ice_ocean.ac rename to ice_ocean_SIS2/configure.ice_ocean.ac index 4fff2bc90..202f62cef 100644 --- a/ac/configure.ice_ocean.ac +++ b/ice_ocean_SIS2/configure.ice_ocean.ac @@ -244,6 +244,14 @@ AC_COMPILE_IFELSE( ) +# Determine the FMS IO implementation. +AX_FC_CHECK_MODULE([fms2_io_mod], [ + MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS2 +],[ + MODEL_FRAMEWORK=${srcdir}/config_src/infra/FMS1 +]) + + # Verify that Python is available AC_PATH_PROGS([PYTHON], [python python3 python2], [ AC_MSG_ERROR([Could not find python.])