系统环境:

$ 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. 软件包管理:rpm命令管理-安装升级与卸载

    严格区分大小写 卸载命令不许再包的目录下执行.

  2. chkconfig添加进入服务后,出现的现象

    比如在php-fpm添加服务中,一部分脚步如下 #!/bin/sh       #       # php-fpm - this script starts and stops the php-fpm ...

  3. SV中的线程

    SV中线程之间的通信可以让验证组件之间更好的传递transaction. SV对verilog建模方式的扩展:1) fork.....join 必须等到块内的所有线程都执行结束后,才能继续执行块后的语 ...

  4. n的二进制中有几个1

    实例十七:n的二进制中有几个1 方法:result=n & (n-1)   n&(n-1)的目的使最低位的1不断翻转. 比如:n=108,其二进制表示为0110 1100,则n& ...

  5. 浅谈EM算法的两个理解角度

    http://blog.csdn.net/xmu_jupiter/article/details/50936177 最近在写毕业论文,由于EM算法在我的研究方向中经常用到,所以把相关的资料又拿出来看了 ...

  6. 2017-2018-2 20165207 实验四《Android开发基础》实验报告

    2017-2018-2 20165207 实验四<Android开发基础>实验报告 检查点1 安装测试Android Studio: 安装Android Studio 安装过程比较艰难,一 ...

  7. $.ajax({ }) 里面的success函数不执行 | 回调函数返回的值 用对象,下标,键值对访问不到时

    原因一般是  dataType:'json' 数据类型设置成了json  ,去掉这个设置即可 $.ajax({ }) 回调函数返回的值 用对象,下标,键值对访问不到时,考虑是否返回数据为字符串 考虑是 ...

  8. 原 用Tomcat服务器配置https双向认证过程实战

    什么是https? 百度百科足够解释它:http://baike.baidu.com/view/14121.htm 工具:keytool (Windows下路径:%JAVA_HOME%/bin/key ...

  9. 获取Linux时间函数

    Linux下clock_gettime函数详解 要包含这头文件<time.h> 且在编译链接时需加上 -lrt ;因为在librt中实现了clock_gettime函数. --- stru ...

  10. 用CSS让字体在一行内显示不换行

    青枫 , 2012/07/13 18:08 , css样式设计 , 评论(0) , 阅读(2189) , Via 本站原创 大 | 中 | 小  当一行文字超过DIV或者Table的宽度的时候,浏览器 ...