cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

watkinsp
Journeyman III

OpenCL Samples Visual Studio Compile Errors

I just downloaded the the AMD OpenCL SDK and tried compiling one of the samples in Visual Studio 2010. These are the errors I get:


Error 1 error C1083: Cannot open include file: 'CL/cl.hpp': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\samples\opencl\cl\DynamicOpenCLDetection\VectorAddition\VectorAddition.cpp 20 1 VectorAddition


Error 2 error C1083: Cannot open include file: 'CL/cl.h': No such file or directory c:\users\watkinsp\amd app sdk\2.9\samples\opencl\cl\template\Template.hpp 24 1 Template


Error 3 error C1083: Cannot open include file: 'CL/opencl.h': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\include\SDKUtil\CLUtil.hpp 24 1 BufferImageInterop


Error 4 error LNK1104: cannot open file 'OpenCL.lib' C:\Users\watkinsp\AMD APP SDK\2.9\samples\opencl\cl\DynamicOpenCLDetection\LINK DynamicOpenCLDetection


Error 5 error C1083: Cannot open include file: 'CL/opencl.h': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\include\SDKUtil\CLUtil.hpp 24 1 TransferOverlap


Error 6 error C1083: Cannot open include file: 'CL/opencl.h': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\include\SDKUtil\CLUtil.hpp 24 1 URNG


Error 7 error C1083: Cannot open include file: 'CL/opencl.h': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\include\SDKUtil\CLUtil.hpp 24 1 SobelFilter


Error 8 error C1083: Cannot open include file: 'CL/opencl.h': No such file or directory C:\Users\watkinsp\AMD APP SDK\2.9\include\SDKUtil\CLUtil.hpp 24 1 SimpleImage


I haven't modified anything. I guess I just assumed I could open the provided Visual Studio 2010 solution and compile one of the samples out of the box. Did I miss an installation step?

0 Likes
1 Solution

Please check default path: C:\<username>\AMD APP SDK\<sdk version>\include\SDKUtil\

If you open the TransferOverlap project (C:\<username>\AMD APP SDK\<sdk version>\samples\opencl\cl\TransferOverlap) using VS and check the include directory path, you should find following paths there.

../../../../include

../../../../include/SDKUtil

$(AMDAPPSDKROOT)/include

Regards,

View solution in original post

0 Likes
9 Replies

Hi,

It seems that the environment variable AMDAPPSDKROOT is not set on your machine.

Assuming that you have installed AMD APP SDK in C:\AMD APP SDK, AMDAPPSDKROOT should point to C:\AMD APP SDK\2.9.

To set an environment variable in windows 7, you can go to control panel\system\advance system settings\environment variables.

AMD Support

0 Likes

Hi, I've got the same problem.

I'm using OpenCL since more than a year, and everything worked fine, so I think environment variables are properly set. By the way, I checked and everything is ok.

I need to run Transfer Overlap sample, together with the Buffer Bandwidth one to check memory allocations and data transfer speed.

While the Buffer Bandwidth sample runs fine, with no problems associated to the compilation step, Transfer Overlap sample shows compilation errors due to the lack of the file "CLUtil.hpp". This is not included at all in the Buffer Bandwidth sample, so no requests about searching for / including it. In all the other samples (Transfer Overlap, I checked also SobelFilter and SimpleImage as a test) the CLUtil.hpp file is needed.

I checked in all the folders under the main AMD APP SDK folder but there's nothing.

Where's that? How to work around this problem?

Marco

0 Likes

Please check default path: C:\<username>\AMD APP SDK\<sdk version>\include\SDKUtil\

If you open the TransferOverlap project (C:\<username>\AMD APP SDK\<sdk version>\samples\opencl\cl\TransferOverlap) using VS and check the include directory path, you should find following paths there.

../../../../include

../../../../include/SDKUtil

$(AMDAPPSDKROOT)/include

Regards,

0 Likes

Hi Dipak, that is the problem. I mean, there's no SDKUtil folder in the SDK (2.9-1) APP that I downloaded.

I downloaded the 64-bit version for Windows 7 for two different PCs and installed it.

This is what's inside "include" folder, and then "CL" folder. (don't care of the unrecognized file extension, there's no Visual Studio actually on one of the two machines)

1.jpg2.jpg

As regard the settings in the VS Project properties page, already checked. Everything's ok.

0 Likes

The include folder you are referring is normally placed under C:\Program Files (x86)\AMD APP SDK\2.9-1\include or <AMDAPPSDKROOT>/include. It contains general GL and CL header files. However, the header file you need should be at C:\<username>\AMD APP SDK\2.9-1\include\SDKUtil\ [by default there should be a folder named "AMD APP SDK" under the username directory where all the samples files and utility headers are placed]. If not found, please reinstall freshly and then check.

Regards,

Nice. Always looked just inside the AMD APP SDK folder inside the disk.

Thanks Dipak. Appreciate.

Regards,

Marco

0 Likes
evo
Adept I

Hello!

For me the following error occurs: "

Error1error LNK1104: cannot open file 'OpenCL.lib'c:\Users\gpu\documents\visual studio 2012\Projects\ConsoleApplication4\ConsoleApplication4\LINK

What can be wrong?

0 Likes

1. Check whether AMDAPPSDKROOT is properly set or not. For example, on a 64-bit windows OS, it points to "C:\Program Files (x86)\AMD APP SDK\<version>\" by default.

2. There are two versions of "OpenCL.lib"; one at "<AMDAPPSDKROOT>\lib\x86" for 32-bit application and another at "<AMDAPPSDKROOT>\lib\x86_64" for 64-bit application. Under the project setting, the library path should point to proper version of the "OpenCL.lib" library.

Thanks, Dipak!

The environment variable AMDAPPSDKROOT wasn't properly setted. The path was C:\Program Files (x86)\AMD APP\ instead of C:\Program Files (x86)\AMD APP SDK\<version>\ .


Regards,

Evo