Skip to content

Commit 45ce9ee

Browse files
author
Test User
committed
Bug fix in var/spack/repos/builtin/packages/met/package.py: add missing rpath for Python libraries to all binaries built by met (post-install)
1 parent 1a0befe commit 45ce9ee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

var/spack/repos/builtin/packages/met/package.py

+9
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Met(AutotoolsPackage):
6363
depends_on("py-numpy", when="+python", type=("build", "run"))
6464
depends_on("py-xarray", when="+python", type=("build", "run"))
6565
depends_on("py-pandas", when="+python", type=("build", "run"))
66+
depends_on("patchelf@0.13:", when="platform=linux", type="build")
6667

6768
patch("openmp_shape_patch.patch", when="@10.1.0")
6869

@@ -182,6 +183,14 @@ def configure_args(self):
182183

183184
return args
184185

186+
@run_after("install", when="platform=linux")
187+
def fixup_rpaths(self):
188+
# set rpaths of binaries Python's lib directory
189+
rpaths = self.spec["python"].libs.directories
190+
191+
for binary in find(self.prefix.bin, "*"):
192+
patchelf = Executable("patchelf")
193+
patchelf("--add-rpath", ":".join(rpaths), binary)
185194

186195
# def setup_run_environment(self, env):
187196
# env.set('MET_BASE', self.prefix)

0 commit comments

Comments
 (0)