From 16da648d03564871ade5fcce09dc45171b706b8c Mon Sep 17 00:00:00 2001 From: Ben Morgan Date: Tue, 28 Jan 2020 20:57:25 +0000 Subject: [PATCH] intel-tbb: Fix install names on Darwin (#14650) * intel-tbb: Fix install names on Darwin Intel-TBB's libraries on Darwin are installed with "@rpath" prefixed to their install names. This was found to cause issues building the root package on Darwin due to libtbb not being found when running some of the generated tools linking to it. Follow example from other packages with the same issue and fixup up install names for intel-tbb post install. * intel-tbb: fix flake8 errors --- var/spack/repos/builtin/packages/intel-tbb/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/intel-tbb/package.py b/var/spack/repos/builtin/packages/intel-tbb/package.py index d299f7f9fb..2cbda4f5a4 100644 --- a/var/spack/repos/builtin/packages/intel-tbb/package.py +++ b/var/spack/repos/builtin/packages/intel-tbb/package.py @@ -7,6 +7,7 @@ import glob import inspect import platform +import sys class IntelTbb(Package): @@ -201,3 +202,9 @@ def install(self, spec, prefix): 'tbb_config_generator.cmake') with working_dir(join_path(self.stage.source_path, 'cmake')): inspect.getmodule(self).cmake(*cmake_args) + + @run_after('install') + def darwin_fix(self): + # Replace @rpath in ids with full path + if sys.platform == 'darwin': + fix_darwin_install_name(self.prefix.lib)