【環境說明】
操作系統: 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... error: downloading 'https://github.com/openssl/openssl/archive/refs/tags/OpenSSL_1_1_1k.tar.gz' failed |
解決:
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 Tell CMake where to find the compiler by setting either the environment
Tell CMake where to find the compiler by setting either the environment |
解決:
1、設置CC和CXX環境變量 export CC=/usr/local/gcc7.3.0/bin/gcc 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