oneapi-src / oneapi-src/oneAPI-samples

Error compiling oneDNN examples: DSO missing from command line

Offen
#1,730 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
C++
Sterne
1.2k
Forks
745
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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: b86bc9000b5ce89a143f9a1a8ec23743dbe78e7e

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in Libraries/oneDNN/getting_started und reproduziere den Fehler mit cmake .., gefolgt von make, nachdem du setvars.sh gesourct hast. Untersuche den generierten Link-Schritt für sycl-interop-usm-cpp und vergleiche ihn mit dem gemeldeten fehlenden libstdc++-Symbol. Fertig ist die Aufgabe, wenn das getting_started-Beispiel in der gemeldeten Umgebung ohne den Linkerfehler kompiliert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cmake, cpp
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.