mindspore 1.5源码编译依赖flatbuffers报No CMAKE_C_COMPILER找不到的错

具体过程参见: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 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CMAKE_CXX_COMPILERCMake 中用来指定 C++ 编译器的变量。当出现不到 CMAKE_CXX_COMPILER误时,可能是因为没有正确设置编译器的路径或者编译器名称未在 PATH 环境变量中。解决这个问题的方法有以下几种: 1. 设置环境变量:您可以手动设置环境变量 CMAKE_CXX_COMPILER 的值为编译器的完整路径。例如,如果您使用的是 arm-xilinx-linux-gnueabi-g 编译器,可以通过在命令行中输入以下命令来设置环境变量: export CMAKE_CXX_COMPILER=/path/to/arm-xilinx-linux-gnueabi-g 2. 在 CMakeLists.txt 中设置编译器路径:您可以在项目的 CMakeLists.txt 文件中使用 set 命令设置 CMAKE_CXX_COMPILER 变量的值。例如,如果您的编译器路径是 arm-xilinx-linux-gnueabi-g,可以在 CMakeLists.txt 中添加以下内容: set(CMAKE_CXX_COMPILER /path/to/arm-xilinx-linux-gnueabi-g) 3. 检查编译器是否正确安装:确保您的编译器已正确安装,并且在 PATH 环境变量中。您可以在终端中运行编译器的名称来检查是否能够到该编译器。 请根据您的具体情况选择适合您的方法进行解决。希望以上信息对您有帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [当CMAKECMAKE_CXX_COMPILER不到时...](https://blog.csdn.net/weixin_30682415/article/details/98586622)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [学习笔记(边缘检测_OpenCV在Zedboard上的移植).docx](https://download.csdn.net/download/weixin_44830487/12563339)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [No CMAKE_CXX_COMPILER could be found. 误解决](https://blog.csdn.net/m0_47096428/article/details/123955751)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值