OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

Compiling SHOC benchmark suite for HD4000

Alexander_Heinecke
705 Views
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
0 Kudos
9 Replies
Raghupathi_M_Intel
705 Views
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
0 Kudos
Alexander_Heinecke
705 Views
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
0 Kudos
Raghupathi_M_Intel
705 Views
Can you post what your lib path is set to?

Thanks,
Raghu
0 Kudos
Alexander_Heinecke
705 Views
Hi,

my link is set to C:\Program Files (x86)\Intel\OpenCL SDK\2.0\lib\x64

Thanks,
Alex
0 Kudos
Raghupathi_M_Intel
705 Views
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
0 Kudos
Alexander_Heinecke
705 Views
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
0 Kudos
Alexander_Heinecke
705 Views
Hi Raghu,

any news on this thread?

Thanks,
Alex
0 Kudos
Raghupathi_M_Intel
705 Views
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
0 Kudos
dominik_grewe
Beginner
705 Views
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.
0 Kudos
Reply