summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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,
)