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*
838 Diskussionen

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

drcolossus
Anfänger
3.093Aufrufe

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 Kudos
1 Lösung
drcolossus
Anfänger
2.938Aufrufe

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.

Lösung in ursprünglichem Beitrag anzeigen

8 Antworten
Viet_H_Intel
Moderator
2.999Aufrufe

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
Anfänger
2.981Aufrufe

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
Anfänger
2.978Aufrufe

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
Moderator
2.975Aufrufe

icpx will be compatible with Gnu version on your host. 

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

drcolossus
Anfänger
2.938Aufrufe

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
Anfänger
2.938Aufrufe

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
Anfänger
2.939Aufrufe

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
Moderator
2.926Aufrufe

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

Antworten