Skip to content

Latest Xcode update has broken MPI builds on macOS #975

@perazz

Description

@perazz

Description

mpif90 -showme:compile requires these flags
-I/opt/homebrew/Cellar/open-mpi/4.1.5/include -Wl,-flat_namespace -Wl,-commons,use_dylibs -I/opt/homebrew/Cellar/open-mpi/4.1.5/lib

But the commons flag is not recognized by ld anymore. For example, with the example MPI packags

federico@Federicos-MBP metapackage_mpi % fpm build
 + which mpiexec
/opt/homebrew/bin/mpiexec
test_mpi                               failed.
[100%] Compiling...
ld: unknown options: -commons -commons
collect2: error: ld returned 1 exit status
<ERROR> Compilation failed for object " test_mpi "
<ERROR> stopping due to failed compilation
STOP 1

This is likely the same issue as pmodels/mpich#6684 Intel forum

I fear the only way to solve this issue is to conditionally remove those flags based on the current OS and MPI version, not exactly nice, at least until a new OpenMPI homebrew release will fix this.

Expected Behaviour

Should just work

Version of fpm

0.9.0, alpha

Platform and Architecture

MacOS 14, homebrew OpenMPI 4.1.5

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions