Skip to content

macOS build failure due to use of ld -r and injected rpaths by mpi compiler wrapper #163

@haampie

Description

@haampie

This is not a Spack bug, it's an issue with openmpi configured with --enable-wrapper-rpath --with-wrapper-ldflags=/path/to/something, which I think is common enough. It tells openmpi to add certain default rpaths (e.g. to gcc runtime libraries).

The issue is

mpic++ -r ...

invokes

clang++ -r -Wl,-rpath,/path/to/something

which calls the linker

ld -r -rpath /path/to/something

which pedantically errors out because -rpath does not apply when creating a new object file with -r.


So:

  1. The issue is caused by OpenMPI's compiler wrapper adding -rpath even if -r is passed.
  2. Maybe parallel-netcdf should just create a static archive with ar instead of combining into an object file with ld -r, since there's tons of other compiler wrappers that could add rpaths and are unaware of ld -r.

Originally posted by @haampie in #155

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions