Showing results for 
Search instead for 
Did you mean: 
Honored Contributor I

Host build for Altera OpenCL with CMake files



I am trying to map an application called SLAMBench which has already been written in OpenCL to an FPGA. The application compiles totally fine for GPU/CPU OpenCL However It does not find the Altera OpenCL platfrom at all when I build. I know that FPGA OpenCL behaves differently from other platforms (e.g. in needs ClCreateProgramWithBinary() rather than ClCreateProgramWithSource() ) so I have already replaced all the init() function of the SLAMBench application with the Altera OpenCL init() function provided by examples in the Altera website. 


The error I get when I run my program is "Unable to find Intel(R) FPGA OpenCL platform". I suspect the reason the host does not find Altera platform is because the AOCL flags are not included as part of the build ( I can successfully compile and run the "hello world" example on the same machine). Now, I tried my very best to include anything that is needed in the host build (by looking at the hello world makefile) .However, the application still fails to find Altera OpenCL. The application builds by calling 3,4 CMakes and its a fairly sophisticated build overall. 


Here is the link to the application: 

It compiles the whole thing by "make" command. 


Does anyone have any idea of what I can do? There are two files called "findOpenCLCmake" file and another "CMake" that has some OpenCL stuff in the application which I have attached. I would be grateful if someone could please let me know how to change these files to hopefully find the Altera OpenCL platform in the build? 


Thanks very much!
0 Kudos
1 Reply
Honored Contributor I

Anyone has the solution?  

I am also interested in how to generate CMakeList from Makefile cause I need to code OpenCL in ROS (Robot Operating System). So it is easier to include ros packages from CMakeLists