具体过程参见:https://bbs.huaweicloud.com/forum/forum.php?mod=redirect&goto=findpost&ptid=168456&pid=1372954&fromuid=70062
wsl环境。编译依赖的时候,已经编译了很多依赖包,当编译到 flatbuffers 时,报以下错误:
具体文本日志为:
Found pkg: pybind11
go to link flatbuffers
pkg name:flatbuffers,flatbuffers
flatbuffers config hash: 4d439c3da37c9e161745c7657a64fd90
_FIND:/home/ascend/mindspore/build/mindspore/.mslib/flatbuffers_2.0.0_4d439c3da37c9e161745c7657a64fd90
download: , flatbuffers , https://github.com/google/flatbuffers/archive/v2.0.0.tar.gz
-- Populating flatbuffers
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ascend/mindspore/build/mindspore/_deps/flatbuffers-subbuild
[100%] Built target flatbuffers-populate
flatbuffers_SOURCE_DIR : /home/ascend/mindspore/build/mindspore/_deps/flatbuffers-src
-- 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.
-- Configuring incomplete, errors occurred!
See also "/home/ascend/mindspore/build/mindspore/_deps/flatbuffers-src/_build/CMakeFiles/CMakeOutput.log".
See also "/home/ascend/mindspore/build/mindspore/_deps/flatbuffers-src/_build/CMakeFiles/CMakeError.log".
CMake Error at cmake/utils.cmake:179 (message):
error! when
/usr/local/bin/cmake;-DCMAKE_C_COMPILER=;-DCMAKE_CXX_COMPILER=;-DFLATBUFFERS_BUILD_TESTS=OFF;-DCMAKE_INSTALL_LIBDIR=lib;-DCMAKE_BUILD_TYPE=Release;-G;Unix
Makefiles;-DCMAKE_C_FLAGS=-fPIC -fPIE -D_FORTIFY_SOURCE=2 -O2
-fstack-protector-strong;-DCMAKE_CXX_FLAGS=-fPIC -fPIE -D_FORTIFY_SOURCE=2
-O2
-fstack-protector-strong;-DCMAKE_INSTALL_PREFIX=/home/ascend/mindspore/build/mindspore/.mslib/flatbuffers_2.0.0_4d439c3da37c9e161745c7657a64fd90;/home/ascend/mindspore/build/mindspore/_deps/flatbuffers-src/
in /home/ascend/mindspore/build/mindspore/_deps/flatbuffers-src/_build
Call Stack (most recent call first):
cmake/utils.cmake:369 (__exec_cmd)
cmake/external_libs/flatbuffers.cmake:31 (mindspore_add_pkg)
cmake/mind_expression.cmake:33 (include)
CMakeLists.txt:54 (include)
-- Configuring incomplete, errors occurred!
See also "/home/ascend/mindspore/build/mindspore/CMakeFiles/CMakeOutput.log".
See also "/home/ascend/mindspore/build/mindspore/CMakeFiles/CMakeError.log".
换回到3.18的版本:
wget https://cmake.org/files/v3.18/cmake-3.18.3.tar.gz
tar -zxvf cmake*.gz
cd cmake-3.18.3
./configure
make
sudo make install
重新编译MindSpore:
bash build.sh -e gpu