Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecated io options to build systems and CI #1063

Merged
merged 4 commits into from
Jun 30, 2023
Merged
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
3 changes: 2 additions & 1 deletion .github/workflows/build_cmake_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ jobs:
matrix:
omp-flags: [ -DOPENMP=on, -DOPENMP=off ]
libyaml-flag: [ "", -DWITH_YAML=on ]
io-flag: [ "", -DUSE_DEPRECATED_IO=on ]
container:
image: noaagfdl/hpc-me.ubuntu-minimal:cmake
env:
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.libyaml-flag }} -D64BIT=on"
CMAKE_FLAGS: "${{ matrix.omp-flags }} ${{ matrix.io-flag }} ${{ matrix.libyaml-flag }} -D64BIT=on"
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_ubuntu_gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ jobs:
matrix:
conf-flags: [--disable-openmp, --enable-mixed-mode, --disable-setting-flags, --with-mpi=no]
input-flag: [--with-yaml, --enable-test-input=/home/unit_tests_input]
io-flag: [ --enable-deprecated-io, --disable-deprecated-io]
container:
image: noaagfdl/hpc-me.ubuntu-minimal:gnu-input
env:
TEST_VERBOSE: 1
DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flags }} ${{ matrix.input-flag }}"
DISTCHECK_CONFIGURE_FLAGS: "${{ matrix.conf-flags }} ${{ matrix.input-flag }} ${{ matrix.io-flag }}"
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ option(ENABLE_QUAD_PRECISION "Enable compiler definition -DENABLE_QUAD_PRECISION
option(GFS_PHYS "Enable compiler definition -DGFS_PHYS" OFF)
option(LARGEFILE "Enable compiler definition -Duse_LARGEFILE" OFF)
option(WITH_YAML "Enable compiler definition -Duse_yaml" OFF)
option(USE_DEPRECATED_IO "Enable compiler definition -Duse_deprecated_io (compile with fms_io/mpp_io)" OFF)

if(32BIT)
list(APPEND kinds "r4")
Expand Down Expand Up @@ -241,6 +242,10 @@ if(WITH_YAML)
list(APPEND fms_defs use_yaml)
endif()

if(USE_DEPRECATED_IO)
list(APPEND fms_defs use_deprecated_io)
endif()

if(INTERNAL_FILE_NML)
list(APPEND fms_defs INTERNAL_FILE_NML)
endif()
Expand Down
17 changes: 16 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ AS_IF([test ${enable_8byte_int:-no} = yes],
[enable_8byte_int=yes],
[enable_8byte_int=no])

AC_ARG_ENABLE([deprecated-io],
[AS_HELP_STRING([--enable-deprecated-io],
[Enables compilation of deprecated mpp_io and fms_io modules in addition to the updated fms2_io modules (default no)])])
AS_IF([test ${enable_deprecated_io:-no} = yes],
[enable_deprecated_io=yes],
[enable_deprecated_io=no])

# user enabled testing with input files
AC_MSG_CHECKING([whether to enable tests with input files])
AC_ARG_ENABLE([test-input],
Expand Down Expand Up @@ -203,7 +210,6 @@ AC_MSG_CHECKING([if netCDF was built with HDF5])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
#include <netcdf_meta.h>
#if !(NC_HAS_NC4)
choke me
#endif]])], [nc_has_nc4=yes], [nc_has_nc4=no])
AC_MSG_RESULT([$nc_has_nc4])
if test $nc_has_nc4 = no; then
Expand Down Expand Up @@ -273,6 +279,15 @@ if test $with_mpi = yes; then
AC_DEFINE([use_libMPI], [1], [This is required for the library to build])
fi

# check if compiling old io
if test $enable_deprecated_io = yes; then
#If the test pass, define use_deprecated_io macro and skip it's unit tests
AC_DEFINE([use_deprecated_io], [1], [This is required to use mpp_io and fms_io modules])
AM_CONDITIONAL([SKIP_DEPRECATED_IO_TESTS], true)
else
AM_CONDITIONAL([SKIP_DEPRECATED_IO_TESTS], false)
fi

# Set any required compile flags. This will not be done if the user wants to
# define all their own flags.
if test $enable_setting_flags = yes; then
Expand Down
4 changes: 4 additions & 0 deletions test_fms/mpp_io/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ test_mpp_io_SOURCES = test_mpp_io.F90
test_io_R4_R8_SOURCES = test_io_R4_R8.F90
test_io_mosaic_R4_R8_SOURCES = test_io_mosaic_R4_R8.F90

if SKIP_DEPRECATED_IO_TESTS
TESTS_ENVIRONMENT= SKIP_TESTS="test_mpp_io2.1 test_io_R4_R8.1 test_io_mosaic_R4_R8.1"
endif

# Run the test program.
TESTS = test_mpp_io2.sh \
test_io_R4_R8.sh \
Expand Down