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>
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							b4bafbbf7e
						
					
				
				
					commit
					3d744e7c95
				
			@@ -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
 | 
			
		||||
---------
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,9 +7,9 @@
 | 
			
		||||
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
 | 
			
		||||
@@ -55,10 +55,21 @@ def component_dir(self):
 | 
			
		||||
        """Subdirectory for this component in the install prefix."""
 | 
			
		||||
        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 @@ def install_component(self, installer_path):
 | 
			
		||||
                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 @@ def setup_run_environment(self, env):
 | 
			
		||||
        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):
 | 
			
		||||
@@ -189,23 +206,13 @@ 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:
 | 
			
		||||
 
 | 
			
		||||
@@ -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 @@ def setup_custom_environment(self, pkg, env):
 | 
			
		||||
        #   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:")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user