From 76497b8f7075a103542c3ece8fd116e5f0e6d84c Mon Sep 17 00:00:00 2001 From: mjreno Date: Wed, 9 Oct 2024 12:52:41 -0400 Subject: [PATCH] t5 --- .github/actions/test-netcdf/action.yml | 2 -- .github/common/compile_netcdf.bat | 18 +++++++++++++----- .github/workflows/ci.yml | 11 ++++++++++- meson.build | 10 +++++----- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/actions/test-netcdf/action.yml b/.github/actions/test-netcdf/action.yml index db52d925457..ce94746548e 100644 --- a/.github/actions/test-netcdf/action.yml +++ b/.github/actions/test-netcdf/action.yml @@ -26,9 +26,7 @@ runs: if: runner.os == 'macOS' shell: bash run: | - bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install netcdf-fortran - brew install gcc@13 nc-config --all nf-config diff --git a/.github/common/compile_netcdf.bat b/.github/common/compile_netcdf.bat index 47d6aa1eed9..380e31189de 100644 --- a/.github/common/compile_netcdf.bat +++ b/.github/common/compile_netcdf.bat @@ -4,19 +4,27 @@ dir netcdf-fortran-4.6.1_build cd netcdf-fortran-4.6.1_build\build +where ifort +echo %CMAKE_Fortran_COMPILER% +cmake --help + +set FC=ifort + :: FIRST BUILD/INSTALL STATIC LIBS :: cmake --fresh -G "Visual Studio 17 2022" -A x64 -DNETCDF_C_LIBRARY=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netCDF4.9.2-NC4-64/lib/netcdf.lib -DNETCDF_C_INCLUDE_DIR=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netCDF4.9.2-NC4-64/include -DBUILD_SHARED_LIBS=0 -DENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netcdf-f/build ../netcdf-fortran-4.6.1 -cmake --fresh -G "Visual Studio 17 2022" -A x64 -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\lib\netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\include" -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build" ../netcdf-fortran-4.6.1 +cmake --fresh -A x64 -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\lib\netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\include" -DBUILD_SHARED_LIBS=0 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build" ../netcdf-fortran-4.6.1 cmake --build . --config Release -cmake –install . --config Release +:: cmake –install . --config Release +cmake –install . :: NOW BUILD/INSTALL SHARED :: cmake --fresh -G "Visual Studio 17 2022" -A x64 -DNETCDF_C_LIBRARY=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netCDF4.9.2-NC4-64/lib/netcdf.lib -DNETCDF_C_INCLUDE_DIR=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netCDF4.9.2-NC4-64/include -DBUILD_SHARED_LIBS=1 -DENABLE_TESTS=1 -DCMAKE_INSTALL_PREFIX=C:/Users/mreno/local/netcdf/build-windows/builds/b4/build/netcdf-f/build ../netcdf-fortran-4.6.1 -cmake --fresh -G "Visual Studio 17 2022" -A x64 -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\lib\netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\include" -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build" ../netcdf-fortran-4.6.1 +cmake --fresh -A x64 -DNETCDF_C_LIBRARY="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\lib\netcdf.lib" -DNETCDF_C_INCLUDE_DIR="%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\include" -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build" ../netcdf-fortran-4.6.1 cmake --build . --config Release -cmake –install . --config Release +:: cmake –install . --config Release +cmake –install . :: set PKG_CONFIG_PATH=C:\Users\mreno\local\netcdf\build-windows\builds\b4\build\netcdf-f\build\lib\pkgconfig\;%PKG_CONFIG_PATH% :: set PKG_CONFIG_PATH=C:\Users\mreno\local\netcdf\build-windows\builds\b4\build\netCDF4.9.2-NC4-64\lib\pkgconfig\;%PKG_CONFIG_PATH% @@ -32,7 +40,7 @@ set PATH=%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build\fortran\Rele set PATH=%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin;%PATH% set PATH=%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1_build\build\bin;%PATH% -set FC=ifort +:: set FC=ifort cd "%GITHUB_WORKSPACE%\modflow6" pixi run setup -Dnetcdf=true builddir pixi run build builddir diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95208b1341..a97cecc0aec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -566,7 +566,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, macos-12, windows-2022 ] + os: [ ubuntu-22.04, macos-13, windows-2022 ] defaults: run: shell: bash @@ -592,6 +592,15 @@ jobs: working-directory: modflow6 run: pixi run pip install xugrid xarray netcdf4 + - name: Set LDFLAGS (macOS) + if: matrix.os == 'macos-13' + run: | + os_ver=$(sw_vers -productVersion | cut -d'.' -f1) + if (( "$os_ver" > 12 )); then + ldflags="$LDFLAGS -Wl,-ld_classic" + echo "LDFLAGS=$ldflags" >> $GITHUB_ENV + fi + - name: Test NetCDF MF6 if: runner.os != 'Windows' uses: ./modflow6/.github/actions/test-netcdf diff --git a/meson.build b/meson.build index 3fc05fc5775..3557f2462ce 100755 --- a/meson.build +++ b/meson.build @@ -136,13 +136,13 @@ petsc_compiled_rel = petsc_dir_rel / petsc_arch petsc_compiled_abs = petsc_dir_abs / petsc_arch # windows options for netcdf -#netcdf_dir_rel = '..' /'netcdf' +netcdf_dir_rel = '..' /'netcdf' netcdf_dir_abs = meson.project_source_root() / '..' /'netcdf' netcdfc_build = 'netCDF4.9.2-NC4-64' netcdff_build = 'netcdf-fortran-4.6.1_build' -#netcdfc_compiled_rel = netcdf_dir_rel / netcdfc_build +netcdfc_compiled_rel = netcdf_dir_rel / netcdfc_build netcdfc_compiled_abs = netcdf_dir_abs / netcdfc_build -#netcdff_compiled_rel = netcdf_dir_rel / netcdff_build +netcdff_compiled_rel = netcdf_dir_rel / netcdff_build netcdff_compiled_abs = netcdf_dir_abs / netcdff_build # on windows only with intel @@ -194,8 +194,8 @@ if is_netcdf_build or is_extended_build dependencies += [ netcdff ] if build_machine.system() == 'windows' netcdf_incdir = include_directories([ - netcdfc_compiled_abs / 'include', - netcdff_compiled_abs / 'fortran' / 'Release' + netcdfc_compiled_rel / 'include', + netcdff_compiled_rel / 'fortran' / 'Release' ]) endif endif