summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Abraham <Mark.J.Abraham@gmail.com>2023-11-17 15:59:04 +0100
committerGitHub <noreply@github.com>2023-11-17 14:59:04 +0000
commitec8bd38c4e79646af4683659266e1ba2e886e9a9 (patch)
treeabce2a934089d28539e7cd7e4fbec162c888e502 /lib
parent81e73b4dd4ea0bf6c6947359d3cee9d4270df13d (diff)
downloadspack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.gz
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.bz2
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.xz
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.zip
Permit packages that depend on Intel oneAPI packages to access sdk (#41117)
* Permit packages that depend on Intel oneAPI packages to access sdk * Implement and use IntelOneapiLibraryPackageWithSdk * Restore libs property to IntelOneapiLibraryPackage * Conform to style * Provide new class to infrastructure * Treat sdk/include as the main include
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/oneapi.py29
-rw-r--r--lib/spack/spack/package.py1
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py
index 4c432c0cac..f90312f579 100644
--- a/lib/spack/spack/build_systems/oneapi.py
+++ b/lib/spack/spack/build_systems/oneapi.py
@@ -179,6 +179,35 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage):
return find_libraries("*", root=lib_path, shared=True, recursive=True)
+class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
+ """Base class for Intel oneAPI library packages with SDK components.
+
+ Contains some convenient default implementations for libraries
+ that expose functionality in sdk subdirectories.
+ Implement the method directly in the package if something
+ different is needed.
+
+ """
+
+ @property
+ def include(self):
+ return join_path(self.component_prefix, "sdk", "include")
+
+ @property
+ def headers(self):
+ return find_headers("*", self.include, recursive=True)
+
+ @property
+ def lib(self):
+ lib_path = join_path(self.component_prefix, "sdk", "lib64")
+ lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
+ return lib_path
+
+ @property
+ def libs(self):
+ return find_libraries("*", root=self.lib, shared=True, recursive=True)
+
+
class IntelOneApiStaticLibraryList:
"""Provides ld_flags when static linking is needed
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 79df48cd17..f38ebec299 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -52,6 +52,7 @@ from spack.build_systems.octave import OctavePackage
from spack.build_systems.oneapi import (
INTEL_MATH_LIBRARIES,
IntelOneApiLibraryPackage,
+ IntelOneApiLibraryPackageWithSdk,
IntelOneApiPackage,
IntelOneApiStaticLibraryList,
)