diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_systems/oneapi.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index 76c69acd5e..c0da2fdb53 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -45,17 +45,15 @@ class IntelOneApiPackage(Package): raise NotImplementedError @property - def component_path(self): + def component_prefix(self): """Path to component <prefix>/<component>/<version>.""" - return join_path(self.prefix, self.component_dir, str(self.spec.version)) + return self.prefix.join(join_path(self.component_dir, self.spec.version)) - def install(self, spec, prefix, installer_path=None): - """Shared install method for all oneapi packages.""" + def install(self, spec, prefix): + self.install_component(basename(self.url_for_version(spec.version))) - # intel-oneapi-compilers overrides the installer_path when - # installing fortran, which comes from a spack resource - if installer_path is None: - installer_path = basename(self.url_for_version(spec.version)) + def install_component(self, installer_path): + """Shared install method for all oneapi packages.""" if platform.system() == 'Linux': # Intel installer assumes and enforces that all components @@ -77,7 +75,7 @@ class IntelOneApiPackage(Package): bash = Executable('bash') # Installer writes files in ~/intel set HOME so it goes to prefix - bash.add_default_env('HOME', prefix) + bash.add_default_env('HOME', self.prefix) # Installer checks $XDG_RUNTIME_DIR/.bootstrapper_lock_file as well bash.add_default_env('XDG_RUNTIME_DIR', join_path(self.stage.path, 'runtime')) @@ -85,13 +83,13 @@ class IntelOneApiPackage(Package): bash(installer_path, '-s', '-a', '-s', '--action', 'install', '--eula', 'accept', - '--install-dir', prefix) + '--install-dir', self.prefix) if getpass.getuser() == 'root': shutil.rmtree('/var/intel/installercache', ignore_errors=True) # Some installers have a bug and do not return an error code when failing - if not isdir(join_path(prefix, self.component_dir)): + if not isdir(join_path(self.prefix, self.component_dir)): raise RuntimeError('install failed') def setup_run_environment(self, env): @@ -104,7 +102,7 @@ class IntelOneApiPackage(Package): $ source {prefix}/{component}/{version}/env/vars.sh """ env.extend(EnvironmentModifications.from_sourcing_file( - join_path(self.component_path, 'env', 'vars.sh'))) + join_path(self.component_prefix, 'env', 'vars.sh'))) class IntelOneApiLibraryPackage(IntelOneApiPackage): @@ -118,12 +116,12 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage): @property def headers(self): - include_path = join_path(self.component_path, 'include') + include_path = join_path(self.component_prefix, 'include') return find_headers('*', include_path, recursive=True) @property def libs(self): - lib_path = join_path(self.component_path, 'lib', 'intel64') + lib_path = join_path(self.component_prefix, 'lib', 'intel64') lib_path = lib_path if isdir(lib_path) else dirname(lib_path) return find_libraries('*', root=lib_path, shared=True, recursive=True) |