diff options
-rw-r--r-- | lib/spack/spack/build_systems/intel.py | 38 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/intel-parallel-studio/package.py | 2 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/intel/package.py | 2 |
3 files changed, 42 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/intel.py b/lib/spack/spack/build_systems/intel.py index 1cf7923fb4..6e4a2a970e 100644 --- a/lib/spack/spack/build_systems/intel.py +++ b/lib/spack/spack/build_systems/intel.py @@ -24,6 +24,7 @@ from llnl.util.filesystem import ( install, ) +import spack.error from spack.build_environment import dso_suffix from spack.package import InstallError, PackageBase, run_after from spack.util.environment import EnvironmentModifications @@ -1333,5 +1334,42 @@ class IntelPackage(PackageBase): debug_print(os.getcwd()) return + @property + def base_lib_dir(self): + """Provide the library directory located in the base of Intel installation. + """ + d = self.normalize_path('') + d = os.path.join(d, 'lib') + + debug_print(d) + return d + + @run_after('install') + def modify_LLVMgold_rpath(self): + """Add libimf.so and other required libraries to the RUNPATH of LLVMgold.so. + + These are needed explicitly at dependent link time when + `ld -plugin LLVMgold.so` is called by the compiler. + """ + if self._has_compilers: + LLVMgold_libs = find_libraries('LLVMgold', self.base_lib_dir, + shared=True, recursive=True) + # Ignore ia32 entries as they mostly ignore throughout the rest + # of the file. + # The first entry in rpath preserves the original, the seconds entry + # is the location of libimf.so. If this relative location is changed + # in compiler releases, then we need to search for libimf.so instead + # of this static path. + for lib in LLVMgold_libs: + if not self.spec.satisfies('^patchelf'): + raise spack.error.SpackError( + 'Attempting to patch RPATH in LLVMgold.so.' + + '`patchelf` dependency should be set in package.py' + ) + patchelf = Executable('patchelf') + rpath = ':'.join([patchelf('--print-rpath', lib, output=str).strip(), + '$ORIGIN/../compiler/lib/intel64_lin']) + patchelf('--set-rpath', rpath, lib) + # Check that self.prefix is there after installation run_after('install')(PackageBase.sanity_check_prefix) diff --git a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py index 3ab592980e..5554d8f5f1 100644 --- a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py +++ b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py @@ -13,6 +13,8 @@ class IntelParallelStudio(IntelPackage): maintainers = ['rscohn2'] + depends_on('patchelf', type='build') + # As of 2016, the product comes in three "editions" that vary by scope. # # In Spack, select the edition via the version number in the spec, e.g.: diff --git a/var/spack/repos/builtin/packages/intel/package.py b/var/spack/repos/builtin/packages/intel/package.py index 9d5998e8d9..301bfa0768 100644 --- a/var/spack/repos/builtin/packages/intel/package.py +++ b/var/spack/repos/builtin/packages/intel/package.py @@ -15,6 +15,8 @@ class Intel(IntelPackage): # Robert Cohn maintainers = ['rscohn2'] + depends_on('patchelf', type='build') + # Same as in ../intel-parallel-studio/package.py, Composer Edition, # but the version numbering in Spack differs. version('20.0.4', sha256='ac1efeff608a8c3a416e6dfe20364061e8abf62d35fbaacdffe3fc9676fc1aa3', url='https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17117/parallel_studio_xe_2020_update4_composer_edition.tgz') |