问题描述
参考 编译云侧MindSpore Lite — MindSpore Lite master 文档 中的编译步骤,编译npu版本的python的whl包失败。
报错信息如下
-- Compile minddata in [full] mode
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- CMAKE_CURRENT_BINARY_DIR=/root/work/lishuang_project/mindspore_ubuntu2004/mindspore/lite/build/tools/kernel_builder/ascend/tbe_and_aicpu
-- CMAKE_CURRENT_SOURCE_DIR=/root/work/lishuang_project/mindspore_ubuntu2004/mindspore/lite/tools/kernel_builder/ascend/tbe_and_aicpu
-- ASCEND_TENSOR_COMPILER_INCLUDE=/usr/local/Ascend/latest/include
-- SYSTEM_NAME=ubuntu
-- SYSTEM_INFO=ubuntu_aarch64
-- RUN_TARGET=custom_opp_ubuntu_aarch64.run
-- OUT_DIR=/root/work/lishuang_project/mindspore_ubuntu2004/mindspore/lite/build/tools/kernel_builder/ascend/tbe_and_aicpu/makepkg
-- OP_COMMON_INC=
-- OP_PROTO_TARGET=cust_op_proto
-- OUTPUT_FILES=aic-ascend310-ops-info.json;aic-ascend310p-ops-info.json;aic-ascend910-ops-info.json;aic-ascend910b-ops-info.json
-- operation system is Linux
-- AICPU_CONFIG_INFO_FLAG=
-- ALL_MODULES=cust_op_proto;config_json
RUN_TARGET custom_opp_ubuntu_aarch64.run
-- Opbuild generating sources
build ops lib info:
build ops lib error: /usr/bin/ld: cannot find -lexe_graph
/usr/bin/ld: cannot find -lregister
/usr/bin/ld: cannot find -ltiling_api
collect2: error: ld returned 1 exit status
CMake Error at tools/kernel_builder/ascend/ascendc/cmake/func.cmake:42 (message):
opbuild run failed!
Call Stack (most recent call first):
tools/kernel_builder/ascend/ascendc/op_host/CMakeLists.txt:21 (opbuild)
-- Configuring incomplete, errors occurred!
See also "/root/work/lishuang_project/mindspore_ubuntu2004/mindspore/lite/build/CMakeFiles/CMakeOutput.log".
See also "/root/work/lishuang_project/mindspore_ubuntu2004/mindspore/lite/build/CMakeFiles/CMakeError.log".
环境配置
- cpu:鲲鹏920
- npu:昇腾910b
- 系统:ubuntu22.04
- gcc:7.5.0
- cann:8.0.RC2
- mindspore版本:2.2
根据报错信息,是库文件找不到,但查找/usr/local/Ascend 路径下,存在需要的库文件。 请问如何解决该问题,让编译成功
问题解答
CMake Error at tools/kernel_builder/ascend/ascendc/cmake/func.cmake:42 (message):
opbuild run failed!
Call Stack (most recent call first):
tools/kernel_builder/ascend/ascendc/op_host/CMakeLists.txt:21 (opbuild)
这里信息提示cann没有完整安装,建议您再完整安装下试一试。CANN的安装请参考此文档https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC2alpha002/softwareinst/instg/instg_0001.html