AnsweredAssumed Answered

Babystepping with opencl

Question asked by ggamddev000 on Feb 18, 2019

Hello, I am making an effort to build simple helloworld in opencl and using opencl-programming-guide which is about 2010-ish which is sort of old. Now I am trying on relatively newer VS15 so I expected some compilation issues. Here are the details:

On Windows 10:

  • Installed VS 15
  • OpenCL was hard to find! here is the link: https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases
  • cmake 3.14-rc2 installed.
  • May help adding the cl.exe path to Windows PATH variable.
  • Point to opencl source project where it contains CMakeLists.txt.
  • Select VS15 during configuration and generate.

I had to include header location in project's include to build to continue otherwise it wont find CL\cl.h.

Now I opened ALL_BUILD.vcxproj and build helloworld project but it builds with huge number of errors, including deprecated function and link errors.

 

Here are the full C/P of errors, at this time I decided to not pursue and try to fix in the source, instead I am looking and asking which version of VS is most compatible with OCL-SDK??? 

 

 

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _clCreateContextFromType@24 referenced in function "struct _cl_context * __cdecl CreateContext(void)" (?CreateContext@@YAPAU_cl_context@@XZ) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clGetPlatformIDs@12 referenced in function "struct _cl_context * __cdecl CreateContext(void)" (?CreateContext@@YAPAU_cl_context@@XZ) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clReleaseContext@4 referenced in function "void __cdecl Cleanup(struct _cl_context *,struct _cl_command_queue *,struct _cl_program *,struct _cl_kernel *,struct _cl_mem * * const)" (?Cleanup@@YAXPAU_cl_context@@PAU_cl_command_queue@@PAU_cl_program@@PAU_cl_kernel@@QAPAU_cl_mem@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clGetContextInfo@20 referenced in function "struct _cl_command_queue * __cdecl CreateCommandQueue(struct _cl_context *,struct _cl_device_id * *)" (?CreateCommandQueue@@YAPAU_cl_command_queue@@PAU_cl_context@@PAPAU_cl_device_id@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clReleaseCommandQueue@4 referenced in function "void __cdecl Cleanup(struct _cl_context *,struct _cl_command_queue *,struct _cl_program *,struct _cl_kernel *,struct _cl_mem * * const)" (?Cleanup@@YAXPAU_cl_context@@PAU_cl_command_queue@@PAU_cl_program@@PAU_cl_kernel@@QAPAU_cl_mem@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clCreateBuffer@24 referenced in function "bool __cdecl CreateMemObjects(struct _cl_context *,struct _cl_mem * * const,float *,float *)" (?CreateMemObjects@@YA_NPAU_cl_context@@QAPAU_cl_mem@@PAM2@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clReleaseMemObject@4 referenced in function "void __cdecl Cleanup(struct _cl_context *,struct _cl_command_queue *,struct _cl_program *,struct _cl_kernel *,struct _cl_mem * * const)" (?Cleanup@@YAXPAU_cl_context@@PAU_cl_command_queue@@PAU_cl_program@@PAU_cl_kernel@@QAPAU_cl_mem@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clCreateProgramWithSource@20 referenced in function "struct _cl_program * __cdecl CreateProgram(struct _cl_context *,struct _cl_device_id *,char const *)" (?CreateProgram@@YAPAU_cl_program@@PAU_cl_context@@PAU_cl_device_id@@PBD@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clReleaseProgram@4 referenced in function "struct _cl_program * __cdecl CreateProgram(struct _cl_context *,struct _cl_device_id *,char const *)" (?CreateProgram@@YAPAU_cl_program@@PAU_cl_context@@PAU_cl_device_id@@PBD@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clBuildProgram@24 referenced in function "struct _cl_program * __cdecl CreateProgram(struct _cl_context *,struct _cl_device_id *,char const *)" (?CreateProgram@@YAPAU_cl_program@@PAU_cl_context@@PAU_cl_device_id@@PBD@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clGetProgramBuildInfo@24 referenced in function "struct _cl_program * __cdecl CreateProgram(struct _cl_context *,struct _cl_device_id *,char const *)" (?CreateProgram@@YAPAU_cl_program@@PAU_cl_context@@PAU_cl_device_id@@PBD@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clCreateKernel@12 referenced in function _main HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clReleaseKernel@4 referenced in function "void __cdecl Cleanup(struct _cl_context *,struct _cl_command_queue *,struct _cl_program *,struct _cl_kernel *,struct _cl_mem * * const)" (?Cleanup@@YAXPAU_cl_context@@PAU_cl_command_queue@@PAU_cl_program@@PAU_cl_kernel@@QAPAU_cl_mem@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clSetKernelArg@16 referenced in function _main HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clEnqueueReadBuffer@36 referenced in function _main HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clEnqueueNDRangeKernel@36 referenced in function _main HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK2019 unresolved external symbol _clCreateCommandQueue@20 referenced in function "struct _cl_command_queue * __cdecl CreateCommandQueue(struct _cl_context *,struct _cl_device_id * *)" (?CreateCommandQueue@@YAPAU_cl_command_queue@@PAU_cl_context@@PAPAU_cl_device_id@@@Z) HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\HelloWorld.obj 1
Error LNK1120 17 unresolved externals HelloWorld C:\dev\opencl-book-samples-master\bin\Chapter_2\HelloWorld\Debug\HelloWorld.exe 1

Outcomes