- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have installed oneAPI at my system with Ubuntu 18.04 LTS, Intel® Xeon(R) CPU E5-1620 v4 @ 3.50GHz × 8, Quadro P4000/PCIe/SSE2, gcc/g++5.4.
When I make all, the errors are
dpcpp -o vector-add.exe src/vector-add.cpp -lOpenCL -lsycl
/opt/intel/inteloneapi/compiler/2021.1-beta03/linux/bin/../lib/libsycl.so: undefined reference to `clCreateProgramWithIL@OPENCL_2.1'
/opt/intel/inteloneapi/compiler/2021.1-beta03/linux/bin/../lib/libsycl.so: undefined reference to `clGetKernelSubGroupInfo@OPENCL_2.1'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:10: recipe for target 'main' failed
make: *** [main] Error 1
What could be wrong?
- Tags:
- General Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, You may also need to uninstall the Intel OpenCL runtime from the Ubuntu repository (package ocl-icd-libopencl1). The one that comes with the basekit is more recent even compared to the latest Ububtu (19.10). You can check which library is used by running > ldd /opt/intel/inteloneapi/compiler/latest/linux/lib/libsycl.so | grep OpenCL If you did not run > source /opt/intel/inteloneapi/setvars.sh it may point to /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 or some other library and /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 otherwise. You can check the supported version and symbols by running > nm -gD libOpenCL.so.1 | grep 'OPENCL\|clGetKernelSubGroupInfo' on each of the found libraries. -Dmitry
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Naing,
Thanks for reaching out to us.
We are working on this issue and will get back to you.
Kaleem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This error is due to conflicting libOpenCL.so, I will suggest you to properly uninstall everything and re-install beta03 base toolkit and then it will work.
-Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, You may also need to uninstall the Intel OpenCL runtime from the Ubuntu repository (package ocl-icd-libopencl1). The one that comes with the basekit is more recent even compared to the latest Ububtu (19.10). You can check which library is used by running > ldd /opt/intel/inteloneapi/compiler/latest/linux/lib/libsycl.so | grep OpenCL If you did not run > source /opt/intel/inteloneapi/setvars.sh it may point to /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 or some other library and /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 otherwise. You can check the supported version and symbols by running > nm -gD libOpenCL.so.1 | grep 'OPENCL\|clGetKernelSubGroupInfo' on each of the found libraries. -Dmitry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Let us know if it worked for you and get back to us if you faced any issue.
-Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The old installation was removed and reinstall new one following the instructions in the link.
But still have the same error when I make all.
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module04/Lab_module4/devcon/complex_mult$ make all
dpcpp lab/complex_mult.cpp -o bin/complex_mult -Isrc/ -lOpenCL -lsycl
/opt/intel/inteloneapi/compiler/2021.1-beta03/linux/bin/../lib/libsycl.so: undefined reference to `clCreateProgramWithIL@OPENCL_2.1'
/opt/intel/inteloneapi/compiler/2021.1-beta03/linux/bin/../lib/libsycl.so: undefined reference to `clGetKernelSubGroupInfo@OPENCL_2.1'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:13: recipe for target 'main' failed
make: *** [main] Error 1
Following one of the suggestions above to check opencl and output is as follow.
coie@coie-HP-Z440-Workstation:~/Data/coie/Softwares/oneAPI/dpc++/module04/Lab_module4/devcon/complex_mult$ ldd /opt/intel/inteloneapi/compiler/latest/linux/lib/
libsycl.so | grep OpenCL
libOpenCL.so.1 => /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 (0x00007feb9bdde000)
Why I still can't compile the project?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does
nm -gD /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 | grep 'OPENCL\|clGetKernelSubGroupInfo\|clCreateProgramWithIL'
show you?
-Dmitry
UPD: In the DevCloud the command does not work, had to do in two steps: nm -gD /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1> out grep 'OPENCL\|clGetKernelSubGroupInfo\|clCreateProgramWithIL' out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes this command "dpcpp -o vector-add.exe src/vector-add.cpp" can build exe file. Thanks.
make all doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This command
nm -gD /opt/intel/inteloneapi/compiler/latest/linux/lib/libOpenCL.so.1 | grep 'OPENCL\|clGetKernelSubGroupInfo\|clCreateProgramWithIL'
gave
00000000000046f0 T clCreateProgramWithIL
0000000000004720 T clGetKernelSubGroupInfo
0000000000000000 A OPENCL_1.0
0000000000000000 A OPENCL_1.1
0000000000000000 A OPENCL_1.2
0000000000000000 A OPENCL_2.0
0000000000000000 A OPENCL_2.1
0000000000000000 A OPENCL_2.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
naing,
Try change ./src/CMakeLists.txt:target_link_libraries(complex_mult OpenCL sycl)
to ./src/CMakeLists.txt:target_link_libraries(complex_mult sycl)
I found same issue on HPCKit-code-samples..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Naing,
Let us know if we can close this thread, you are always welcome to raise a new thread.
-Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes please go ahead. Removing opencl flag in makefile solved the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Naing,
Hope your issue is resolved. We are closing this thread. You can always reach out to us for other queries in a new thread.
Regards
Sushma.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page