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
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:
- The issue is caused by OpenMPI's compiler wrapper adding
-rpath even if -r is passed.
- 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