Hi,

I'm getting a build failure when building Open MPI 5.0.9 with LLVM 
compilers on macOS (Apple Silicon). Configure succeeds, but make fails when 
linking:

```
flang-21: error: unknown argument: '-compatibility_version'
flang-21: error: unknown argument: '-current_version'
flang-21: error: no such file or directory: '81'
flang-21: error: no such file or directory: '81.3'
make[3]: *** [libmpi_usempif08.la] Error 1
```

I believe this error comes from config/ltmain_flang_darwin.diff. The patch 
has three hunks that add flang-specific handling for Darwin linker flags. 
Hunks 1 and 3 match against $CC directly using `case $CC in flang*)`, which 
fails when the Fortran compiler is specified as a full path (e.g., 
/opt/homebrew/opt/flang/bin/flang). Hunk 2 correctly uses `func_cc_basename 
$CC` before matching, so it doesn't have this problem.

*Environment:*

   - macOS 26.2 (Darwin 25.2.0), aarch64 (Apple M1 Pro)
   - Homebrew clang/clang++/flang 21.1.8
   - Open MPI 5.0.9

*Configure command:*
*```*
$ ./configure \
      CC=/opt/homebrew/opt/llvm/bin/clang \
      CPPFLAGS=-I/opt/homebrew/opt/llvm/include \
      CXX=/opt/homebrew/opt/llvm/bin/clang++ \
      CXXCPPFLAGS=-I/opt/homebrew/opt/llvm/include \
      FC=flang \
      LDFLAGS="-L/opt/homebrew/opt/llvm/lib 
-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind 
-lunwind" \
      --with-hwloc=/opt/homebrew/opt/hwloc \
      --with-libevent=/opt/homebrew/opt/libevent \
      --with-pmix=/opt/homebrew/opt/pmix
*```*

*Build output:* 
https://www.icloud.com/iclouddrive/00dSkBghSZdP0-MRsCPN7M7pw#ompi-output (let 
me know if you cannot access this, and I'll resubmit using a different 
service)

*Workaround:* Use `FC=flang` (bare name) instead of the full path, with 
/opt/homebrew/opt/flang/bin in $PATH.

*Suggested fix:* Update hunks 1 and 3 in config/ltmain_flang_darwin.diff to 
use `func_cc_basename $CC` and `$func_cc_basename_result` instead of 
matching $CC directly, consistent with hunk 2.

If this is indeed a bug and not intentional, I'd be happy to submit an 
issue/PR on GitHub if you can advise on the preferred approach. I wasn't 
sure whether to regenerate the diff against a specific libtool version or 
patch it directly.

Thanks,
Matthew Mehrtens

To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].

Reply via email to