- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm currently trying to compile SHOC (https://github.com/spaffy/shoc, version 1.1.4) for GT2. As there is no OpenCL in Linux I'm trying to build it in Windows using cygwin.
I did the following:
./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
Include and lib dir are links into the SDK folder in C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\
Make is working fine until the linker kicks in:
make[3]: Leaving directory `/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/common'
make[3]: Entering directory `/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0'
g++ -I../../../src/common -I../../../config -I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca -I../../../src/opencl/common -I../../../src/opencl/common -g -O2 -c BusSpeedDownload.cpp -o BusSpeedDownload.o
g++ -I../../../src/common -I../../../config -I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca -I../../../src/opencl/common -I../../../src/opencl/common -g -O2 -c ../common/main.cpp -o main.o
g++ -o ../../../bin/Serial/OpenCL/BusSpeedDownload -g -O2 -L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64 main.o BusSpeedDownload.o -lSHOCCommonOpenCL -lSHOCCommon -lOpenCL -L../../../lib
main.o: In function `Context':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1443: undefined reference to `_clCreateContext'
main.o: In function `CommandQueue':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:2584: undefined reference to `_clCreateCommandQueue'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1049: undefined reference to `_clReleaseCommandQueue'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1040: undefined reference to `_clReleaseContext'
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1040: undefined reference to `_clReleaseContext'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1049: undefined reference to `_clReleaseCommandQueue'
BusSpeedDownload.o: In function `_Z12RunBenchmarkRN2cl6DeviceERNS_7ContextERNS_12CommandQueueER14ResultDatabaseR12OptionParser':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/BusSpeedDownload.cpp:44: undefined reference to `_clGetDeviceInfo'
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/BusSpeedDownload.cpp:66: undefined reference to `_clCreateBuffer'
[...]
thanks for your help.
Alex
I'm currently trying to compile SHOC (https://github.com/spaffy/shoc, version 1.1.4) for GT2. As there is no OpenCL in Linux I'm trying to build it in Windows using cygwin.
I did the following:
./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
Include and lib dir are links into the SDK folder in C:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\
Make is working fine until the linker kicks in:
make[3]: Leaving directory `/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/common'
make[3]: Entering directory `/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0'
g++ -I../../../src/common -I../../../config -I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca -I../../../src/opencl/common -I../../../src/opencl/common -g -O2 -c BusSpeedDownload.cpp -o BusSpeedDownload.o
g++ -I../../../src/common -I../../../config -I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca -I../../../src/opencl/common -I../../../src/opencl/common -g -O2 -c ../common/main.cpp -o main.o
g++ -o ../../../bin/Serial/OpenCL/BusSpeedDownload -g -O2 -L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64 main.o BusSpeedDownload.o -lSHOCCommonOpenCL -lSHOCCommon -lOpenCL -L../../../lib
main.o: In function `Context':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1443: undefined reference to `_clCreateContext'
main.o: In function `CommandQueue':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:2584: undefined reference to `_clCreateCommandQueue'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1049: undefined reference to `_clReleaseCommandQueue'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP11_cl_contextE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1040: undefined reference to `_clReleaseContext'
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1040: undefined reference to `_clReleaseContext'
main.o: In function `_ZN2cl6detail16ReferenceHandlerIP17_cl_command_queueE7releaseES3_':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/../common/cl.hpp:1049: undefined reference to `_clReleaseCommandQueue'
BusSpeedDownload.o: In function `_Z12RunBenchmarkRN2cl6DeviceERNS_7ContextERNS_12CommandQueueER14ResultDatabaseR12OptionParser':
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/BusSpeedDownload.cpp:44: undefined reference to `_clGetDeviceInfo'
/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/src/opencl/level0/BusSpeedDownload.cpp:66: undefined reference to `_clCreateBuffer'
[...]
thanks for your help.
Alex
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you make sure you have the OpenCL library in your lib path (64-bit library is under .....2.0/lib/x64 and the 32-bit library is under ....2.0/lib/x86)? Can you try adding the path via -L to see if that helps?
Raghu
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply.
Yes:
./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
Include and lib dir are links into the SDK folder in C:\Program Files (x86)\Intel\OpenCL SDK\2.0\
It seems that mingw (g++) is not able to understand symbols in OpenCL.lib.
Alex
Yes:
./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
Include and lib dir are links into the SDK folder in C:\Program Files (x86)\Intel\OpenCL SDK\2.0\
It seems that mingw (g++) is not able to understand symbols in OpenCL.lib.
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you post what your lib path is set to?
Thanks,
Raghu
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
my link is set to C:\Program Files (x86)\Intel\OpenCL SDK\2.0\lib\x64
Thanks,
Alex
my link is set to C:\Program Files (x86)\Intel\OpenCL SDK\2.0\lib\x64
Thanks,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One last attempt. Try
CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64 -L/cygdrive/c/Program\ Files\ (x86)/Intel/OpenCL\ SDK/2.0/lib/x64"
If that doesn't work please provide a reproducer and I'll try to help.
Thanks,
Raghu
CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64 -L/cygdrive/c/Program\ Files\ (x86)/Intel/OpenCL\ SDK/2.0/lib/x64"
If that doesn't work please provide a reproducer and I'll try to help.
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Raghu,
this didn't help :-(
I did the following:
1. installed cygwin, www.cygwin.com for mingw, g++, etc.
2. dowloaded show benchmark, attaced here
3. ln -s: Include and lib dir are links into the SDK folder in C:\Program Files (x86)\Intel\OpenCL SDK\2.0\ inside shoc root dir
4. ./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
5. make
6. Linker error
Thanks,
Alex
this didn't help :-(
I did the following:
1. installed cygwin, www.cygwin.com for mingw, g++, etc.
2. dowloaded show benchmark, attaced here
3. ln -s: Include and lib dir are links into the SDK folder in C:\Program Files (x86)\Intel\OpenCL SDK\2.0\ inside shoc root dir
4. ./configure -with-cuda=no CPPFLAGS="-I/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/include -Dalloca=__builtin_alloca" LDFLAGS="-L/cygdrive/c/Users/heinecke/Documents/spaffy-shoc-7380bc4/lib/x64"
5. make
6. Linker error
Thanks,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Raghu,
any news on this thread?
Thanks,
Alex
any news on this thread?
Thanks,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Sorry I couldnt spend time reproducing your issue. I'll take a look in the next few days and get back to you.
Thanks,
Raghu
Sorry I couldnt spend time reproducing your issue. I'll take a look in the next few days and get back to you.
Thanks,
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got similar errors when trying to compile OpenCL in cygwin. What eventually worked was to link against AMD's OpenCL library (AMD APP) which comes with a .a file. I was then able to select the Intel runtime and the HD4000 as device.

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