前面一段時(shí)間公司要求找一個(gè)分布式軟件,于是就看了下開源的ceph,在官網(wǎng)上http:///download/下載了ceph-0.52.tar.gz源碼包。
這兒記錄了下自己安裝的過程:
操作系統(tǒng)使用的是: CentOS-6.3-x86_64;
一、先安裝一些編譯常用工具,也是本次編譯所需要用到的工具:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>yum install automake autoconf automake libtool make</span>
二、然后就開始編譯ceph源碼了,解壓ceph-0.52.tar.gz,并進(jìn)入到源碼目錄下:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>#tar -xzf ceph-0.52.tar.gz
- <span style="white-space:pre"> </span>#cd ceph-0.5.2
- <span style="white-space:pre"> </span>#./autogen.sh
- <span style="white-space:pre"> </span>#./configure</span>
執(zhí)行./configure時(shí)會(huì)報(bào)一些錯(cuò)誤:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>configure: error: libuuid not found
- <span style="white-space:pre"> </span>configure: error: no FUSE found (use --without-fuse to disable)
- <span style="white-space:pre"> </span>configure: error: No usable version of libedit found.
- <span style="white-space:pre"> </span>configure: error: libaio not found</span>
這是因?yàn)槿鄙僖恍┮蕾嚢?,安裝所需要的依賴包:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>yum install libuuid-devel
- <span style="white-space:pre"> </span>yum install fuse-devel
- <span style="white-space:pre"> </span>yum install libedit-devel
- <span style="white-space:pre"> </span>yum install libaio-devel
- <span style="white-space:pre"> </span>yum install keyutils-libs-devel
- <span style="white-space:pre"> </span>yum install gcc-c++
- <span style="white-space:pre"> </span>yum install cryptopp-devel</span>
成功安裝好以上依賴包后在執(zhí)行命令:
- <span style="font-size:14px;"><span style="white-space:pre"> </span>#./configure --without-tcmalloc --without-libatomic-ops</span>
運(yùn)行這個(gè)命令的時(shí)候又遇到問題,還是的繼續(xù)解決:- <span style="font-size:14px;"><span style="white-space:pre"> </span>checking boost/spirit.hpp usability... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>nochecking boost/spirit.hpp presence... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>nochecking for boost/spirit.hpp... </span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>noconfigure: error: in `/home/ceph-0.29':</span>
- <span style="font-size:14px;"><span style="white-space:pre"> </span>configure: error: "Can't find boost spirit headers"See `config.log' for more details</span>
這是缺少boost,我通過yum安裝boost后沒有解決,于是我下載boost源碼包boost_1_46_0.tar.gz,解壓后進(jìn)行編譯:
- <span style="white-space:pre"> </span># ./bootstrap.sh //腳本,生成 bjam可執(zhí)行程序,然后再執(zhí)行下面的配置,就編譯完成了。
-
- <span style="white-space:pre"> </span>#./bjam --with-date_time --with-system --with-regex --with-thread --with-filesystem --with-serialization --with-iostreams --with-math --with-mpi --with-program_options --with-python --with-math --with-signals --layout=tagged install variant=debug,release link=static --runtime-link=static threading=multi stage
以上完成后,再執(zhí)行命令:
- <span style="white-space:pre"> </span>./configure --without-tcmalloc --without-libatomic-ops
成功通過?,F(xiàn)在就進(jìn)行編譯:
- <span style="white-space:pre"> </span>#make
哈哈,“前途是光明的,道路是曲折的”,又遇到了不想遇到的問題:
- <span style="white-space:pre"> </span>error: expat.h: No such file or directory
- <span style="white-space:pre"> </span>error: ‘XML_Parser’ does not name a type
一看就知道肯定是缺少某個(gè)包:
- <span style="white-space:pre"> </span>yum install expat-deve
安裝好后再編譯:
- <span style="white-space:pre"> </span>#make
- <span style="white-space:pre"> </span>#make install
到此,安裝成功?。。?!
當(dāng)然,你可以通過官網(wǎng)上的安裝方法安裝:
http:///docs/master/install/rpm/
|