服务器Centos(Linux)安装Scons包

2017-02-23
#Unix
  • 使用wget下载Scons包:

    wget http://prdownloads.sourceforge.net/scons/scons-2.5.0.tar.gz
    
  • 解压Scons压缩包:

    tar zxvf scons-2.5.0.tar.gz
    
  • 切换到目录下,安装

    cd scons-2.5.0/
    python setup.py install
    
  • 检验是否安装成功,输入命令scons -v命令:

    $scons -v
    SCons by Steven Knight et al.:
        script: v2.5.0.rel_2.5.0:3544:95d356f188a3[MODIFIED], 2016/04/09 14:38:50, by bdbaddog on ubuntu1404-32bit
        engine: v2.5.0.rel_2.5.0:3544:95d356f188a3[MODIFIED], 2016/04/09 14:38:50, by bdbaddog on ubuntu1404-32bit
        engine path: ['/usr/lib/scons-2.5.0/SCons']
            Copyright (c) 2001 - 2016 The SCons Foundation
    

最后,推荐Scons包的使用入门:使用 SCons 轻松建造程序

遇到的问题

Centos系统默认的python是2版本,如果被设置成了3版本会安装Scons失效。需要重新安装python 2.7.6版本:

  wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
  tar -xvf Python-2.7.6.tgz
  cd Python-2.7.6
  ./configure --prefix=/usr/local/python2.7
  make
  make install
  ln -fs /usr/local/python2.7/bin/python2.7 /usr/bin/python