Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
33 changes: 24 additions & 9 deletions .github/actions/build-petsc-win/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ runs:
uses: actions/cache/restore@v3
with:
path: petsc
key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }}
key: petsc-3.25.0-${{ runner.os }}-${{ steps.get-date.outputs.date }}

- name: Download PETSc
if: steps.petsc-cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.20.5.tar.gz -O -J
curl https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.25.0.tar.gz -O -J
mkdir petsc
tar -xzf petsc-3.20.5.tar.gz -C petsc --strip-components=1
tar -xzf petsc-3.25.0.tar.gz -C petsc --strip-components=1

- name: Setup Cygwin
if: steps.petsc-cache.outputs.cache-hit != 'true'
Expand All @@ -64,18 +64,33 @@ runs:
run: |
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\compile_petsc.sh"

- name: Fix PETSc.pc paths
if: steps.petsc-cache.outputs.cache-hit != 'true'
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
run: |
PETSC_PC="$(cygpath -u "$GITHUB_WORKSPACE")/petsc/install/lib/pkgconfig/PETSc.pc"
if [ -f "$PETSC_PC" ]; then
# Convert cygwin paths to Windows paths
sed -i 's|/cygdrive/c/|C:/|g' "$PETSC_PC"
sed -i 's|/cygdrive/d/|D:/|g' "$PETSC_PC"
sed -i 's|/cygdrive/e/|E:/|g' "$PETSC_PC"
echo "Fixed PETSc.pc paths:"
cat "$PETSC_PC"
else
echo "Warning: PETSc.pc not found at $PETSC_PC"
fi

- name: Save PETSc cache
if: steps.petsc-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: petsc
key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }}
key: petsc-3.25.0-${{ runner.os }}-${{ steps.get-date.outputs.date }}

- name: Setup PETSC environment
shell: cmd
run: |
set PETSC_DIR=%GITHUB_WORKSPACE%\petsc
set PETSC_ARCH=arch-mswin-c-opt
echo PETSC_DIR=%PETSC_DIR%>>%GITHUB_ENV%
echo PETSC_ARCH=%PETSC_ARCH%>>%GITHUB_ENV%
echo %PETSC_DIR%\%PETSC_ARCH%\lib>>%GITHUB_PATH%
set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%;%GITHUB_WORKSPACE%\petsc\install\lib\pkgconfig
echo PKG_CONFIG_PATH=%PKG_CONFIG_PATH%>>%GITHUB_ENV%
echo %GITHUB_WORKSPACE%\petsc\install\bin>>%GITHUB_PATH%
echo %GITHUB_WORKSPACE%\petsc\install\lib>>%GITHUB_PATH%
2 changes: 1 addition & 1 deletion .github/actions/test-extended/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ runs:
with:
repository: petsc/petsc
path: petsc
ref: v3.22.5
ref: v3.25.0

- name: Configure environment
shell: bash
Expand Down
7 changes: 6 additions & 1 deletion .github/common/compile_petsc.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
cd "$GITHUB_WORKSPACE/petsc"
PETSC_PREFIX=$(cygpath -u "$GITHUB_WORKSPACE/petsc")
make all
make check
make check

# We need to make sure this folder doesn't exist otherwise the install target does nothing.
rm -rf "$PETSC_PREFIX/install"
make install
18 changes: 16 additions & 2 deletions .github/common/configure_petsc.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# Strip down environment to prevent "xargs: environment is too large for exec" error
# Use env -i to start with minimal environment, preserving only essentials
cd "$GITHUB_WORKSPACE/petsc"
./configure \
PETSC_PREFIX=$(cygpath -u "$GITHUB_WORKSPACE/petsc")/install

env -i \
PATH="$PATH" \
TEMP="$TEMP" \
TMP="$TMP" \
HOME="$HOME" \
INCLUDE="$INCLUDE" \
LIB="$LIB" \
./configure \
--prefix="$PETSC_PREFIX" \
--with-debugging=0 \
--with-shared-libraries=1 \
--with-cc='cl' \
--with-fc='ifort' \
--with-cxx='cl' \
FPPFLAGS='-I/cygdrive/c/PROGRA~2/Intel/oneAPI/mpi/latest/include/mpi' \
--with-blaslapack-lib='-L/cygdrive/c/PROGRA~2/Intel/oneAPI/mkl/latest/lib mkl_intel_lp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib' \
--with-mpi-include='/cygdrive/c/PROGRA~2/Intel/oneAPI/mpi/latest/include' \
--with-mpi-lib='/cygdrive/c/PROGRA~2/Intel/oneAPI/mpi/latest/lib/impi.lib' \
--with-mpiexec='/cygdrive/c/PROGRA~2/Intel/oneAPI/mpi/latest/bin/mpiexec -localonly' \
--with-python-exec='/usr/bin/PYTHON~1.EXE'
--with-python-exec='/usr/bin/PYTHON~1.EXE' \
--with-fortran-bindings='1'
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ jobs:
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_bstrap_proxy.exe" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_pmi_proxy.exe" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_service.exe" .
copy "%GITHUB_WORKSPACE%\petsc\arch-mswin-c-opt\lib\libpetsc.dll" .
copy "%GITHUB_WORKSPACE%\petsc\install\lib\libpetsc.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.3-NC4-64\bin\hdf5.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.3-NC4-64\bin\hdf5_hl.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.3-NC4-64\bin\libcurl.dll" .
Expand Down
42 changes: 3 additions & 39 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ elif is_netcdf_build
message('NetCDF build:', is_netcdf_build)
endif

# windows options for petsc
petsc_dir_rel = '..' /'petsc'
petsc_dir_abs = meson.project_source_root() / '..' /'petsc'
petsc_arch = 'arch-mswin-c-opt'
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_abs = meson.project_source_root() / '..' / 'netcdf'
Expand All @@ -144,7 +137,7 @@ netcdff_compiled_abs = netcdf_dir_abs / netcdff_build

# on windows only with intel
if build_machine.system() == 'windows' and is_parallel_build
if fc_id != 'intel-cl'
if fc_id != 'intel-cl' and fc_id != 'intel-llvm-cl'
error('Parallel build on Windows only with intel compiler. Terminating...')
endif
endif
Expand All @@ -157,14 +150,10 @@ extended_incdir = [ ]
# load petsc, mpi, and netcdf dependencies/libraries
if is_parallel_build or is_extended_build
# find petsc
if build_machine.system() != 'windows'
petsc = dependency('PETSc', required : true)
else
# directly look for petsc
petsc = fc.find_library('libpetsc', dirs: petsc_compiled_abs / 'lib', required : true)
endif
petsc = dependency('PETSc', required : true)
extra_cmp_args += [ '-D__WITH_PETSC__' ]
dependencies += petsc

with_petsc = true

# find mpi
Expand Down Expand Up @@ -260,31 +249,6 @@ compile_args += extra_cmp_args
add_project_arguments(fc.get_supported_arguments(compile_args), language: 'fortran')
add_project_link_arguments(fc.get_supported_arguments(link_args), language: 'fortran')

if is_parallel_build and build_machine.system() == 'windows'
message('Compiling PETSc Fortran modules')
petsc_incdir = include_directories([petsc_dir_rel / 'include', petsc_compiled_rel / 'include'])
extended_incdir += ['..' / petsc_dir_rel / 'include', '..' / petsc_compiled_rel / 'include']
petsc_src = petsc_dir_abs / 'src'
sources_petsc = [petsc_src / 'dm/f90-mod/petscdmdamod.F90',
petsc_src / 'dm/f90-mod/petscdmmod.F90',
petsc_src / 'dm/f90-mod/petscdmplexmod.F90',
petsc_src / 'dm/f90-mod/petscdmswarmmod.F90',
petsc_src / 'ksp/f90-mod/petsckspdefmod.F90',
petsc_src / 'ksp/f90-mod/petsckspmod.F90',
petsc_src / 'ksp/f90-mod/petscpcmod.F90',
petsc_src / 'mat/f90-mod/petscmatmod.F90',
petsc_src / 'snes/f90-mod/petscsnesmod.F90',
petsc_src / 'sys/f90-mod/petscsysmod.F90',
petsc_src / 'sys/mpiuni/f90-mod/mpiunimod.F90',
petsc_src / 'tao/f90-mod/petsctaomod.F90',
petsc_src / 'ts/f90-mod/petsctsmod.F90',
petsc_src / 'vec/f90-mod/petscvecmod.F90',]
petsc_modules = static_library('petsc_modules',
sources_petsc,
dependencies: dependencies,
include_directories: petsc_incdir)
endif

# build mf6 and libmf6
buildname = get_option('buildname')
subdir('src')
Expand Down
19 changes: 19 additions & 0 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fix-python-style = { cmd = "pixi run check-python-lint --fix; pixi run fix-pytho

# meson build/test for mf6 and zbud6
builddir = "echo _builddir"
setup = { cmd = "meson setup --prefix=$(pwd) --libdir=bin --bindir=bin", env = { PKG_CONFIG_PATH = "$CONDA_PREFIX/lib/pkgconfig" } }
setup = { cmd = "meson setup --prefix=$(pwd) --libdir=bin --bindir=bin", env = { PKG_CONFIG_PATH = "$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" } }
build = "meson install -C"
test = "meson test --verbose --no-rebuild -C"

Expand Down Expand Up @@ -141,6 +141,9 @@ builddir = "echo _builddir_osx-64"
[target.osx-arm64.tasks]
builddir = "echo _builddir_osx-arm64"

[target.win-64.dependencies]
pkg-config = "*"

[target.win-64.tasks]
builddir = "echo _builddir_win-64"

Loading
Loading