Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error C1083: Cannot open include file: 'CL/cl.h'

I read all the solutions provided in this website in order to solve this problem, but it still exits. When I run this command in cmd in windows 10 C:\pyopencl-2016.2.1>setup.py install, this error will be shown:

c:\pyopencl-2016.2.1\src\c_wrapper\clinfo_ext.h(10) : fatal error C1083: 

Cannot open include file: 'CL/cl.h': No such file or directory
error: command 'C:\\Users\\Neda\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

Also, there is no cl.exe and CL/ in the paths mentioned above. I would really appreciate your attention.

EDITED: I also ran this command in cmd Command "pip install --global-option=build_ext --global-option="-DHAVE_GL=1" pyopencl and the problem was the same:

c:\users\neda\appdata\local\temp\pip-build-ugbqq9\pyopencl\src\c_wrapper\clinfo_ext.h(10) : fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
error: command '

C:\\Users\\Neda\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\neda\appdata\local\enthought\canopy\user\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\neda\\appdata\\local\\temp\\pip-build-ugbqq9\\pyopencl\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -DHAVE_GL=1 install --record c:\users\neda\appdata\local\temp\pip-l6bnzf-record\install-record.txt --single-version-externally-managed --compile --install-headers c:\users\neda\appdata\local\enthought\canopy\user\include\site\python2.7\pyopencl" failed with error code 1 in c:\users\neda\appdata\local\temp\pip-build-ugbqq9\pyopencl\
like image 894
Maryam Farabi Avatar asked Dec 08 '22 19:12

Maryam Farabi


1 Answers

I have successfully installed pyopencl on a Windows 10 AMD machine. For other Windows AMD users, read on.

The AMD APP SDK is now discontinued by AMD, however the last release version you can find on Github. I recommend you install it from here.

Next, you will need to specify a few command line flags to pass onto the compiler when building. I used:

pip3 install --global-option=build_ext --global-option="-Ic:\Program Files (x86)\OCL_SDK_Light\include" --global-option="-Lc:\Program Files (x86)\OCL_SDK_Light\lib\x86_64" pyopencl

This worked for me, you may have to adjust your -I and -L arguments according to where the OCL SDK installed to.

like image 98
Expanding-Dev Avatar answered Jun 02 '23 15:06

Expanding-Dev