Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
879 討論

C++20 #include <concepts>, oneAPI 2025.1 Linux

drcolossus
新手
4,868 檢視

In oneAPI 2025.1, the attached test program fails to compile as-is ("icpx -c concept.cpp")

It complains about the include file not being found.

I can get the code to compile by including the absolute path to concepts.hpp, but I shouldn't have to. Also, the above code works fine in oneAPI 2024.1. Is there a trick to using C++20 concepts in 2025.1?

#include <concepts>

double add(double x, double y) {
return x + y;
}

 

0 積分
1 解決方案
drcolossus
新手
4,713 檢視

In fact there's a note on this specific symptom here.

So I guess the guidance for my user is to use gcc-toolset-10 or later when using 2025.0. For 2024 or earlier it appears that you can use RHEL8's default GCC 8.5.

在原始文章中檢視解決方案

8 回應
Viet_H_Intel
主席
4,774 檢視

I don't think we have released oneAPI2025.1.

The test case compiled with oneAPI2025.0.1. 

$ icpx concept.cpp -c -V
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2025.0.4 Build 20241205
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

$ cat concept.cpp
#include <concepts>

double add(double x, double y) {
return x + y;
}

Which gcc version you have on your host?

drcolossus
新手
4,756 檢視

Thanks for your reply. Our IT people installed it under the name "oneAPI 2025.1" but it appears to actually be 2025.0.1:

 

$ icpx concepts.cpp -c -V
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2025.0.4 Build 20241205
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

 

As for gcc, I'm using the base RHEL 8.1 compilers:

 

$ gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

drcolossus
新手
4,753 檢視

One curious observation is that while our 2024.1 folder has these two files named "concepts*":


$MKL_ROOT/include/oneapi/mkl/lapack/concepts.hpp
$DPL_ROOT/include/pstl_offload/concepts

Our 2025.0 folder only has this one:

 

$MKL_ROOT/include/oneapi/mkl/lapack/concepts.hpp

 

As far as I can tell, the IT dept selected all of the available options when installing. Could the installer have silently skipped installing the SYCL offload packages for some reason?

Viet_H_Intel
主席
4,750 檢視

icpx will be compatible with Gnu version on your host. 

Will you get the same error if you do "g++ concept.cpp -c"?

drcolossus
新手
4,713 檢視

It doesn't work on g++ either:

$ g++ --version
g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)
Copyright (C) 2018 Free Software Foundation, Inc.

 

$ g++ -c concepts.cpp
concepts.cpp:1:10: fatal error: concepts: No such file or directory
#include <concepts>
^~~~~~~~~~
compilation terminated.

 

 

drcolossus
新手
4,713 檢視

Aha! If I enable RHEL8's gcc-toolset-10 or later it works! It does not work with gcc-toolset-9 or the stock gcc 8.5. The oneAPI 2025.0 system requirements say that GCC 7.5 ought to be good enough, but that does not seem to be the case.

 

gcc-toolset-10 provides the concepts file, but gcc-toolset-9 does not:

$ rpm -ql gcc-toolset-9-libstdc++-devel | grep concepts

$ rpm -ql gcc-toolset-10-libstdc++-devel | grep concepts
/opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/iterator_concepts.h
/opt/rh/gcc-toolset-10/root/usr/include/c++/10/concepts

drcolossus
新手
4,714 檢視

In fact there's a note on this specific symptom here.

So I guess the guidance for my user is to use gcc-toolset-10 or later when using 2025.0. For 2024 or earlier it appears that you can use RHEL8's default GCC 8.5.

Viet_H_Intel
主席
4,701 檢視

For 2024 or earlier it appears that you can use RHEL8's default GCC 8.5.

I doubt that oneAPI2024.* won't error out with gcc8.5

回覆