码迷,mamicode.com
首页 > 其他好文 > 详细

cmake编译时遇到的问题解决

时间:2014-11-19 11:32:05      阅读:366      评论:0      收藏:0      [点我收藏+]

标签:gcc   cmake   bootstrap   

编译cmake首先需要gcc环境,可以执行 gcc --version命令看看。

如果没有,可以使用yum或从cd中进行安装,此处是在虚拟机中从cd中进行安装,将cd链接到虚拟机都会吧,此处略去,,,,,


链接好虚拟机启动后登陆,运行如下命令即可:

cd 
mkdir cd-dvd
mount /dev/cdrom cd-dvd
cd cd-dvd/Packages

rpm -ivh kernel-headers-2.6.32-279.el6.x86_64.rpm
rpm -ivh glibc-headers-2.12-1.80.el6.x86_64.rpm  --force --nodeps
rpm -ivh glibc-devel-2.12-1.80.el6.x86_64.rpm  --force --nodeps
rpm -ivh libgomp-4.4.6-4.el6.x86_64.rpm
rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-4.el6.x86_64.rpm


rpm -ivh cpp-4.4.6-4.el6.x86_64.rpm --force --nodeps
rpm -ivh libmpcdec-1.2.6-6.1.el6.x86_64.rpm --force --nodeps


rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm


rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm --force --nodeps


中途遇到的几个问题:

1、/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory

     最后发现是需要安装mpfr-2.4.1-6.el6.x86_64.rpm

2、---------------------------------------------
CMake 3.0.2, Copyright 2000-2014 Kitware, Inc.
C compiler on this system is: cc 
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /usr/local/cmake-3.0.2/Bootstrap.cmk/cmake_bootstrap.log
---------------------------------------------

最后发现是需要安装gcc-c++环境

rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm --force --nodeps


ok,进入cmake目录执行./bootstrp,执行结束后运行make命令进行编译,编译完成后执行make install进行安装,,,,,,,,大功告成!!!!!!!

cmake编译时遇到的问题解决

标签:gcc   cmake   bootstrap   

原文地址:http://blog.csdn.net/liuhui_306/article/details/41253175

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!