系统:CentOs6.9

gcc版本:5.1.0

github上拉取vim工程之后,cd src,执行一下命令:

$ ./configure
$ sudo make
gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE= -o objects/arabic.o arabic.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
make: *** [objects/arabic.o] Error

发现找不到cc1。全局找下cc1在哪:

$ sudo find / -name cc1
/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.1./cc1
/usr/libexec/gcc/x86_64-redhat-linux/4.4./cc1
/root/software/gcc-5.1-build/gcc/cc1
/root/software/gcc-5.1-build/stage1-gcc/cc1
/root/software/gcc-5.1-build/prev-gcc/cc1

建立一个软连接:

$ sudo ln -s /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.1./cc1 /usr/bin/cc1

重新编译一下:

$ sudo make
gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE= -o objects/arabic.o arabic.c
In file included from os_unix.h::,
from vim.h:,
from arabic.c::
/usr/include/stdio.h::: fatal error: stddef.h: No such file or directory
compilation terminated.
make: *** [objects/arabic.o] Error

发现还是有问题,而且这个报错报在了库文件

全局找下这个文件:

$ sudo find / -name stddef.h
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/5.1./include/stddef.h
/usr/include/linux/stddef.h
/usr/lib/gcc/x86_64-redhat-linux/4.4./include/stddef.h
/root/software/gcc-5.1-build/gcc/include/stddef.h
/root/software/gcc-5.1-build/stage1-gcc/include/stddef.h
/root/software/gcc-5.1-build/prev-gcc/include/stddef.h
/root/software/gcc-5.1./gcc/ginclude/stddef.h
/root/software/gcc-5.1./libstdc++-v3/include/c_compatibility/stddef.h

发现是能找到,不过报错的文件的位置,是/usr/include/stdio.h,感觉是路径问题了。

尝试用sudo权限运行./configure:

$ sudo ./configure
configure: loading cache auto/config.cache
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler works... no
configure: error: in `/home/haiming.li/opensource/vim/src':
configure: error: C compiler cannot create executables
See `config.log' for more details

同样通过find命令,找到config.log所在的位置是src/auto下面,打开看看:

感觉很莫名的报错,而且为何sudo与非sudo执行的时候结果差别那么大呢?

猜测是sudo的gcc跟非sudo下的gcc,版本不一致,尝试验证下:

$ which gcc
/usr/local/bin/gcc $ sudo which gcc
/usr/bin/gcc

果然,sudo和非sudo下,gcc调用的执行程序不一样。/usr/local/bin/gcc --version 和 /usr/bin/gcc --version的执行结果是一样的,这个比较莫名。不过如果做下软连接,我相信能解决问题。

先对原来的/usr/bin下的gcc做下备份:

$ cd /usr/bin/
$ sudo mv gcc gcc_bak
$ sudo ln -s /usr/local/bin/gcc gcc

继续:

$ ./configure
$ sudo make

然后报了类似这样的错误:

/opt/local/bin/gcc-mp-4.8 -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/local/include  -g -O2 -D_FORTIFY_SOURCE=       -o objects/buffer.o buffer.c
In file included from vim.h::,
from buffer.c::
auto/osdef.h::: error: conflicting types for 'printf'
extern int printf __ARGS((char *, ...));

google之后,只发现了一个日文网页,而且说得好像不是一个问题,灵机一动下,make clean了一下,然后make就通过了,接着

$ sudo make install

执行下vim:

$ vim
-bash: /usr/bin/vim: No such file or directory

在编译日志里面找了找,感觉vim应该是在/usr/local/bin/vim:

$ /usr/local/bin/vim --version
VIM - Vi IMproved 8.1 ( May , compiled May ::)
Included patches: -... 果然在这里,做下软连接:
$ sudo ln -s /usr/local/bin/vim /usr/bin/vim

OK,大功告成,手动编译vim8.1搞定。

Centos手动编译安装vim8的更多相关文章

  1. CentOS手动编译安装gcc

    最近尝试了fedora.ubuntu.mint.debian.opensuse等多种linux发行版,与CentOS比较之后还是感觉之前用的CentOS比较熟悉,比较习惯.现在CentOS的最新版本为 ...

  2. centos手动编译安装apache、php、mysql

    64位centos 5.5手动安装lamp,要求curl.json.pdo_mysql.gd,记录如下. centos 5.4.5.5.5.6的内核都是2.6.18,都可以安装php 5.3. 卸载旧 ...

  3. LNAMP服务器环境搭建(手动编译安装)

    LNAMP服务器环境搭建(手动编译安装) 一.准备材料 阿里云主机一台,操作系统CentOS 6.5 64位 lnamp.zip包(包含搭建环境所需要的所有软件) http://123.56.144. ...

  4. centos mysql 编译安装

    centos mysql 编译安装 1.安装 创建MySQL用户 sudo useradd mysql 下载MySQL的源码包,我们这里使用的时5.5.18 安装依赖 sudo yum -y inst ...

  5. web服务器学习1---httpd-2.4.29源码手动编译安装

    环境准备: 系统:CentOS 7.4 软件:httpd-2.4.29 一  Apache主要特点 apache服务器在功能,性能和安全性等方面表现比较突出,可以较好地满足web服务器地应用需求.主要 ...

  6. 手动编译安装tmux

    tmux的好处就不多说了,总之是多屏管理的神器.通常我们用系统通用的安装方式可以安装到tmux,但有时候,安装到的可能不是我们所需要的版本,又或者软件源里面没有带tmux.这个时候就需要手动编译安装了 ...

  7. centos下编译安装lnmp

    centos下编译安装lnmp 本文以centos为背景在其中编译安装nginx搭建lnmp环境. 编译安装nginx时,需要事先安装 开发包组"Development Tools" ...

  8. CentOS 7 编译安装 Code::Blocks

    CentOS 7 编译安装 Code::Blocks yum install cairo-devel yum install pango-devel yum install atk-devel yum ...

  9. Debian/Ubuntu手动编译安装MongoDB C++11驱动及驱动测试

    本文章仅限cnblogs网站内转载!请某网站自觉,遵纪守法,尊重原创! 系统环境情况: 最小化.无桌面环境 新安装的Debian 8 Server 版本操作系统虚拟机一台 手动编译安装MongoDB ...

随机推荐

  1. 【数据库】python访问mysql

    import MySQLdb 所有的数据库遵循相同的python database API 需要建立connection对象连接数据库,之后建立cursor对象处理数据. conn = MySQLdb ...

  2. Android 进阶16:IntentService 使用及源码解析

    It's time to start living the life you've only imagined. 读完本文你将了解: IntentService 简介 IntentService 源码 ...

  3. ng $interval(周期性定时器) $timeout(延迟定时器)

    <!DOCTYPE html> <html ng-app="myApp"> <head lang="en"> <met ...

  4. golang日期转字符串,仿照C#中的日期格式结构体

    1.日期格式集合.日期转字符串方法 package util import ( "strings" "time" ) //日期格式:模仿java中的结构体 ty ...

  5. svn的使用流程

    一.安装: 1. 服务器端:VisualSVN_Server 2. 客户端:TortoiseSVN 二.使用VisualSVN Server建立版本库 1. 首先打开VisualSVN Server ...

  6. 处理SQL Server 异常常用步骤

    处理SQL Server 异常常用步骤 SQL Server常见的问题主要是SQL问题造成,常见的主要是CPU过高和阻塞. 一.CPU过高的问题 1.查询系统动态视图查询执行时间长的sql语句 WIT ...

  7. 《DSP using MATLAB》示例Example7.18

    代码: M = 33; alpha = (M-1)/2; l = 0:M-1; wl = (2*pi/M)*l; T1 = 0.1095; T2 = 0.598; Hrs = [zeros(1,11) ...

  8. fn project 扩展

    目前支持的扩展方式   Listeners - listen to API events such as a route getting updated and react accordingly. ...

  9. (转)Android中的页面切换动画

    这段时间一直在忙Android的项目,总算抽出点时间休息一下,准备把一些项目用到的Android经验分享一下. 在Android开发过程中,经常会碰到Activity之间的切换效果的问题,下面介绍一下 ...

  10. spring mvc处理http请求报错:java.lang.IllegalStateException: getInputStream() has already been called for this request

    发送post请求到controller处理失败,报错日志如下: java.lang.IllegalStateException: getInputStream() has already been c ...