Conversation
Local AMR PETSc builds on macOS were failing in PETSc configure because the pixi OpenMPI toolchain was not coherent for mixed C/C++/Fortran checks. The local build path previously relied on --with-mpi-dir alone, which left PETSc to pick up a combination of conda compiler environment variables, OpenMPI wrapper defaults, Apple clang, and pixi gfortran settings. On Apple Silicon this surfaced as mpif90 wrapper failures, misleading standard-header and math-check failures, and mixed-link problems during PETSc configure. Add a macOS/OpenMPI-specific setup path that runs for local builds only. It selects an external gfortran (preferring Homebrew), derives SDKROOT and the macOS deployment target from that Fortran toolchain, clears conflicting pixi/conda compiler environment variables, and forces the OpenMPI wrappers onto /usr/bin/clang, /usr/bin/clang++, and the chosen gfortran with explicit OMPI_*FLAGS. Also pass mpicc/mpicxx/mpif90 explicitly to PETSc configure for local builds and reuse the same setup for PETSc build, test, and petsc4py installation so the wrapper/compiler selection stays consistent across the full local PETSc workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the local macOS OpenMPI PETSc build setup use a coherent compiler/toolchain configuration.
Motivation
On macOS, local OpenMPI PETSc builds can mix pixi/conda compiler wrappers, Apple clang, Homebrew gfortran, and SDK/deployment-target settings. That can produce an inconsistent PETSc configure/build environment.
Changes
CLUSTER=local, Darwin, and OpenMPI.Scope
This path is local macOS/OpenMPI-specific. It should not affect Gadi/HPC builds, Linux local builds, or MPICH builds.
Local environment where this was needed