作者:容易 2013-07-24
一、准备系统
安装centos6.4-64位系统选择base安装
yum install gcc
yum install gcc-c++
yum install zlib-devel
yum install pcre-devel
yum install readline readline-devel
yum install bzip2-devel
二、安装python2.7
tar -zxvf Python-2.7.3.tgz
./configure --prefix=/opt/python
make&& make install
三、编辑环境变量
vi .bashrc
增加以下内容
export PATH=/opt/python/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/python/lib
使配置生效
source .bashrc
确认使用的是编译的Python
python --version
四、安装python setuptool工具
tar -zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install
# 一、安装pcre,让mdb提供正则表达式api
# ./configure --prefix=/mdb/pcre --enable-utf8 --enable-unicode-properties
# make && make install
五、安装scons
tar -zxvf scons-2.2.0.tar.gz
cd scons-2.2.0
python setup.py build
python setup.py install
六、安装mongodb
tar -zxvf mongodb-src-r2.4.5.tar.gz
cd mongodb-src-r2.4.5
# 编辑vi SConstruct在536行将pcre的库路径添加到列表,该列中pcre的库路径
# echo '/usr/local/pcre/lib' >> /etc/ld.so.conf
# ldconfig
# /mdb/pcre/lib
# 527 elif os.sys.platform.startswith("linux"):
# 528 linux = True
# 529 platform = "linux"
# 530
# 531 env.Append( LIBS=['m'] )
# 532
# 533 if os.uname()[4] == "x86_64" and not force32:
# 534 linux64 = True
# 535 nixLibPrefix = "lib64"
# 536 env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" , "/mdb/pcre/lib"] )
scons -j 8 --prefix=/mdb/mongodb --extralib=ncurses,readline --full install
Install file: "build/linux2/extralib_ncurses_readline/client_build/libmongoclient.a" as "/mdb/mongodb/lib/libmongoclient.a"
scons: done building targets.
One Response