系统环境:

$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.8 (Final)
Release: 6.8
Codename: Final
$ getconf LONG_BIT $ which cmake
/usr/bin/cmake
$ cmake --version
cmake version 2.8.12.2
$ which ninja
/usr/bin/ninja
$ ninja --version
1.7.

问题:使用cmake工具且选用Ninja作为编译工具(build program)时,报错,找不到Ninja的程序,具体信息如下:

 CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file: /home/jgeng/avs2-build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file: /home/jgeng/avs2-build/CMakeFiles/2.8.12.2/CMakeCXXCompiler.cmake
-- Configuring incomplete, errors occurred!

解决方法:

# ln -s /usr/bin/ninja /usr/bin/ninja-build
# strace cmake -GNinja .. | grep -i ninja
access("ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/usr/local/sbin/ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/usr/local/bin/ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/sbin/ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/bin/ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/usr/sbin/ninja-build", R_OK) = - ENOENT (No such file or directory)
access("/usr/bin/ninja-build", R_OK) = - ENOENT (No such file or directory)

cmake 在设置build program的时候找的是ninja-build程序,而不是ninja程序。

参考:https://stackoverflow.com/questions/38658014/ninja-not-found-by-cmake

CMake Error: CMake was unable to find a build program corresponding to "Ninja".的更多相关文章

  1. vs2012+cmake+opencv+opencv unable to find a build program corresponding to "Visual Studio 12 Win64". CMAKE_MAKE_PROGRAM is not set

    搜索了下,说什么的都有! 一,提示找不到 cmake-2.8.12.1 的 modles 卸载了cmake后发现 cmd 中的 cmake --version 还是 2.8.11.1 找到是我的cyg ...

  2. CMake Error: your CXX compiler: "" was not found

    [root@amax src]# cmake . -- The CXX compiler identification is unknown CMake Error at /usr/local/sha ...

  3. Linux下执行ls命令提示CMake Error错误

    一.系统环境 Fedora10 二.出错情况 执行ls命令出现如下错误提示: CMake Error: The source directory "/etc/--color=auto&quo ...

  4. mysqlQL 5.7 安装报错CMake Error at cmake/boost.cmake:81 (MESSAGE)

    CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BO ...

  5. CMake Error at cuda_compile_generated_warp.cu.o.cmake:264 (message)

    今天,我来给大家分享一下opencv安装时报的错.然后讲错是怎么解决的. 为啥老是写一些环境搭建的博客?因为环境搭建琐碎而繁杂,希望写下来,帮助大家.让大家少走弯路. 专注主业,专注算法的实现和优化. ...

  6. CMake error with move_base_msgs问题解决

    错误 CMake Error at /opt/ros/groovy/share/catkin/cmake/catkinConfig.cmake: (find_package): Could not f ...

  7. CMake Error at cmake/OpenCVUtils.cmake

    CMake Error at cmake/OpenCVUtils.cmake:1047 (message): Failed to download . Status= Call Stack (most ...

  8. CMake Error: Curses library not found. Please install appropriate package

    编译安装MySQL的时候,出现错误: -- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Err ...

  9. CMake Error at cmake/boost.cmake:76 (MESSAGE):

    编译mysql5.7.9的时候报错 CMake Error at cmake/boost.cmake:76 (MESSAGE): You can download it with -DDOWNLOAD ...

随机推荐

  1. 浅谈Java中的初始化和清理

    引言 这篇文章我们主要介绍Java初始化和清理的相关内容,这些内容虽然比较基础,但是还是在这边做一个简单的总结,方便以后查阅. 初始化过程 Java尽力保证:所有变量在使用之前都会得到恰当的初始化(对 ...

  2. Lintcode: Heapify && Summary: Heap

    Given an integer array, heapify it into a min-heap array. For a heap array A, A[0] is the root of he ...

  3. sql server 视图的操作

    -- 判断要创建的视图名是否存在if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[视图名]') and OBJ ...

  4. MFC六大核心机制之五、六:消息映射和命令传递

    作为C++程序员,我们总是希望自己程序的所有代码都是自己写出来的,如果使用了其他的一些库,也总是千方百计想弄清楚其中的类和函数的原理,否则就会感觉不踏实.所以,我们对于在进行MFC视窗程序设计时经常要 ...

  5. HDU 1586 log 的运用

    log函数的应用,因为 log(a^b)=b*log(a); log(a*b)=log(a)+log(b); 比如 log10(123456789)==log10(1.23456789)+8; log ...

  6. python+Django框架运用(一)

    Django 介绍: django是一个采用Python语言开发的开源框架,2005年发布.早期是做新闻以及内容管理的网站的,提供了非常强大的后管理系统. django官网:https://www.d ...

  7. Linux基础命令---cp

    cp 复制文件,可以将一个文件复制到另外一个地方,也可以将多个文件复制到目录. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.SUSE.openSUSE.Fedora. 1.语 ...

  8. ajax return true/false无效原因

    错误示例:function checkCP(customerId,productId){ $.ajax({ url:"/cp/checkCP", type:"post&q ...

  9. Tomcat分windows版和linux版

    Tomcat分windows版和linux版 官方下载链接:http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.37/bin/ windows下载e ...

  10. 【运行错误】Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.

    代码如下: <html> <head> <script> /*window.frames[]可以通过下标或名称访问单独的frame*/ window.onload= ...