Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
418 Discussions

OneAPI 2023.0 wont work with CMake

ShmarvDogg
Beginner
2,066 Views

Intel icpx fails with CMake with lots of different errors and refuses to work. I fix one and another pops up... Its a complete mess and completely unusable. I have tried to fix every error I keep getting with this toolkit but it is unusable with CMake for me as it always finds a way to fail or break. I have followed Installation instructions perfectly and it just does not want to work. I cant find a fix for the error it gives me. It should work according to:

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-setup/use-the-command-line/use-cmake-with-the-compiler.html

 

Here is my cmake:

cmake_minimum_required(VERSION 3.23.0)

project(TestingDPCPP LANGUAGES CXX)

find_package(IntelDPCPP REQUIRED)

add_executable(${PROJECT_NAME} main.cpp)

 

The error I get:

shmarvdogg@nuc11extremea770:~/TestingDPCPP$ cmake CMakeLists.txt -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
-- The CXX compiler identification is IntelLLVM 2023.0.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx
-- Check for working CXX compiler: /opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx - broken
CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63 (message):
The C++ compiler

"/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeScratch/TryCompile-BDAPI3

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_3ba2d/fast && /usr/bin/gmake -f CMakeFiles/cmTC_3ba2d.dir/build.make CMakeFiles/cmTC_3ba2d.dir/build
gmake[1]: Entering directory '/home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeScratch/TryCompile-BDAPI3'
Building CXX object CMakeFiles/cmTC_3ba2d.dir/testCXXCompiler.cxx.o
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx -MD -MT CMakeFiles/cmTC_3ba2d.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_3ba2d.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_3ba2d.dir/testCXXCompiler.cxx.o -c /home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeScratch/TryCompile-BDAPI3/testCXXCompiler.cxx
Linking CXX executable cmTC_3ba2d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3ba2d.dir/link.txt --verbose=1
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx CMakeFiles/cmTC_3ba2d.dir/testCXXCompiler.cxx.o -o cmTC_3ba2d
/usr/bin/ld: cannot find -lstdc++: No such file or directory
icpx: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [CMakeFiles/cmTC_3ba2d.dir/build.make:100: cmTC_3ba2d] Error 1
gmake[1]: Leaving directory '/home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeScratch/TryCompile-BDAPI3'
gmake: *** [Makefile:127: cmTC_3ba2d/fast] Error 2

 

 

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
See also "/home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeOutput.log".
See also "/home/shmarvdogg/TestingDPCPP/CMakeFiles/CMakeError.log".

0 Kudos
5 Replies
SeshaP_Intel
Moderator
2,009 Views

Hi,

 

Thank you for posting in Intel Communities.

 

Could you please remove the below line in the CMakeLists.txt file and let us know the results?

 

find_package(IntelDPCPP REQUIRED)

 

We have tried to build a hello world C++ program. We have not found any issues with CMake.

Please find the below output screenshot and TestingDPCPP.zip file for more details.

SeshaP_Intel_0-1675101490497.png

If the above workaround did not resolve your issue, could you please share the complete reproducer file and the steps to reproduce your issue?

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
ShmarvDogg
Beginner
1,878 Views

Hi there, it is a bug that I have been told is going to be fixed in a release soon. The issue was it was defaulting to GCC12 over 11 which I did not have some build tools installed for but the compiler was not saying this. Figured it out after many hours of debugging.

0 Kudos
SeshaP_Intel
Moderator
1,945 Views

Hi,


Has the information provided above helped? If yes, could you please confirm whether we can close this thread from our end?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
1,897 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
StephanRohr
Employee
1,806 Views

I also encountered the issue on Ubuntu22. The issue could be fixed by removing the gcc-12 package.

0 Kudos
Reply