cmake | 报错:CMake Error: Generator: execution of make failed. Make command was: /usr/bin/gmake -f Mak

报错:

CMake Error: Generator: execution of make failed. Make command was: /usr/bin/gmake -f Makefile cmTC_f956b/fast &&

-- Detecting C compiler ABI info - failed

-- Check for working C compiler: /usr/bin/gcc

CMake Error: Generator: execution of make failed. Make command was: /usr/bin/gmake -f Makefile cmTC_9d4d2/fast &&

-- Check for working C compiler: /usr/bin/gcc - broken

CMake Error at /usr/local/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):

The C compiler

"/usr/bin/gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /workspace/CustomOp/broadcast/build_out/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_9d4d2/fast && No such file or directory

Generator: execution of make failed. Make command was: /usr/bin/gmake -f Makefile cmTC_9d4d2/fast &&

CMake will not be able to correctly generate this project.

Call Stack (most recent call first):

CMakeLists.txt:11 (project)

-- Configuring incomplete, errors occurred!

See also "/workspace/CustomOp/broadcast/build_out/CMakeFiles/CMakeOutput.log".

See also "/workspace/CustomOp/broadcast/build_out/CMakeFiles/CMakeError.log".


解决办法:

错误的根源是 Make command : /usr/bin/gmake cmTC_003e6/fast &&。用grep查了一下,这条语句存储在CMakeCache.txt中。如:

CMakeCache.txt:CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake

是原SDK在以前的平台运行的时候留下的。而在新平台里/usr/bin/gmake和cmTC_003e6/fast 文件都没有。

解决方案:有的开发者会想到去手动更改CMakeCache.txt中的值,这是不建议的,因为未必会生效,也可能引入语法错误。

解决方案其实很简单,就是$rm所有CMakeCache。在项目重新编译的过程中,会调用cmake重新计算与运行环境相关的值。当然,用户选项如果仅在CMakeCache.txt中,而没有在项目中的其它文件中记录,需要手动添加。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值