Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICD-Loader cannot be built on Windows 7 due to missing GL headers #17

Closed
PhilippWph opened this issue May 3, 2017 · 5 comments
Closed
Assignees

Comments

@PhilippWph
Copy link

PhilippWph commented May 3, 2017

Hi kepatil,

As mentioned in your comment on issue #9 I created a new issue.

I cannot build the ICD-Loader for Windows 7.

I am using CMake, from Kitware in version 3.7.2 and Visual C++ 2010 Express - ENU in version 10.0.40219. Due to this VC++ version I modified the "build_using_cmake.bat" file in line 1:
call "%VS90COMNTOOLS%/vsvars32.bat"

I also had to add a "GL" folder and the "gl.h" file to the "inc" folder. But here the first problem occurred since dependent on the "gl.h" file I use I get different errors.
I do not have OpenGL installed and I don't want to install OpenGL from the drivers. I am also not sure why OpenGL is really required for the ICD Loader here.

I am using the GL headers from this GitHub repo:
OpenGL headers

But more on the errors: If I compile with the GLES/gl.h in inc/GL I get the following error:
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. [ 4%] Building C object CMakeFiles/OpenCL.dir/icd.c.obj icd.c D:\OpenCL\OpenCL-ICD-Loader-master\inc\GL/gl.h(37) : fatal error C1083: Cannot open include file: "GLES/glplatform.h": No such file or directory NMAKE : fatal error U1077: "C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 1 0.0\VC\BIN\nmake.exe"' : return code "0x2" Stop.

Adding the GLES folder and the glpatform.h file does not fix this problem:
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. [ 4%] Building C object CMakeFiles/OpenCL.dir/icd.c.obj icd.c D:\OpenCL\OpenCL-ICD-Loader-master\inc\GLES/glplatform.h(28) : fatal error C1083: Cannot open include file: "KHR/khrplatform.h": No such file or directory NMAKE : fatal error U1077: "C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" : return code "0x2" Stop.

I obviously don't have this file and have no clue where to get it. If I create a folder KHR and put this file in I get the same error as you can observe below:

Using the gl.h file from the GLSC folder (1.0.1) did not work either:
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. [ 4%] Building C object CMakeFiles/OpenCL.dir/icd.c.obj icd.c D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(207) : error C2143: syntax error : missing ";" before "const" D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : warning C4047: "=" : "int" differs in levels of indirection from "const cl_context_properties *" D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : error C2109: subscript requires array or pointer type D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(209) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(211) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(211) : error C2109: subscript requires array or pointer type D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(213) : error C2065: "property" : undeclared identifier D:\OpenCL\OpenCL-ICD-Loader-master\icd.c(213) : error C2109: subscript requires array or pointer type NMAKE : fatal error U1077: "C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" : return code "0x2" Stop. NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" : return code "0x2" Stop.

This means even more confusing errors. By the way, these are the same errors you get if you build without a GL folder (and therefore no gl.h file).

In any case I was able to build the ICD Loader and test ist successfully on an Ubuntu Linux 16.04 LTS running in a virtual machine, with as far as I can tell no OpenGL files available besides the one I added manually from the above mentioned OpenGL repo (I used the GLES/gl.h in the inc/GL folder).

It would be great if you can help me here.

Regards,
viswph

@kepatil
Copy link
Contributor

kepatil commented May 3, 2017

Thanks @viswph, I will try to recreate your setup and see what's going on.

The ICD loader uses GL/D3D data types for arguments to interop functions like clCreateFromGLBuffer, hence the headers are included. It may be possible to remove that dependency.

@PhilippWph
Copy link
Author

You're welcome, @kepatil.
I would assume that the dependency to OpenGL is required due to the desired CL/GL interoperability.
It would be nice to have a convenient way to get the required GL headers without needing to install OpenGL or a device driver.

@kepatil kepatil self-assigned this Feb 27, 2018
@chfast
Copy link

chfast commented Mar 6, 2018

This also affects Linux.

@ltowarek
Copy link
Contributor

ltowarek commented Apr 5, 2018

I believe that #30 can solve the OpenGL issue.

@kepatil
Copy link
Contributor

kepatil commented Apr 10, 2018

Thanks! I have accepted #30. Closing the issue.

@kepatil kepatil closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants