CentOS 7.6 aarch64系统源码编译安装mindspore问题处理经验分享


【环境说明】

 操作系统: CentOS 7.6 aarch64系统(内核:4.14.0-115.el7a.0.1.aarch64)

CANN环境:5.0.1版本

MindSpore:1.3.0版本(通过git clone 下载)

【问题解决经验总结】

FAQ1 编译时提示GCC 版本不满足大于等于7.3.0条件

问题:

[root@atlas_host01 mindspore]# bash build.sh -e ascend -V 310
---------------- MindSpore: build start ----------------
start build mindspore project.
-DDEBUG_MODE=off -DBUILD_PATH=/home/mindspore/build/ -DENABLE_INFER=ON -DENABLE_DUMP_PROTO=ON -DENABLE_DUMP_IR=on -DENABLE_PYTHON=on -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -DENABLE_ACL=ON -DENABLE_DEBUGGER=ON
CMake Error at CMakeLists.txt:6 (message):
  GCC version 4.8.5 must not be less than 7.3.0

解决:

1、重新安装GCC 7.3.0覆盖默认路径/usr相关文件。

2、当前环境GCC 7.3.0版本安装在/usr/local/gcc7.3.0目录下,采用如下方式解决的问题。

3、将/usr/bin/目录下的g++,gcc,c++,cpp重命名,然后创建软连接指向/usr/local/gcc7.3.0/bin目录下对应的g++,gcc,c++,cpp

4、清理build目录下的CMakeCache.txt等文件rm -rf /home/mindspore/build/mindspore/*(注:此步骤相当重要)。

5、然后在mindspore目录下再运行bash build.sh -e ascend -V 310编译

FAQ2 编译第三方依赖包时提示下载失败

问题:

-- Downloading...
   dst='/home/mindspore/build/mindspore/_deps/openssl-subbuild/openssl-populate-prefix/src/OpenSSL_1_1_1k.tar.gz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz'
CMake Error at openssl-subbuild/openssl-populate-prefix/src/openssl-populate-stamp/download-openssl-populate.cmake:170 (message):
  Each download failed!

    error: downloading 'https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz' failed
          status_code: 35
          status_string: "SSL connect error"

解决:

1、通过网址https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz 单独下载源码包。

2、然后将下载的源码包拷贝到/home/mindspore/build/mindspore/_deps/openssl-subbuild/openssl-populate-prefix/src/OpenSSL_1_1_1k.tar.gz,名字与目录下对应文件名保持一致    如这个目录下文件名:OpenSSL_1_1_1k.tar.gz。

3、然后在mindspore目录下再运行bash build.sh -e ascend -V 310编译

4、其他遇到类似问题,参考此方式处理即可(注意拷贝到的路径正确

FAQ3 编译依赖模块flatbuffers-src时提示,未找到CMAKE_C_COMPILER和CMAKE_CXX_COMPILER

问题:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

解决:

1、设置CC和CXX环境变量

export CC=/usr/local/gcc7.3.0/bin/gcc
export CXX=/usr/local/gcc7.3.0/bin/g++

2、然后在mindspore目录下再运行bash build.sh -e ascend -V 310编译

FAQ4 编译依赖模块onnx时提示NUMA_LIBRARY-NOTFOUND错误

问题:

-- operation system is Linux-4.14.0-115.el7a.0.1.aarch64
-- ACL module is enabled
-- Cache is enabled
Soft dvpp use glog to print message.
Numa include dir is: NUMA_INCLUDE_DIR-NOTFOUND
Numa library is: NUMA_LIBRARY-NOTFOUND
-- Could NOT find NUMA (missing: NUMA_INCLUDE_DIR NUMA_LIBRARY)

解决:

1、执行sudo yum install numactl-devel 安装numa相关的包(或者:sudo apt-get install libnuma-dev)。

2、然后在mindspore目录下再运行bash build.sh -e ascend -V 310编译

FAQ5 编译依赖模块onnx时提示gmpxx_LIB错误

问题:

-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
gmpxx_LIB
    linked by target "mindspore" in directory /home/mindspore/mindspore/ccsrc

解决:

1、编译安装gmp前,执行configure时需要增加参数--enable-cxx,即./configure --enable-cxx,然后再make&&make install。

2、然后在mindspore目录下再运行bash build.sh -e ascend -V 310编译

【相关指导】

参考网址:https://www.mindspore.cn/install


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM