From 15d96f01660057463863a05049b287df3341175e Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 30 Jul 2018 13:02:09 -0600 Subject: Add extra_rpaths to OpenMPI wrappers (#8687) If the OpenMPI build finds the infiniband drivers in /usr/lib64, it adds -Wl,-rpath -Wl,/usr/lib64 to the OpenMPI wrappers. If the wrappers are using a compiler outside of /usr, and the OpenMPI wrappers are used to build software outside of Spack, they will rpath /usr/lib64 into the executable which then has GLIBC, GLIBCXX runtime errors due to it picking up GCC libraries in /usr/lib64. This adds the directories specified in "extra_rpaths" to the OpenMPI wrappers, which allows them to use the correct compiler when invoked outside of Spack builds. --- var/spack/repos/builtin/packages/openmpi/package.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/openmpi/package.py b/var/spack/repos/builtin/packages/openmpi/package.py index e276528f21..79ad131132 100644 --- a/var/spack/repos/builtin/packages/openmpi/package.py +++ b/var/spack/repos/builtin/packages/openmpi/package.py @@ -342,6 +342,13 @@ class Openmpi(AutotoolsPackage): '--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 -- cgit v1.2.3-70-g09d2