summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrey Perestoronin <andrey.perestoronin@intel.com>2023-11-27 18:13:04 +0000
committerGitHub <noreply@github.com>2023-11-27 13:13:04 -0500
commit3d744e7c951eab4fa70b95c15c5cabc969dd47b3 (patch)
treeb29e266b290c96e6d2a3b75ce05e57423457f991 /lib
parentb4bafbbf7e41bd7b24791e3069565348ac86036b (diff)
downloadspack-3d744e7c951eab4fa70b95c15c5cabc969dd47b3.tar.gz
spack-3d744e7c951eab4fa70b95c15c5cabc969dd47b3.tar.bz2
spack-3d744e7c951eab4fa70b95c15c5cabc969dd47b3.tar.xz
spack-3d744e7c951eab4fa70b95c15c5cabc969dd47b3.zip
intel-oneapi 2024.0.0: added new version to packages (#41135)
* oneapi 2024.0.0 release * oneapi v2 directory support and some cleanups * sycl abi change requires 2024 compilers for packages that use sycl --------- Co-authored-by: Robert Cohn <robert.s.cohn@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/build_systems/inteloneapipackage.rst25
-rw-r--r--lib/spack/spack/build_systems/oneapi.py53
-rw-r--r--lib/spack/spack/compilers/oneapi.py12
3 files changed, 60 insertions, 30 deletions
diff --git a/lib/spack/docs/build_systems/inteloneapipackage.rst b/lib/spack/docs/build_systems/inteloneapipackage.rst
index e9fd26690f..ccf7d5e393 100644
--- a/lib/spack/docs/build_systems/inteloneapipackage.rst
+++ b/lib/spack/docs/build_systems/inteloneapipackage.rst
@@ -53,18 +53,24 @@ Install the oneAPI compilers::
Add the compilers to your ``compilers.yaml`` so spack can use them::
- spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
- spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
+ spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
Verify that the compilers are available::
spack compiler list
+Note that 2024 and later releases do not include ``icc``. Before 2024,
+the package layout was different::
+
+ spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
+ spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
+
The ``intel-oneapi-compilers`` package includes 2 families of
compilers:
* ``intel``: ``icc``, ``icpc``, ``ifort``. Intel's *classic*
- compilers.
+ compilers. 2024 and later releases contain ``ifort``, but not
+ ``icc`` and ``icpc``.
* ``oneapi``: ``icx``, ``icpx``, ``ifx``. Intel's new generation of
compilers based on LLVM.
@@ -89,8 +95,8 @@ Install the oneAPI compilers::
Add the compilers to your ``compilers.yaml`` so Spack can use them::
- spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin/intel64
- spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/linux/bin
+ spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
+ spack compiler add `spack location -i intel-oneapi-compilers`/compiler/latest/bin
Verify that the compilers are available::
@@ -146,8 +152,7 @@ Compilers
To use the compilers, add some information about the installation to
``compilers.yaml``. For most users, it is sufficient to do::
- spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
- spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
+ spack compiler add /opt/intel/oneapi/compiler/latest/bin
Adapt the paths above if you did not install the tools in the default
location. After adding the compilers, using them is the same
@@ -156,6 +161,12 @@ Another option is to manually add the configuration to
``compilers.yaml`` as described in :ref:`Compiler configuration
<compiler-config>`.
+Before 2024, the directory structure was different::
+
+ spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin/intel64
+ spack compiler add /opt/intel/oneapi/compiler/latest/linux/bin
+
+
Libraries
---------
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py
index f90312f579..234a4c9ae0 100644
--- a/lib/spack/spack/build_systems/oneapi.py
+++ b/lib/spack/spack/build_systems/oneapi.py
@@ -7,9 +7,9 @@ import getpass
import os
import platform
import shutil
-from os.path import basename, dirname, isdir
+from os.path import basename, isdir
-from llnl.util.filesystem import find_headers, find_libraries, join_path, mkdirp
+from llnl.util.filesystem import HeaderList, find_libraries, join_path, mkdirp
from llnl.util.link_tree import LinkTree
from spack.directives import conflicts, variant
@@ -56,9 +56,20 @@ class IntelOneApiPackage(Package):
raise NotImplementedError
@property
+ def v2_layout_versions(self):
+ """Version that implements the v2 directory layout."""
+ raise NotImplementedError
+
+ @property
+ def v2_layout(self):
+ """Returns true if this version implements the v2 directory layout."""
+ return self.spec.satisfies(self.v2_layout_versions)
+
+ @property
def component_prefix(self):
"""Path to component <prefix>/<component>/<version>."""
- return self.prefix.join(join_path(self.component_dir, self.spec.version))
+ v = self.spec.version.up_to(2) if self.v2_layout else self.spec.version
+ return self.prefix.join(self.component_dir).join(str(v))
@property
def env_script_args(self):
@@ -112,8 +123,9 @@ class IntelOneApiPackage(Package):
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(self.prefix, self.component_dir)):
- raise RuntimeError("install failed")
+ install_dir = self.component_prefix
+ if not isdir(install_dir):
+ raise RuntimeError("install failed to directory: {0}".format(install_dir))
def setup_run_environment(self, env):
"""Adds environment variables to the generated module file.
@@ -128,7 +140,7 @@ class IntelOneApiPackage(Package):
if "~envmods" not in self.spec:
env.extend(
EnvironmentModifications.from_sourcing_file(
- join_path(self.component_prefix, "env", "vars.sh"), *self.env_script_args
+ self.component_prefix.env.join("vars.sh"), *self.env_script_args
)
)
@@ -167,16 +179,21 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage):
"""
+ def header_directories(self, dirs):
+ h = HeaderList([])
+ h.directories = dirs
+ return h
+
@property
def headers(self):
- include_path = join_path(self.component_prefix, "include")
- return find_headers("*", include_path, recursive=True)
+ return self.header_directories(
+ [self.component_prefix.include, self.component_prefix.include.join(self.component_dir)]
+ )
@property
def libs(self):
- 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)
+ # for v2_layout all libraries are in the top level, v1 sometimes put them in intel64
+ return find_libraries("*", root=self.component_prefix.lib, recursive=not self.v2_layout)
class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
@@ -190,22 +207,12 @@ class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
"""
@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
+ return self.header_directories([self.component_prefix.sdk.include])
@property
def libs(self):
- return find_libraries("*", root=self.lib, shared=True, recursive=True)
+ return find_libraries("*", self.component_prefix.sdk.lib64)
class IntelOneApiStaticLibraryList:
diff --git a/lib/spack/spack/compilers/oneapi.py b/lib/spack/spack/compilers/oneapi.py
index fde6fa677a..63eb385983 100644
--- a/lib/spack/spack/compilers/oneapi.py
+++ b/lib/spack/spack/compilers/oneapi.py
@@ -6,6 +6,8 @@
import os
from os.path import dirname
+from llnl.util import tty
+
from spack.compiler import Compiler
@@ -135,3 +137,13 @@ class Oneapi(Compiler):
# Executable "sycl-post-link" doesn't exist!
if self.cxx:
env.prepend_path("PATH", dirname(self.cxx))
+
+ # 2024 release bumped the libsycl version because of an ABI
+ # change, 2024 compilers are required. You will see this
+ # error:
+ #
+ # /usr/bin/ld: warning: libsycl.so.7, needed by ...., not found
+ if pkg.spec.satisfies("%oneapi@:2023"):
+ for c in ["dnn"]:
+ if pkg.spec.satisfies(f"^intel-oneapi-{c}@2024:"):
+ tty.warn(f"intel-oneapi-{c}@2024 SYCL APIs requires %oneapi@2024:")