rlguy / GridFluidSim3D

A PIC/FLIP fluid simulation based on the methods found in Robert Bridson's "Fluid Simulation for Computer Graphics"
zlib License
783 stars 95 forks source link

error: CL/cl.hpp: No such file or directory #include <CL/cl.hpp> #8

Closed ivince closed 8 years ago

ivince commented 8 years ago

2016-05-31_215440

rlguy commented 8 years ago

Hello ivince,

It looks like the OpenCL headers were not found. This could be because the OpenCL header directory is not in your search path or your machine does not have the required cl.hpp header file. What directory are your OpenCL headers in, and does that directory contain the file cl.hpp?

In the case that the OpenCL header directory is not on the search path, you may edit the OPENCLINCLUDEPATH variable in theMakefile to point to the directory that contains your OpenCL header files.

#Example:
OPENCLINCLUDEPATH=-I"path_to_headers"

The -I flag will add the _path_toheaders directory to the include search path.

In the case that your machine is missing the cl.hpp header, you can download cl.hpp from khronos.org and place it in the OpenCL header directory. You will need the cl.hpp file version that matches the version of OpenCL on your machine. To find out what version of OpenCL you have, locate the cl.h header and look for largest version number listed under the /* OpenCL Version */ section.

Let me know if this solves the issue for you.

Best Regards, Ryan

ivince commented 8 years ago

@rlguy i am not solve this issue, my environment is: windows7, nvidia k4000. i do as follow:

  1. installed MinGW, then installed packages 'g++' and 'make' from MinGW Installation Manager
  2. installed nvidia drivers
  3. download cuta-toolkit from https://developer.nvidia.com/cuda-toolkit-31-downloads and install to the directory "C:\CUDA", which include "include" and "lib" subdirectory i found directory "C:\CUDA\include\CL" do not include "cl.hpp"
  4. so i download openCL 1.2's cl.hpp from https://www.khronos.org/registry/cl/ and move it to "C:\CUDA\include\CL\"
  5. edit the project file 'Makefile':
OPENCLINCLUDEPATH=-I"C:\CUDA\include"
OPENCLLIBPATH=-L"C:\CUDA\lib"

in the project directory type: mingw32-make 2016-06-01_123502

can you help me?

rlguy commented 8 years ago

Hello ivince,

I have added the _CL_USE_DEPRECATED_OPENCL_1_1APIS declaration to the Makefile in this commit, which is a fix described in this thread: "* has not been declared" when including cl.hpp.

Let me know if this solves the issue that you are encountering.

Best Regards, Ryan

ivince commented 8 years ago

hello @rlguy, An error has occurred 2016-06-02_143701

rlguy commented 8 years ago

Hello ivince,

Sorry to hear that you are still getting errors. I am not sure why this is happening.

I have only been able to test with OpenCL 1.1 headers. I would suggest trying to replace your cl.hpp file with the 1.1 version instead of 1.2. If the program still give errors like above, try downgrading your OpenCL headers to version 1.1 by replacing the headers in C:\CUDA\include\CL\ with the 1.1 versions from khronos. Make sure to backup your current headers before trying this.

Best Regards, Ryan

ivince commented 8 years ago

Hello rlguy,

it make success when i repaced the headers with version 1.1.

thank you