1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
@IntelOneApiPackage.update_description
class IntelOneapiCompilersClassic(Package):
"""Relies on intel-oneapi-compilers to install the compilers, and
configures modules for icc/icpc/ifort.
"""
maintainers = ["rscohn2"]
homepage = "https://software.intel.com/content/www/us/en/develop/tools/oneapi.html"
has_code = False
phases = []
# Versions before 2021 are in the `intel` package
# intel-oneapi versions before 2022 use intel@19.0.4
for ver, oneapi_ver in {
"2021.1.2": "2021.1.2",
"2021.2.0": "2021.2.0",
"2021.3.0": "2021.3.0",
"2021.4.0": "2021.4.0",
"2021.5.0": "2022.0.1:2022.0.2",
"2021.6.0": "2022.1.0",
"2021.7.0": "2022.2.0",
}.items():
version(ver)
depends_on("intel-oneapi-compilers@" + oneapi_ver, when="@" + ver, type="run")
def setup_run_environment(self, env):
"""Adds environment variables to the generated module file.
These environment variables come from running:
.. code-block:: console
$ source {prefix}/{component}/{version}/env/vars.sh
and from setting CC/CXX/F77/FC
"""
bin = join_path(
self.spec["intel-oneapi-compilers"].prefix,
"compiler",
self.spec["intel-oneapi-compilers"].version,
"linux",
"bin",
"intel64",
)
env.set("CC", join_path(bin, "icc"))
env.set("CXX", join_path(bin, "icpc"))
env.set("F77", join_path(bin, "ifort"))
env.set("FC", join_path(bin, "ifort"))
|