cmake编译配置:
# Find Src file(GLOB_RECURSE SRC_FILE # ${PROJECT_SRC_ROOT}/../module/InferDetClsV2/*.cpp # ${PROJECT_SRC_ROOT}/../module/InferChipeakNet/*.cpp # ${PROJECT_SRC_ROOT}/../module/InferFeature/*.cpp ${PROJECT_SRC_ROOT}/main.cpp
${PROJECT_SRC_ROOT}/Common/*.cpp #[[ ${PROJECT_SRC_ROOT}/../module/StreamPuller/*.cpp ${PROJECT_SRC_ROOT}/../module/VideoDecoder/*.cpp
${PROJECT_SRC_ROOT}/../module/InferFace/*.cpp
${PROJECT_SRC_ROOT}/../module/InferDetCls/*.cpp
${PROJECT_SRC_ROOT}/../module/InferSegmentation/*.cpp
${PROJECT_SRC_ROOT}/../module/SrcFile/*.cpp
${PROJECT_SRC_ROOT}/../module/Bridge/*.cpp
${PROJECT_SRC_ROOT}/../module/BridgeTest/*.cpp
${PROJECT_SRC_ROOT}/../module/MQTTSub/*.cpp
${PROJECT_SRC_ROOT}/../module/MQTTPub/*.cpp
${PROJECT_SRC_ROOT}/../module/InferPolygon/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperSub/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperPubV1/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperPubV2/*.cpp]]
${PROJECT_SRC_ROOT}/../helper/waiter/*.cpp )
编译出现的错误:
root@davinci-mini:/home/HwHiAiUser/zjx/24-dmanager/app# ./env.sh
ASCEND_VERSION is set to latest by user
ARCH_PATTERN is set to arm64-linux by user, reset it to arm64-linux/acllib
– The C compiler identification is GNU 7.4.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
– Configuring done
– Generating done
– Build files have been written to: /home/HwHiAiUser/zjx/24-dmanager/app/build
Scanning dependencies of target main
[ 20%] Building CXX object CMakeFiles/main.dir/Common/check.cpp.o
[ 40%] Building CXX object CMakeFiles/main.dir/Common/Singleton.cpp.o
[ 60%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[ 80%] Building CXX object CMakeFiles/main.dir/home/HwHiAiUser/zjx/24-dmanager/helper/waiter/waiter.cpp.o
[100%] Linking CXX executable …/dist/main
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::ProcessThread1()': ModuleBase.cpp:(.text+0x488): undefined reference to
aclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::ProcessThread()': ModuleBase.cpp:(.text+0x1350): undefined reference to
aclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::Stop()': ModuleBase.cpp:(.text+0x2f8c): undefined reference to
aclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleManager.cpp.o): In function ascendBaseModule::ModuleManager::InitAcl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': ModuleManager.cpp:(.text+0x89c): undefined reference to
aclrtGetRunMode’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ResourceManager.cpp.o): In function ResourceManager::Release()': ResourceManager.cpp:(.text+0x218): undefined reference to
aclrtDestroyContext’
ResourceManager.cpp:(.text+0x310): undefined reference to aclrtResetDevice' ResourceManager.cpp:(.text+0x3f0): undefined reference to
aclFinalize’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ResourceManager.cpp.o): In function ResourceManager::InitResource(ResourceInfo&)': ResourceManager.cpp:(.text+0x788): undefined reference to
aclInit’
ResourceManager.cpp:(.text+0x874): undefined reference to aclInit' ResourceManager.cpp:(.text+0xa68): undefined reference to
aclrtSetDevice’
ResourceManager.cpp:(.text+0xc2c): undefined reference to aclrtCreateContext' ResourceManager.cpp:(.text+0xe28): undefined reference to
aclopSetModelDir’
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:179: recipe for target ‘…/dist/main’ failed
make[2]: *** […/dist/main] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/main.dir/all’ failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
正确配置:
# Find Src file(GLOB_RECURSE SRC_FILE # ${PROJECT_SRC_ROOT}/../module/InferDetClsV2/*.cpp # ${PROJECT_SRC_ROOT}/../module/InferChipeakNet/*.cpp # ${PROJECT_SRC_ROOT}/../module/InferFeature/*.cpp ${PROJECT_SRC_ROOT}/main.cpp
${PROJECT_SRC_ROOT}/Common/*.cpp
${PROJECT_SRC_ROOT}/../module/StreamPuller/*.cpp
${PROJECT_SRC_ROOT}/../module/VideoDecoder/*.cpp
${PROJECT_SRC_ROOT}/../module/InferFace/*.cpp
${PROJECT_SRC_ROOT}/../module/InferDetCls/*.cpp
${PROJECT_SRC_ROOT}/../module/InferSegmentation/*.cpp
${PROJECT_SRC_ROOT}/../module/SrcFile/*.cpp
${PROJECT_SRC_ROOT}/../module/Bridge/*.cpp
${PROJECT_SRC_ROOT}/../module/BridgeTest/*.cpp
${PROJECT_SRC_ROOT}/../module/MQTTSub/*.cpp
${PROJECT_SRC_ROOT}/../module/MQTTPub/*.cpp
${PROJECT_SRC_ROOT}/../module/InferPolygon/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperSub/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperPubV1/*.cpp
${PROJECT_SRC_ROOT}/../helper/HelperPubV2/*.cpp
${PROJECT_SRC_ROOT}/../helper/waiter/*.cpp )