Sourcing oneAPI setvars overrides existing clang/clang++ drivers

Published: 08/24/2021

Problem Statement

Setting up your oneAPI environment by sourcing setvars.sh on Linux* or setvars.bat on Windows* from Intel® oneAPI Base Toolkit or Intel® oneAPI HPC Toolkit places Intel provided clang/clang++ compiler drivers first in the system binary search path (PATH environment variable).  This can override system provided open source clang/clang++ drivers that may be installed on your system.

Reasoning:

Intel® DPC++/C++ Compiler today reuses the clang and clang++ compiler driver names in our oneAPI Base and HPC Toolkit installations.  These are invoked by our compiler drivers ICX/ICL and ICPX today as part of our compilation process. The oneAPI provided clang/clang++ drivers were not intended to be used by customers but need to be in PATH for our recommended drivers ICX/ICL and ICPX to use.  As a side effect, in setting up the environment for Intel® oneAPI, PATH was modified for our implementation of clang/clang++ to be found first in PATH. For customers who  also using the open source llvm.org offering and Intel® DPC++/C++ Compiler, this means that they cannot just directly invoke clang/clang++ drivers and expect the llvm.org variant to be used after sourcing the Intel® oneAPI environment.

Workaround:

If you intend to use your open source llvm.org clang/clang++ please use an environment that does not source the Intel® oneAPI setvars scripts.  As an alternative, after sourcing the setvars.sh or setvars.bat shipped with Intel® oneAPI, please update the PATH environment variable such that the system compiler driver paths comes first in the PATH.

Fix:

Intel Engineers are working on renaming the clang and clang++ usage with Intel® DPC++/C++ Compiler toolchain. This change will be available in furture release in late 2021. Until then we highly recommend the above workarounds.

 

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.