diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index e276528f212..79ad1311327 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -342,6 +342,13 @@ def configure_args(self): '--enable-shared', ] + # Add extra_rpaths dirs from compilers.yaml into link wrapper + rpaths = [self.compiler.cc_rpath_arg + path + for path in self.compiler.extra_rpaths] + config_args.extend([ + '--with-wrapper-ldflags={0}'.format(' '.join(rpaths)) + ]) + # According to this comment on github: # # https://github.com/open-mpi/ompi/issues/4338#issuecomment-383982008