Xilinx / Vitis_Accel_Examples

Vitis_Accel_Examples
http://xilinx.github.io/Vitis_Accel_Examples/
MIT License
506 stars 214 forks source link

errors on "kmeans example" #51

Closed lloo099 closed 3 years ago

lloo099 commented 3 years ago
 make all TARGET=sw_emu PLATFORM=xilinx_u200_xdma_201830_2 HOST_ARCH=x86
g++ -o kmeans /home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2/xcl2.cpp /home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/cmdparser/cmdlineparser.cpp /home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/logger/logger.cpp src/host.cpp src/fpga_kmeans.cpp src/kmeans_clustering_cmodel.c -D __USE_OPENCL__ -DNUM_CU=2 -I/opt/xilinx/xrt/include -I/tools/Xilinx/Vivado/2020.1/include -Wall -O0 -g -std=c++1y -I/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2 -I/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/cmdparser -I/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/logger -fmessage-length=0 -L/opt/xilinx/xrt/lib -lOpenCL -pthread -lrt -lstdc++ 
In file included from /home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2/xcl2.cpp:17:0:
/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2/xcl2.hpp:33:10: fatal error: CL/cl2.hpp: No such file or directory
 #include <CL/cl2.hpp>
          ^~~~~~~~~~~~
compilation terminated.
In file included from src/fpga_kmeans.h:28:0,
                 from src/host.cpp:56:
/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2/xcl2.hpp:33:10: fatal error: CL/cl2.hpp: No such file or directory
 #include <CL/cl2.hpp>
          ^~~~~~~~~~~~
compilation terminated.
In file included from src/fpga_kmeans.h:28:0,
                 from src/fpga_kmeans.cpp:17:
/home/enai/Desktop/project/enai0/Vitis_Accel_Examples/common/includes/xcl2/xcl2.hpp:33:10: fatal error: CL/cl2.hpp: No such file or directory
 #include <CL/cl2.hpp>
          ^~~~~~~~~~~~
compilation terminated.
Makefile:158: recipe for target 'kmeans' failed
make: *** [kmeans] Error 1
virata-xilinx commented 3 years ago

Hi @lloo099 ,

Can you please metion the branch you have cloned. Kindly also mention the VITIS and XRT you have sourced and the steps to reproduce.

lloo099 commented 3 years ago

Hi @lloo099 ,

Can you please metion the branch you have cloned. Kindly also mention the VITIS and XRT you have sourced and the steps to reproduce.

Sure @virata-xilinx , I did it follows these steps:

git clone https://github.com/Xilinx/Vitis_Accel_Examples.git
export VIVADO_PATH=/tools/Xilinx/Vivado/2020.1
source /tools/Xilinx/Vitis/2020.1/settings64.sh
source /opt/xilinx/xrt/setup.sh
make all TARGET=sw_emu PLATFORM=xilinx_u200_xdma_201830_2 HOST_ARCH=x86
virata-xilinx commented 3 years ago

@lloo099 , So you cloned the master branch and are sourcing 2020.1? For master you should be sourcing 2021.2. If you wish to source 2020.1, kindly clone the 2020.1 branch.

lloo099 commented 3 years ago

@lloo099 , So you cloned the master branch and are sourcing 2020.1? For master you should be sourcing 2021.2. If you wish to source 2020.1, kindly clone the 2020.1 branch.

Yes, wow. How to clone 2020.1 branch? Could you give me a link? thanks

virata-xilinx commented 3 years ago

Kindly use the following link with the "git clone" command to clone the 2020.1 branch - https://github.com/Xilinx/Vitis_Accel_Examples/tree/2020.1

lloo099 commented 3 years ago

Kindly use the following link with the "git clone" command to clone the 2020.1 branch - https://github.com/Xilinx/Vitis_Accel_Examples/tree/2020.1 same problem on 2020.1


g++ -o hello_world /home/enai/Desktop/project/enai0/Vitis_Accel_Examples-2020.1/common/includes/xcl2/xcl2.cpp src/host.cpp -I/opt/xilinx/xrt/include -I/tools/Xilinx/Vivado/2020.1/include -Wall -O0 -g -std=c++11 -I/home/enai/Desktop/project/enai0/Vitis_Accel_Examples-2020.1/common/includes/xcl2 -fmessage-length=0 -L/opt/xilinx/xrt/lib -lOpenCL -lpthread  -lrt -lstdc++ 
In file included from /home/enai/Desktop/project/enai0/Vitis_Accel_Examples-2020.1/common/includes/xcl2/xcl2.cpp:17:0:
/home/enai/Desktop/project/enai0/Vitis_Accel_Examples-2020.1/common/includes/xcl2/xcl2.hpp:34:10: fatal error: CL/cl2.hpp: No such file or directory
#include <CL/cl2.hpp>
^~~~~~~~~~~~
compilation terminated.
In file included from src/host.cpp:17:0:
/home/enai/Desktop/project/enai0/Vitis_Accel_Examples-2020.1/common/includes/xcl2/xcl2.hpp:34:10: fatal error: CL/cl2.hpp: No such file or directory
#include <CL/cl2.hpp>
^~~~~~~~~~~~
compilation terminated.

@virata-xilinx 
keryell commented 3 years ago

It is not clear what is the system you are using. On my Debian system the /usr/include/CL/cl2.hpp header comes from the opencl-clhpp-headers package. If you are using such a system, you could try an apt install opencl-clhpp-headers.

lloo099 commented 3 years ago

It is not clear what is the system you are using. On my Debian system the /usr/include/CL/cl2.hpp header comes from the opencl-clhpp-headers package. If you are using such a system, you could try an apt install opencl-clhpp-headers.

Thanks, this problem is solved.