cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
379 Views
Registered: ‎02-07-2020

Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

Hi to all!

I run the examples of ocl_kernels through Vitis GUI without problem following the GUIREADME.md.

When i try to replicate the example from the beginning without downloading the example i face up with the following error.

I create the src files, host.cpp and vadd.cl from scratch and when i  try to bulid i get....

16:03:09 **** Incremental Build of configuration Emulation-SW for project cl_burst ****
make -j8 incremental 
g++ -std=c++0x -DVITIS_PLATFORM=xilinx_u200_xdma_201830_2 -D__USE_XOPEN2K8 -I/opt/xilinx/xrt/include/ -I/home/stavros/opt2/Xilinx/Xilinx_Vitis/Vivado/2019.2/include/ -O0 -g -Wall -c -fmessage-length=0 -o "src/host.o" "../src/host.cpp"
../src/host.cpp:24:10: fatal error: xcl2.hpp: No such file or directory
 #include "xcl2.hpp"
          ^~~~~~~~~~
compilation terminated.
makefile:87: recipe for target 'src/host.o' failed
make: *** [src/host.o] Error 1

16:03:10 Build Finished (took 523ms)

WARNING: No binary containers were found.

Any help please?

Screenshot from 2020-03-28 16-06-06.png
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
230 Views
Registered: ‎07-16-2008

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

You need to set the .xclbin as argument to the host program. Please open Run Configurations, and check "automatically add binary container(s) to arguments", as shown in below figures.

cl1.png

 

cl2.png

Then launch sw_emu run again.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

Tags (1)
8 Replies
Highlighted
Moderator
Moderator
325 Views
Registered: ‎01-16-2013

Re: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

@stzog 

 

Check the following links:

https://forums.xilinx.com/t5/Vitis-SDAccel-and-SDSoC/missing-lt-CL-cl2-hpp-gt/td-p/1010553 

https://forums.xilinx.com/t5/Vitis-SDAccel-and-SDSoC/xcl2-hpp-cannpt-be-found/td-p/897318 

 

https://github.com/Xilinx/SDAccel_Examples/blob/master/libs/xcl2/xcl2.hpp 

 

--Syed

---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

Did you check our new quick reference timing closure guide (UG1292)?
---------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
271 Views
Registered: ‎02-07-2020

Re: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

@syedz

Still no solution even after reading your recommendations...

I Just have the host and the kernel code and i want to compile and run in Vitis GUI.

I go to new project application i select the xilinx_u200_xdma_201830_2 platform then i select Empty application.

Then i add new files to the src folder and i create the host.cpp and the vadd.cpp files. Below the image shows my configuration.Is the procedure i follow right or i miss any point?Then i hit compile button and i receive the above mentioned error.When i load the examples an extra folder libs that contains bitmap and xcl2 subfolders and qor.json and xrt.ini files are created.I this the point i miss?The examples run flawlessly on my pc.

Thanks in advance for your help.

Screenshot from 2020-03-30 00-17-52.png
Screenshot from 2020-03-30 00-22-40.png
Screenshot from 2020-03-30 00-26-09.png
Screenshot from 2020-03-30 00-30-16.png
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
278 Views
Registered: ‎07-16-2008

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

Just to add that in GUI flow, you need to add all necessary include files. You may want to inspect the makefile.

For Vitis Accel examples, the xcl2.hpp is located at:

https://github.com/Xilinx/Vitis_Accel_Examples/tree/master/common/includes/xcl2

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Highlighted
Adventurer
Adventurer
259 Views
Registered: ‎02-07-2020

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

@graces

Thanks For your help!

Can you be more specific?Except Host and kernel cpp files what else should i add in project?Do i have to create my own makefile?

All that i have is just host and kernel c++ code...Below the error.

Thanks in advance

Screenshot from 2020-03-30 12-52-24.png
0 Kudos
Highlighted
Adventurer
Adventurer
249 Views
Registered: ‎02-07-2020

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

 Hi again!

I managed to overcome the previous error and have compiled as shown below(Is it correct...???). But after compile when i run i have the following result that is different from the original example where the output is numbers.

What do i miss in the procedure?

Thanks in advance!

 

Screenshot from 2020-03-30 14-16-01.png
Screenshot from 2020-03-30 15-49-56.png
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
231 Views
Registered: ‎07-16-2008

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

You need to set the .xclbin as argument to the host program. Please open Run Configurations, and check "automatically add binary container(s) to arguments", as shown in below figures.

cl1.png

 

cl2.png

Then launch sw_emu run again.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

Tags (1)
Highlighted
Adventurer
Adventurer
222 Views
Registered: ‎02-07-2020

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
205 Views
Registered: ‎07-16-2008

回复: Vitis_Accel_Examples/ocl_kernels example build error.

Jump to solution

xcl2.mk is not required to be added to /src. It looks to me the most easy way is to add xcl2.hpp and xcl2.cpp to /src as they are not in default include directories in the project.

Our Vitis examples seem to be mostly based on make/command line flow. You may take a look at this one in Vitis Tutorial to get a general idea.

https://github.com/Xilinx/Vitis-Tutorials/blob/master/docs/getting-started-rtl-kernels/README.md

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------