Skip to content

Commit

Permalink
t5
Browse files Browse the repository at this point in the history
  • Loading branch information
mjreno authored and mjreno committed Oct 9, 2024
1 parent 3f3c07b commit 76497b8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .github/actions/test-netcdf/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 13 additions & 5 deletions .github/common/compile_netcdf.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 76497b8

Please sign in to comment.