summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/oneapi.py10
-rw-r--r--lib/spack/spack/test/compilers/detection.py5
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/spack/spack/compilers/oneapi.py b/lib/spack/spack/compilers/oneapi.py
index a28259c02c..bf5c7767e9 100644
--- a/lib/spack/spack/compilers/oneapi.py
+++ b/lib/spack/spack/compilers/oneapi.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from os.path import dirname
+
from spack.compiler import Compiler
@@ -105,3 +107,11 @@ class Oneapi(Compiler):
@property
def stdcxx_libs(self):
return ('-cxxlib', )
+
+ def setup_custom_environment(self, pkg, env):
+ # workaround bug in icpx driver where it requires sycl-post-link is on the PATH
+ # It is located in the same directory as the driver. Error message:
+ # clang++: error: unable to execute command:
+ # Executable "sycl-post-link" doesn't exist!
+ if self.cxx:
+ env.prepend_path('PATH', dirname(self.cxx))
diff --git a/lib/spack/spack/test/compilers/detection.py b/lib/spack/spack/test/compilers/detection.py
index 8bc3285d43..6eaced6b6d 100644
--- a/lib/spack/spack/test/compilers/detection.py
+++ b/lib/spack/spack/test/compilers/detection.py
@@ -204,6 +204,11 @@ def test_intel_version_detection(version_str, expected_version):
'Copyright (C) 1985-2021 Intel Corporation. All rights reserved.',
'2021.4.0'
),
+ ( # IFX
+ 'ifx (IFORT) 2022.0.0 20211123\n'
+ 'Copyright (C) 1985-2021 Intel Corporation. All rights reserved.',
+ '2022.0.0'
+ ),
])
def test_oneapi_version_detection(version_str, expected_version):
version = spack.compilers.oneapi.Oneapi.extract_version_from_output(