Compiling SHOC benchmark suite for HD4000

Compiling SHOC benchmark suite for HD4000

Ritratto di Alexander Heinecke

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

10 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Raghu Muthyalampalli (Intel)

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

Ritratto di Alexander Heinecke

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

Ritratto di Raghu Muthyalampalli (Intel)

Can you post what your lib path is set to?

Thanks,
Raghu

Ritratto di Alexander Heinecke

Hi,

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

Thanks,
Alex

Ritratto di Raghu Muthyalampalli (Intel)

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

Ritratto di Alexander Heinecke

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

Allegati: 

AllegatoDimensione
Scarica shoc-1.1.4.tar.gz625.07 KB
Ritratto di Alexander Heinecke

Hi Raghu,

any news on this thread?

Thanks,
Alex

Ritratto di Raghu Muthyalampalli (Intel)

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

Ritratto di dominik.grewe

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.

Accedere per lasciare un commento.