diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/intel-oneapi-compilers-classic/package.py | 50 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py | 19 |
2 files changed, 69 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers-classic/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers-classic/package.py new file mode 100644 index 0000000000..635d79c705 --- /dev/null +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers-classic/package.py @@ -0,0 +1,50 @@ +# 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 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 = [] + + for ver in ['2022.1.0', + '2022.0.2', + '2022.0.1', + '2021.4.0', + '2021.3.0', + '2021.2.0', + '2021.1.2']: + version(ver) + depends_on('intel-oneapi-compilers@' + 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, + 'compile', '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')) diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index aeb9482e4c..2d0807fd60 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -143,3 +143,22 @@ class IntelOneapiCompilers(IntelOneApiPackage): # Try to patch all files, patchelf will do nothing if # file should not be patched subprocess.call(['patchelf', '--set-rpath', rpath, file]) + + 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 + """ + super(IntelOneapiCompilers, self).setup_run_environment(env) + + bin = join_path(self.component_path, 'linux', 'bin') + env.set('CC', join_path(bin, 'icx')) + env.set('CXX', join_path(bin, 'icpx')) + env.set('F77', join_path(bin, 'ifx')) + env.set('FC', join_path(bin, 'ifx')) |