Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

oneapi failts to compile - not found libstdC++

dherminderkainth
Beginner
4,442 Views

 

Hi I have downloaded and installed the intel oneapi to access intel C++ compiler on a Ubuntu linux 22.04 laptop.
The installation seems to be successful (no errors / warnings); i have then tried to run an example (SimpleAdd) - as per the oneapi-cli tool
and get the following message:
 
- 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.22/Modules/CMakeTestCXXCompiler.cmake:62 (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/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeTmp
   
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_eee68/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_eee68.dir/build.make CMakeFiles/cmTC_eee68.dir/build
    gmake[1]: Entering directory '/home/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_eee68.dir/testCXXCompiler.cxx.o
    /opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx    -MD -MT CMakeFiles/cmTC_eee68.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_eee68.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_eee68.dir/testCXXCompiler.cxx.o -c /home/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_eee68
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eee68.dir/link.txt --verbose=1
    /opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx CMakeFiles/cmTC_eee68.dir/testCXXCompiler.cxx.o -o cmTC_eee68
    /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_eee68.dir/build.make:100: cmTC_eee68] Error 1
    gmake[1]: Leaving directory '/home/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:127: cmTC_eee68/fast] Error 2
   
   

 

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


-- Configuring incomplete, errors occurred!
See also "/home/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeOutput.log".
See also "/home/dsk11/C++Libraries/intel/simple-add/build/CMakeFiles/CMakeError.log".
 
 
Could you give me some idea on how to resolve this ? 
 
I have a full functioning gcc  / g++ install and i have libstdc++6.0 installed.
thanks

 

Dherminder

0 Kudos
22 Replies
SeshaP_Intel
Moderator
4,139 Views

Hi,


Thank you for posting in Intel Communities.


Could you please try re-installing the oneAPI Base toolkit and let us know if you still face any issues?

Have you tried to build the oneAPI CLI Samples using the below link?

https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-base-linux/top/run-a-sample-project-using-the-command-line.html


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
4,079 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
dherminderkainth
Beginner
4,074 Views

My apologies - i had replied to the email.

I have done as you suggest - reinstalled oneapi. I also use the examples exactly as per the link - and still no joy.

Not sure what to do.

0 Kudos
SeshaP_Intel
Moderator
4,045 Views

Hi,


Have you installed the 'Desktop development with C++' component while installing Microsoft Visual Studio?

Which Visual Studio version you are using? You can check the compatibility of Intel compilers with Microsoft Visual Studio from the below link.

https://www.intel.com/content/www/us/en/developer/articles/reference-implementation/intel-compilers-compatibility-with-microsoft-visual-studio-and-xcode.html

Please try to reinstall the Intel oneAPI Base Toolkit and Intel oneAPI HPC Toolkit after successful uninstallation.

Please provide the hardware details and the cmake version you are using if the issue still persists.


Thanks and Regards,

Pendyala Sesha Srinivas



0 Kudos
dherminderkainth
Beginner
4,034 Views

Hi,

 

As I mentioned in my original post - i am on a ubuntu 22.04 linux machine - not on windows.  I am using cmake version 3.22.1

The machine is a dell precision laptop

thanks

Dherminder

 

0 Kudos
SeshaP_Intel
Moderator
3,962 Views

Hi,


>>> As I mentioned in my original post - i am on a ubuntu 22.04 linux machine - not on windows. I am using cmake version 3.22.1

Ubuntu 22.04 and CMake 3.22.1 versions are supported.


Have you installed the 'Desktop development with C++' component while installing Microsoft Visual Studio?

Have you tried to reinstall the Intel oneAPI Base Toolkit and Intel oneAPI HPC Toolkit after uninstallation?

Could you please provide the Hardware details(CPU and GPU) and the Visual studio version you are using?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
3,909 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
dherminderkainth
Beginner
3,898 Views

As I have said - I am using Ubuntu Linux so do not use Visual Studio.

Hence I have not installed "Desktop development with C++"? ( I am not sure what this is).

Hardware -

 

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
CPU family: 6
Model: 158
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 1
Stepping: 10
CPU max MHz: 4500.0000
CPU min MHz: 800.0000
BogoMIPS: 5199.98
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust sgx bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hw
p_epp sgx_lc md_clear flush_l1d arch_capabilities
Virtualisation features:
Virtualisation: VT-x
Caches (sum of all):
L1d: 192 KiB (6 instances)
L1i: 192 KiB (6 instances)
L2: 1.5 MiB (6 instances)
L3: 12 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-11
Vulnerabilities:
Itlb multihit: KVM: Mitigation: VMX disabled
L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Mds: Mitigation; Clear CPU buffers; SMT vulnerable
Meltdown: Mitigation; PTI
Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable
Retbleed: Mitigation; IBRS
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
Srbds: Mitigation; Microcode
Tsx async abort: Not affected

 

GPU

00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630]

0 Kudos
shekar
Beginner
3,854 Views

I have the same issue. I am also running on a Linux machine (Ubuntu 22.04 -- 5.17.0-1020-oem kernel as recommended in the documentation).

 

I have reinstalled the OneAPI BaseKit and still get the same result. I am trying to build the VectorAdd example and get the following output.

 

I am new to the forum -- so, not sure if I should post this separately but it looks like I am facing the same issue that @dherminderkainth is.

 

Thanks.

---------------------------------------------------------------------------------------------------------------------

- 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.22/Modules/CMakeTestCXXCompiler.cmake:62 (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/shekar/vector-add/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_6c13b/fast && /usr/bin/gmake -f CMakeFiles/cmTC_6c13b.dir/build.make CMakeFiles/cmTC_6c13b.dir/build
gmake[1]: Entering directory '/home/shekar/vector-add/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_6c13b.dir/testCXXCompiler.cxx.o
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx -MD -MT CMakeFiles/cmTC_6c13b.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_6c13b.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_6c13b.dir/testCXXCompiler.cxx.o -c /home/shekar/vector-add/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_6c13b
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6c13b.dir/link.txt --verbose=1
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx CMakeFiles/cmTC_6c13b.dir/testCXXCompiler.cxx.o -o cmTC_6c13b
/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_6c13b.dir/build.make:100: cmTC_6c13b] Error 1
gmake[1]: Leaving directory '/home/shekar/vector-add/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_6c13b/fast] Error 2

 

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


-- Configuring incomplete, errors occurred!
See also "/home/shekar/vector-add/build/CMakeFiles/CMakeOutput.log".
See also "/home/shekar/vector-add/build/CMakeFiles/CMakeError.log".

0 Kudos
SeshaP_Intel
Moderator
3,815 Views

Hi,

 

>>>  /usr/bin/ld: cannot find -lstdc++: No such file or directory

 

It seems to be libstdc++ library is not present in the /usr/bin/ld path.

Could you please check if the libstdc++ library is present in the system library path? You can do this by running the below command.

ldconfig -p | grep libstdc++

If the libstdc++ library is not present in the system library path, you could try adding its location to the linker search path by setting the LD_LIBRARY_PATH environment variable.

export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH

Replace /usr/lib with the actual path to the directory which contains the libstdc++.so library.

 

If this does not resolve your issue, could you please run the following commands in the terminal? It will install the CMake, pkg-config, and GNU development tools on your system.

sudo apt update
sudo apt -y install cmake pkg-config build-essential

Please let us know if you still face any issues.

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
shekar
Beginner
3,775 Views

Hi SheshaP_Intel,

 

I tried what you suggested. Still no luck. See logs below.

 

$ ldconfig -p| grep libstdc++
libstdc++.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libstdc++.so.6

 

$ echo $LD_LIBRARY_PATH
/lib/x86_64-linux-gnu:/opt/intel/oneapi/vpl/2023.0.0/lib:/opt/intel/oneapi/tbb/2021.8.0/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/2021.8.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.8.0//lib/release:/opt/intel/oneapi/mpi/2021.8.0//lib:/opt/intel/oneapi/mkl/2023.0.0/lib/intel64:/opt/intel/oneapi/ipp/2021.7.0/lib/intel64:/opt/intel/oneapi/ippcp/2021.6.3/lib/intel64:/opt/intel/oneapi/ipp/2021.7.0/lib/intel64:/opt/intel/oneapi/dnnl/2023.0.0/cpu_dpcpp_gpu_dpcpp/lib:/opt/intel/oneapi/debugger/2023.0.0/gdb/intel64/lib:/opt/intel/oneapi/debugger/2023.0.0/libipt/intel64/lib:/opt/intel/oneapi/debugger/2023.0.0/dep/lib:/opt/intel/oneapi/dal/2023.0.0/lib/intel64:/opt/intel/oneapi/compiler/2023.0.0/linux/lib:/opt/intel/oneapi/compiler/2023.0.0/linux/lib/x64:/opt/intel/oneapi/compiler/2023.0.0/linux/lib/oclfpga/host/linux64/lib:/opt/intel/oneapi/compiler/2023.0.0/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/ccl/2021.8.0/lib/cpu_gpu_dpcpp

 

Then, I tried to build the vector-add sample and I get the following output when I do cmake. I am also attaching the CMakeError.log file.

 

 

- 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.22/Modules/CMakeTestCXXCompiler.cmake:62 (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/shekar/vector-add/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_a1e0c/fast && /usr/bin/gmake -f CMakeFiles/cmTC_a1e0c.dir/build.make CMakeFiles/cmTC_a1e0c.dir/build
gmake[1]: Entering directory '/home/shekar/vector-add/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_a1e0c.dir/testCXXCompiler.cxx.o
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx -MD -MT CMakeFiles/cmTC_a1e0c.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_a1e0c.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_a1e0c.dir/testCXXCompiler.cxx.o -c /home/shekar/vector-add/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_a1e0c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a1e0c.dir/link.txt --verbose=1
/opt/intel/oneapi/compiler/2023.0.0/linux/bin/icpx CMakeFiles/cmTC_a1e0c.dir/testCXXCompiler.cxx.o -o cmTC_a1e0c
/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_a1e0c.dir/build.make:100: cmTC_a1e0c] Error 1
gmake[1]: Leaving directory '/home/shekar/vector-add/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_a1e0c/fast] Error 2

 

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


-- Configuring incomplete, errors occurred!
See also "/home/shekar/vector-add/build/CMakeFiles/CMakeOutput.log".
See also "/home/shekar/vector-add/build/CMakeFiles/CMakeError.log".

 

0 Kudos
shekar
Beginner
3,730 Views
0 Kudos
SeshaP_Intel
Moderator
3,703 Views

Hi,


@dherminderkainth

Could you please provide an update on your issue?

 

@shekar

Could you please try installing GCC - 7.5.0 or a higher version in your system?


Please refer to the DPC++ compiler software requirements in the below link. 

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html#inpage-nav-2-undefined-1


And also try to build and run another sample(Matrix Mul) using the oneAPI CLI samples browser.

If the issue still persists, we suggest you re-install the Intel oneAPI Base Toolkit and Intel oneAPI HPC Toolkit.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
dherminderkainth
Beginner
3,681 Views

Hi

I have libstdc++ installed on my system:

ldconfig -p | grep libstdc++
libstdc++.so.6 (libc6,x86-64) => /lib/x86_64-linux-gnu/libstdc++.so.6
libstdc++.so.6 (libc6) => /lib32/libstdc++.so.6

so this doesn't solve my issue

 

0 Kudos
SeshaP_Intel
Moderator
3,545 Views

Hi,

 

We have tried to reproduce your issue on Ubuntu 22.04 machine.

Please find the below screenshot while building the project with CMake before installing the build-essentials.

SeshaP_Intel_0-1678873598403.png

 

The Intel compilers utilize the GNU build toolchains to provide the complete C/C++ development environment.

We have run the following commands in the terminal. It will install the CMake, pkg-config, and GNU development tools on your system.

sudo apt update
sudo apt -y install cmake pkg-config build-essential

 

Then after, we tried to build the oneAPI CLI Sample(simple-add) in the terminal with the following steps.

mkdir build
cd build/
cmake ..
cmake --build .
./simple-add-buffers

 

Please find the below output screenshot.

SeshaP_Intel_1-1678873626366.png

 

Hope this will resolve your issue.

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
shekar
Beginner
3,521 Views

@SeshaP_Intel 

 

I am finally able to compile the example. I had to downgrade my OS to 20.04, reinstall the drivers (and that process frankly is almost onerous) and the key here was I had to install the OneAPI SDK first and then the gnu tools (and that wasn't clear from the documentation).

 

Thanks for you help.

 

/Shekar

0 Kudos
SeshaP_Intel
Moderator
3,417 Views

Hi @dherminderkainth,


I can see the @shekar issue got resolved. Has the provided information resolved your issue?

If yes, could you please confirm whether we can close this thread from our end?


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
dherminderkainth
Beginner
3,396 Views

No this does not resolve my issue. When I ask for an update from apt - as suggested - i already have the packages installed and then i get the same errors as before.

I have not uninstalled everything (ie gcc / cmake etc) and then install intel sdk first followed by cmake ets as Shekar has done.

0 Kudos
shekar
Beginner
3,413 Views

My issue is resolved but I am not sure about the OP. Thanks

0 Kudos
SeshaP_Intel
Moderator
3,276 Views

Hi,

 

This error could arise when you have multiple gcc packages installed in your system and the compiler is unable to locate the correct system libraries.

In one of the cases, I have gcc-11 and g++-11 installed in my system, I did not face any issues while building. Thereafter, I have installed gcc-12 in my system, then the same error was reproduced while building with cmake.

Please refer to the below screenshot.

SeshaP_Intel_0-1679561298681.png

 

This issue was resolved after installing g++-12 in my system. You can install g++-12 by running the following commands in the terminal.

sudo apt-get install g++-12

 

Please refer to the below screenshot after installation.

SeshaP_Intel_1-1679561338392.png

 

Hope this resolves your issue. If not resolved, please share the following details with us.

1. CMakeOutput.log, CMakeError.log files generated while building.

2. Output after running the following command in the terminal.

icpx -v
dpkg -l | grep libstdc++
dpkg -l | grep gcc

 

It will provide the icpx compiler information, and the selected GCC version, and the remaining commands will provide the list of all installed libstdc++, and GCC packages versions.

3. Which gcc packages have you installed in your system?

    

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
Reply