From 0583a84598a002ea99247506d41b3e8b302b2437 Mon Sep 17 00:00:00 2001 From: Abhinav Singh <73834077+abhinavsns@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:46:05 -0400 Subject: [PATCH] open-mpi: force build with brewed GCC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set ENV["CC"] and ENV["CXX"] to the Homebrew GCC shims (gcc-, g++-) so that Open MPI always compiles with the brewed GNU toolchain rather than Apple’s Clang. This prevents breakage of GCC’s fixed headers on Xcode/Clang upgrades and ensures ABI consistency for downstream MPI-using formulae (e.g. PETSc, Trilinos) that rely on gfortran and MPI wrappers. Bump revision to rebuild bottles under the new settings. --- Formula/o/open-mpi.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Formula/o/open-mpi.rb b/Formula/o/open-mpi.rb index 5c52a5d7a8592..db882299749a3 100644 --- a/Formula/o/open-mpi.rb +++ b/Formula/o/open-mpi.rb @@ -29,6 +29,7 @@ class OpenMpi < Formula end depends_on "gcc" # for gfortran + fails_with :clang depends_on "hwloc" depends_on "libevent" depends_on "pmix" @@ -50,8 +51,8 @@ def install ompi/tools/ompi_info/param.c oshmem/tools/oshmem_info/param.c ] - cxx = OS.linux? ? "g++" : ENV.cxx - cc = OS.linux? ? "gcc" : ENV.cc + cxx = ENV.cxx + cc = ENV.cc inreplace inreplace_files, "OMPI_CXX_ABSOLUTE", "\"#{cxx}\"" inreplace inreplace_files, "OPAL_CC_ABSOLUTE", "\"#{cc}\"" inreplace "3rd-party/prrte/src/tools/prte_info/param.c", "PRTE_CC_ABSOLUTE", "\"#{cc}\"" @@ -74,6 +75,7 @@ def install system "./configure", *args, *std_configure_args system "make", "all" + system "make", "check" system "make", "install"