quic / sample-apps-for-robotics-platforms

Other
121 stars 50 forks source link

Error while Building AI Vision solution application in RB5,error: SNPE/SNPE.hpp: No such file or directory #99

Closed ManuAPPU closed 9 months ago

ManuAPPU commented 9 months ago

Hi, i am trying to build AI Vision solution application using Yolov5s model in RB5 , i have done all the model preparations steps and all, but while building i am getting the following error error,

root@qrb5165-rb5:~/sample-apps-for-robotics-platforms/RB5/linux_kernel_5_x/AI-ML-apps/AI_Vision_Solutions/build# make Scanning dependencies of target main [ 11%] Building CXX object src/CMakeFiles/main.dir/Configuration.cpp.o [ 22%] Building CXX object src/CMakeFiles/main.dir/DecodeQueue.cpp.o [ 33%] Building CXX object src/CMakeFiles/main.dir/ModelInference.cpp.o In file included from /root/sample-apps-for-robotics-platforms/RB5/linux_kernel_5_x/AI-ML-apps/AI_Vision_Solutions/src/../inc/YOLOv5Snpe.h:9, from /root/sample-apps-for-robotics-platforms/RB5/linux_kernel_5_x/AI-ML-apps/AI_Vision_Solutions/src/ModelInference.cpp:3: /root/sample-apps-for-robotics-platforms/RB5/linux_kernel_5_x/AI-ML-apps/AI_Vision_Solutions/src/../inc/SNPERuntime.h:10:10: fatal error: SNPE/SNPE.hpp: No such file or directory 10 | #include "SNPE/SNPE.hpp" | ^~~~~~~ compilation terminated. make[2]: [src/CMakeFiles/main.dir/build.make:89: src/CMakeFiles/main.dir/ModelInference.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:94: src/CMakeFiles/main.dir/all] Error 2 make: *** [Makefile:84: all] Error 2

skbhat commented 9 months ago

In the latest version of SNPE, the location of SNPE.hpp has changed. After running cmake inside a build directory do the following:

Edit src/CMakeFiles/main.dir/flags.make add the location of SNPE.hpp. For example I had to add the following:

-I/opt/qcom/aistack/snpe/2.19.0.240124/include/SNPE/

Even after this you may get linker error "cannot find -lSNPE: No such file or directory"

Then edit the file src/CMakeFiles/main.dir/link.txt. Search for the string -lSNPE. For me it was occurring three times. Replace each with the actual path to libSNPE.so. The path will be dependent upon the architecture (x86_64 or aarch64) and version of cpp compiler. For RB5 and gcc version 9.4 I had to add:

/opt/qcom/aistack/snpe/2.19.0.240124/lib/aarch64-ubuntu-gcc9.4/libSNPE.so

Thanks in advance to any experts who can correct it in the CMakeLists.txt file itself.

regards skbhat

quic-sbudha commented 9 months ago

Hi @ManuAPPU

For latest SNPE, please update "RB5/linux_kernel_5_x/AI-ML-apps/AI_Vision_Solutions/src/CMakeLists.txt"

-set(SNPE_INCDIR ${SNPE_SDK_BASE_DIR}/include/zdl) +set(SNPE_INCDIR ${SNPE_SDK_BASE_DIR}/include/SNPE)

Thanks, Sumith