Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling oneDNN examples: DSO missing from command line #1730

Open
jjfumero opened this issue Jun 15, 2023 · 2 comments
Open

Error compiling oneDNN examples: DSO missing from command line #1730

jjfumero opened this issue Jun 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jjfumero
Copy link

Summary

I am compiling the getting_started example from oneDNN:
https://github.com/oneapi-src/oneAPI-samples/tree/master/Libraries/oneDNN/getting_started

But I get an error during compilation. Perhaps I am missing something. I attach the logs and how to reproduce.

$ make
[  1%] Building CXX object bin/CMakeFiles/sycl-interop-usm-cpp.dir/sycl_interop_usm.cpp.o
[  3%] Linking CXX executable sycl-interop-usm-cpp
/usr/bin/ld: /tmp/icx-1a4810/sycl_interop_usm-410ec9.o: undefined reference to symbol '_ZSt20__throw_length_errorPKc@@GLIBCXX_3.4'
/usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
icx: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/CMakeFiles/sycl-interop-usm-cpp.dir/build.make:100: bin/sycl-interop-usm-cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:162: bin/CMakeFiles/sycl-interop-usm-cpp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Version

oneAPI: 2023.1.0
oneAPI samples: b86bc90

Environment

OS: RHEL 9.2 (Linux Kernel 5.14.0-284.11.1.el9_2.x86_64)
GCC/G++ : 11.3.1 20221121 (Red Hat 11.3.1-4)

Steps to reproduce

git clone git@github.com:oneapi-src/oneAPI-samples.git
cd oneAPI-samples/Libraries/oneDNN/getting_started/
mkdir build
cd build
. /opt/intel/oneapi/setvars.sh
cmake ..
make 

Observed behavior

make
[  1%] Building CXX object bin/CMakeFiles/sycl-interop-usm-cpp.dir/sycl_interop_usm.cpp.o
[  3%] Linking CXX executable sycl-interop-usm-cpp
/usr/bin/ld: /tmp/icx-4628a6/sycl_interop_usm-58e7f4.o: undefined reference to symbol '_ZSt20__throw_length_errorPKc@@GLIBCXX_3.4'
/usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
icx: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/CMakeFiles/sycl-interop-usm-cpp.dir/build.make:100: bin/sycl-interop-usm-cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:162: bin/CMakeFiles/sycl-interop-usm-cpp.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Expected behavior

Compile without errors.

@jjfumero jjfumero added the bug Something isn't working label Jun 15, 2023
@jinz2014
Copy link

Do you need to specify the compilers ?

mkdir build
cd build
CC=GCC CXX=g++ cmake ..
make

@HaoZeke
Copy link

HaoZeke commented May 9, 2024

You need CXX=icpx for Intel C++ and icx for the data compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants