lenLRX / Atlas_ACL_E2E_Demo

188 stars 38 forks source link

有关编译失败的问题 #55

Closed Mr1006853138 closed 1 year ago

Mr1006853138 commented 1 year ago

你好,我在编译ACL_E2E_Demo时出现了如下问题,请问可能是什么原因造成的呢?

[ 81%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/STrack.cpp.o make[2]: No rule to make target '/usr/lib64/libmedia_mini.so', needed by 'libacl_demo.so'. Stop. make[2]: Waiting for unfinished jobs.... ..... ..... CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/acl_demo.dir/all' failed make[1]: [CMakeFiles/acl_demo.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2

以下是我的CANN版本和完整的编译LOG信息:


智能盒:凌华科技DLAP221 (Atlas 200)

CANN版本: Ascend-cann-nnrt_5.1.RC2_linux-aarch64.run Ascend-cann-toolkit_5.1.RC2_linux-aarch64.run


完整LOG信息

HwHiAiUser@davinci-mini:~/projects/ACL_E2E_Demo$ ./build.sh -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
-- ATLAS_DEVICE not set, detected device type: Atlas200DK -- build with libmedia TRUE -- Found Freetype: /usr/lib/aarch64-linux-gnu/libfreetype.so (found version "2.8.1") -- set ACL_PATH to default path: /usr/local/Ascend/ascend-toolkit/latest/acllib -- Configuring done -- Generating done -- Build files have been written to: /home/HwHiAiUser/projects/ACL_E2E_Demo/build Scanning dependencies of target acl_demo [ 12%] Building CXX object CMakeFiles/acl_demo.dir/src/ffmpeg_input.cpp.o [ 12%] Building CXX object CMakeFiles/acl_demo.dir/src/ffmpeg_output.cpp.o [ 12%] Building CXX object CMakeFiles/acl_demo.dir/src/acl_model.cpp.o [ 12%] Building CXX object CMakeFiles/acl_demo.dir/src/dvpp_decoder.cpp.o /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp: In member function ‘int FFMPEGInput::Init(const string&)’: /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:40:28: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] if (av_fc->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:40:28: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] if (av_fc->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:40:28: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] if (av_fc->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:51:41: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] av_cc = av_fc->streams[video_stream]->codec; ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:51:41: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] av_cc = av_fc->streams[video_stream]->codec; ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:51:41: warning: ‘AVStream::codec’ is deprecated [-Wdeprecated-declarations] av_cc = av_fc->streams[video_stream]->codec; ^~~~~ In file included from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.h:6:0, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/ffmpeg_input.cpp:1: /usr/include/aarch64-linux-gnu/libavformat/avformat.h:893:21: note: declared here AVCodecContext codec; ^~~~~ [ 15%] Building CXX object CMakeFiles/acl_demo.dir/src/vpc_resize.cpp.o [ 18%] Building CXX object CMakeFiles/acl_demo.dir/src/vpc_batch_crop.cpp.o [ 21%] Building CXX object CMakeFiles/acl_demo.dir/src/jpeg_encode.cpp.o [ 25%] Building CXX object CMakeFiles/acl_demo.dir/src/dvpp_encoder.cpp.o [ 28%] Building CXX object CMakeFiles/acl_demo.dir/src/freetype_helper.cpp.o [ 31%] Building CXX object CMakeFiles/acl_demo.dir/src/camera_input.cpp.o [ 34%] Building CXX object CMakeFiles/acl_demo.dir/src/app_profiler.cpp.o [ 37%] Building CXX object CMakeFiles/acl_demo.dir/src/yolov3_stream.cpp.o [ 40%] Building CXX object CMakeFiles/acl_demo.dir/src/yolov4_stream.cpp.o In file included from /usr/include/python3.6/numpy/ndarraytypes.h:1809:0, from /usr/include/python3.6/numpy/ndarrayobject.h:18, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/yolov4_stream.cpp:1: /usr/include/python3.6/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^~~ [ 43%] Building CXX object CMakeFiles/acl_demo.dir/src/yolov5_stream.cpp.o In file included from /usr/include/python3.6/numpy/ndarraytypes.h:1809:0, from /usr/include/python3.6/numpy/ndarrayobject.h:18, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/yolov5_stream.cpp:1: /usr/include/python3.6/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^~~ [ 46%] Building CXX object CMakeFiles/acl_demo.dir/src/yolox_stream.cpp.o In file included from /usr/include/python3.6/numpy/ndarraytypes.h:1809:0, from /usr/include/python3.6/numpy/ndarrayobject.h:18, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/yolox_stream.cpp:1: /usr/include/python3.6/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^~~ [ 50%] Building CXX object CMakeFiles/acl_demo.dir/src/yolox_bytetrack_stream.cpp.o In file included from /usr/include/python3.6/numpy/ndarraytypes.h:1809:0, from /usr/include/python3.6/numpy/ndarrayobject.h:18, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/yolox_bytetrack_stream.cpp:1: /usr/include/python3.6/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^~~ [ 53%] Building CXX object CMakeFiles/acl_demo.dir/src/focus_op.cpp.o [ 56%] Building CXX object CMakeFiles/acl_demo.dir/src/signal_handler.cpp.o [ 59%] Building CXX object CMakeFiles/acl_demo.dir/src/deep_sort_stream.cpp.o In file included from /usr/include/python3.6/numpy/ndarraytypes.h:1809:0, from /usr/include/python3.6/numpy/ndarrayobject.h:18, from /home/HwHiAiUser/projects/ACL_E2E_Demo/src/deep_sort_stream.cpp:1: /usr/include/python3.6/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

warning "Using deprecated NumPy API, disable it by " \

^~~ [ 62%] Building CXX object CMakeFiles/acl_demo.dir/src/stream_factory.cpp.o [ 65%] Building CXX object CMakeFiles/acl_demo.dir/src/device_manager.cpp.o [ 68%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/bytetrack.cpp.o [ 71%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/BYTETracker.cpp.o [ 75%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/kalmanFilter.cpp.o [ 78%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/lapjv.cpp.o [ 81%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/STrack.cpp.o make[2]: No rule to make target '/usr/lib64/libmedia_mini.so', needed by 'libacl_demo.so'. Stop. make[2]: Waiting for unfinished jobs.... [ 84%] Building CXX object CMakeFiles/acl_demo.dir/bytetrack_csrc/src/utils.cpp.o /home/HwHiAiUser/projects/ACL_E2E_Demo/bytetrack_csrc/src/utils.cpp: In member function ‘double BYTETracker::lapjv(const std::vector<std::vector >&, std::vector&, std::vector&, bool, float, bool)’: /home/HwHiAiUser/projects/ACL_E2E_Demo/bytetrack_csrc/src/utils.cpp:256:13: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result] system("pause");


/home/HwHiAiUser/projects/ACL_E2E_Demo/bytetrack_csrc/src/utils.cpp:320:11: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result]
     system("pause");
     ~~~~~~^~~~~~~~~
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/acl_demo.dir/all' failed
make[1]: *** [CMakeFiles/acl_demo.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
---------------------------------------------------------------------------------------
lenLRX commented 1 year ago

这里的问题是这段代码 不知道为什么明明是Atlas200会有这个文件:/usr/local/Ascend/include/peripheral_api.h 所以编译的时候尝试加入Atlas200 DK的摄像头的相关代码。 这个文件照理来说应该只有Atlas200 DK这个开发板才有的。

解决方法有两种:

  1. 把/usr/local/Ascend/include/peripheral_api.h这个文件删掉
  2. 把https://github.com/lenLRX/Atlas_ACL_E2E_Demo/blob/18acf1be35939fdbb07a1344b5b22e72244e9d68/cmake/detect_device.cmake#L2 这里的if else endif删掉,只保留set(ATLAS_DEVICE "Atlas300")
Mr1006853138 commented 1 year ago

按照此方法完美解决了问题,太强了!十分感谢!