Skip to content

Commit

Permalink
open-mpi: Use new Apple linker for mpicc/mpicxx
Browse files Browse the repository at this point in the history
A flag to force the ld_classic linker was added in #144554 to avoid issues with Xcode 15. However, some time between then and now (Xcode 15.3 and macOS Sonoma 14.4.1) the new linker seems to work for C/C++, although the Fortran test still fails when ld_new is used. In this PR, I have limited the ld_classic flag to only apply to mpifort wrapper compiler. My motivation for switching to the new linker for C++ is that it solves linker failures when I try to compile my C++ project with mpicxx -flto=auto and g++-14 as the host compiler.
  • Loading branch information
lukeshingles committed May 12, 2024
1 parent 55e55c9 commit 43adb7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Formula/o/open-mpi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class OpenMpi < Formula
url "https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.3.tar.bz2"
sha256 "990582f206b3ab32e938aa31bbf07c639368e4405dca196fabe7f0f76eeda90b"
license "BSD-3-Clause"
revision 1

livecheck do
url :homepage
Expand Down Expand Up @@ -78,7 +79,7 @@ def install

# Work around asm incompatibility with new linker (FB13194320)
# https://github.com/open-mpi/ompi/issues/11935
args << "--with-wrapper-ldflags=-Wl,-ld_classic" if DevelopmentTools.clang_build_version >= 1500
args << "--with-wrapper-fcflags=-Wl,-ld_classic" if DevelopmentTools.clang_build_version >= 1500

system "./autogen.pl", "--force" if build.head?
system "./configure", *std_configure_args, *args
Expand Down

0 comments on commit 43adb7c

Please sign in to comment.