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*

icpx: error: linker command failed

runchan
Beginner
2,413 Views

I am trying to compile a simple dpc++ program using command "icpx -fsycl" and met this error.

The detailed error report is like this:

"/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `std::basic_fstream<char, std::char_traits<char> >::basic_fstream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)@GLIBCXX_3.4.21'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `VTT for std::__cxx11::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)@GLIBCXX_3.4.21'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `std::_V2::error_category::_M_message[abi:cxx11](int) const@GLIBCXX_3.4.21'
/opt/rh/devtoolset-10/root/usr/lib/gcc/x86_64-redhat-linux/10/../../../../bin/ld: /opt/intel/oneapi/compiler/2023.1.0/linux/bin-llvm/../lib/libsycl.so: undefined reference to `std::__exception_ptr::exception_ptr::exception_ptr(void*)@CXXABI_1.3.11'"

(above only list part of the error warning)

How can i resolve this problem? My linux distribution is CentOS7.9. Can you give me some advice?

 

 

 

Labels (1)
0 Kudos
1 Solution
SeshaP_Intel
Moderator
2,262 Views

Hi, 

 

I am not sure whether updating the libstdc++ will work, as CentOS is not supported. I am able to use the icpx compiler without any issues on Ubuntu 22.04(supported OS).

I have run the below commands on Ubuntu machine before installing the Intel oneAPI toolkits, which will install the CMake, pkg-config, and GNU development tools on the system.

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

Try running the below command on CentOS if you face the same issues.

sudo yum install libstdc++

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

Please refer to the below link for more details.

https://www.intel.com/content/www/us/en/docs/oneapi-base-toolkit/get-started-guide-linux/2023-1/before-you-begin.html

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

View solution in original post

0 Kudos
7 Replies
runchan
Beginner
2,370 Views

I think the above warning may have the same reason with this:

root@master:~# sycl-ls
sycl-ls: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /opt/intel/oneapi/compiler/2023.1.0/linux/lib/libsycl.so.6)
sycl-ls: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /opt/intel/oneapi/compiler/2023.1.0/linux/lib/libsycl.so.6)
sycl-ls: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /opt/intel/oneapi/compiler/2023.1.0/linux/lib/libsycl.so.6)
sycl-ls: /lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /opt/intel/oneapi/compiler/2023.1.0/linux/lib/libsycl.so.6)

0 Kudos
SeshaP_Intel
Moderator
2,344 Views

Hi,

 

Thank you for posting in Intel Communities.

As per the Intel oneAPI DPC++/C++ Compiler 2023.1 system requirements, CentOS 7.9 is not supported. For more details please refer to the following link.

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html

 

Please try to run on the supported Operating System and let us know if you face any issues.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
runchan
Beginner
2,333 Views

Hi, thanks for your reply,

I wonder whether updating my libstdc++ will work, because i may have some difficulty updating my operating system.

 

0 Kudos
SeshaP_Intel
Moderator
2,263 Views

Hi, 

 

I am not sure whether updating the libstdc++ will work, as CentOS is not supported. I am able to use the icpx compiler without any issues on Ubuntu 22.04(supported OS).

I have run the below commands on Ubuntu machine before installing the Intel oneAPI toolkits, which will install the CMake, pkg-config, and GNU development tools on the system.

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

Try running the below command on CentOS if you face the same issues.

sudo yum install libstdc++

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

Please refer to the below link for more details.

https://www.intel.com/content/www/us/en/docs/oneapi-base-toolkit/get-started-guide-linux/2023-1/before-you-begin.html

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
SeshaP_Intel
Moderator
2,197 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
SeshaP_Intel
Moderator
2,138 Views

Hi,


I have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
runchan
Beginner
2,010 Views

Sorry, i forgot to turn on email notification when someone reply.

Thank you for your advice! We are changing our OS to Ubuntu now!

 

Thanks and Regards

0 Kudos
Reply