bl双性强迫侵犯h_国产在线观看人成激情视频_蜜芽188_被诱拐的少孩全彩啪啪漫画

CentOS6.5下如何編譯Ceph源碼

這篇文章將為大家詳細(xì)講解有關(guān)CentOS6.5下如何編譯Ceph源碼,小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。

創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站制作、做網(wǎng)站、外貿(mào)營(yíng)銷網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的民豐網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

引言

ceph源碼編譯不是一件很容易的事情,中間報(bào)了很多錯(cuò)誤,比如對(duì)C++11的依賴,對(duì)BOOST的依賴以及大量其他庫(kù)的依賴,這些過程都要一一解決。本文對(duì)編譯的過程進(jìn)行了一個(gè)詳細(xì)的說明,并對(duì)碰到的問題進(jìn)行了記錄。

具體過程
 

1. 源碼下載

git clone https://github.com/ceph/ceph

2. 編譯

./autogen.sh
./configure

環(huán)境檢查的過程中報(bào)如下錯(cuò)誤

CentOS6.5下如何編譯Ceph源碼
 

系統(tǒng)報(bào)錯(cuò),缺少C++11的支持。需要升級(jí)GCC版本以支持C++11。 我咨詢過使用CentOS7系列的同學(xué),他們自帶的GCC是高版本的,可以支持C++11.

3. GCC c++11支持
 

wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.1/gcc-4.8.1.tar.gz
tar xzf gcc-4.8.1.tar.gz  
cd gcc-4.8.1  
./contrib/download_prerequisites    //安裝依賴庫(kù)
cd ..  
mkdir build_gcc4.8.1
cd build_gcc4.8.1
../configure --prefix=/usr  -enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j8
sudo make install

4. 編譯Ceph源碼
編譯的過程中同樣出現(xiàn)了很多問題

configure: error: in `/home/ceph/ceph-src/ceph':
configure: error: libsnappy not found
See `config.log' for more details.
------------------------------------------------------------------------------------

configure: error: in `/home/ceph/ceph-src/ceph':
configure: error: libleveldb not found
See `config.log' for more details.
-------------------------------------------------------------------------------------
checking blkid/blkid.h usability... no
checking blkid/blkid.h presence... no
checking for blkid/blkid.h... no
configure: error: blkid/blkid.h not found (libblkid-dev, libblkid-devel)
-------------------------------------------------------------------------------------
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: libudev.h not found (libudev-dev, libudev-devel)
-------------------------------------------------------------------------------------
checking for malloc in -ltcmalloc... no
configure: error: in `/home/ceph/ceph-src/ceph':
configure: error: no tcmalloc found (use --without-tcmalloc to disable)
-------------------------------------------------------------------------------------
checking for FCGX_Init in -lfcgi... no
checking for LIBFUSE... yes
checking atomic_ops.h usability... no
checking atomic_ops.h presence... no
checking for atomic_ops.h... no
configure: error: in `/home/ceph/ceph-src/ceph':
configure: error: no libatomic-ops found (use --without-libatomic-ops to disable)
See `config.log' for more details.
-------------------------------------------------------------------------------------
checking xfs/xfs.h usability... no
checking xfs/xfs.h presence... no
checking for xfs/xfs.h... no
configure: error: xfs/xfs.h not found (--without-libxfs to disable)
----------------------------------------------------------------------------------------
Boost random library not found.

..........................................

主要采用如下辦法解決

4.1先把能安裝的依賴包給安裝

sudo yum install make automake autoconf  boost-devel fuse-devel gcc-c++ libtool libuuid-devel libblkid-devel keyutils-libs-devel cryptopp-devel fcgi-devel libcurl-devel expat-devel gperftools-devel libedit-devel libatomic_ops-devel snappy-devel leveldb-devel libaio-devel xfsprogs-devel git libudev-devel libcrypto++-dev libcrypto++-utils

4.2 yum找不到,手工rpm安裝

4.3 部分包不需要,直接without

./configure  --without-tcmalloc  --without-libatomic-ops

4.4 BOOST 庫(kù)缺失問題 

最后一個(gè)問題就是boost random lib can not found問題

yum顯示boost 和boost dev都有安裝,為什么boost庫(kù)有一部分存在,有一部分沒有呢。無(wú)奈之下采用編譯boost源碼的方法重裝BOOST

[root@gnop029-ct-zhejiang_wenzhou-16-12 home]# ls
boost_1_59_0  boost_1_59_0.tar.gz  c11  ceph  ceph.log  civetweb  dlftp  gcc4.7_build.tar.bz2  gcc-4.8.1  gcc-4.8.1.tar.bz2  usr  wget-log

 ./bootstrap.sh
 ./bjam -sTOOLS=gcc install


 

5 最后對(duì)ceph源碼進(jìn)行

./autogen.sh
./configure
make

此處同樣出現(xiàn)了很多問題,編譯過程中出現(xiàn)了大量undefined reference boost庫(kù)的情況。

CentOS6.5下如何編譯Ceph源碼
 

但是我在/usr/local/中可以找到boost的頭文件以及二進(jìn)制庫(kù)。
 于是追查makefile文件,發(fā)現(xiàn)其中涉及到的BOOST庫(kù)內(nèi)容如下:

BOOST_PROGRAM_OPTIONS_LIBS = -lboost_program_options-mt 
BOOST_RANDOM_LIBS = -lboost_random 
BOOST_REGEX_LIBS = -lboost_regex-mt 
BOOST_THREAD_LIBS = -lboost_thread-mt

于是去相關(guān)路徑下找?guī)欤l(fā)現(xiàn)regex,thread庫(kù)后面都是沒有-mt后綴的
CentOS6.5下如何編譯Ceph源碼

上網(wǎng)查資料發(fā)現(xiàn),帶mt和不帶mt,分別意味這對(duì)多線程的支持。不禁讓我想到在WINDOWS 平臺(tái)下開發(fā)時(shí),在VS2010下進(jìn)行項(xiàng)目配置時(shí),同樣會(huì)涉及到對(duì)運(yùn)行時(shí)庫(kù)配置時(shí),也有mutlithread版本的。應(yīng)是類似道理。于是我對(duì)boost進(jìn)行了重新編譯。

./bjam --TOOLS=gcc  --build-type=complete  --layout=tagged  install

用complete的模式進(jìn)行編譯,在相關(guān)路徑下可以發(fā)現(xiàn)對(duì)應(yīng)的二進(jìn)制文件:可以發(fā)現(xiàn)采用新模式編譯后,很多庫(kù)的release版本,debug版本,多線程支持版本都編譯出來(lái)了,想用哪個(gè)用那個(gè)。

CentOS6.5下如何編譯Ceph源碼


 

最后,重復(fù)步驟5,編譯ceph.

------------------------------------------------------------------------------------------------------------

在后來(lái)的編譯中,mon,osd,mds等等都編譯成功,卻發(fā)現(xiàn)rgw沒有編譯出來(lái)。通過顯示的增加
./configure --with-radosgw,得知了錯(cuò)誤,是缺少fcgi的相關(guān)依賴。但是系統(tǒng)中已經(jīng)安裝fcgi于是清理重裝。

[root@gnop029-ct-zhejiang_wenzhou-16-12 yum.repos.d]# sudo yum install fcgi-devel

58 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package fcgi-devel.x86_64 0:2.4.0-12.el6 will be installed
--> Processing Dependency: fcgi = 2.4.0-12.el6 for package: fcgi-devel-2.4.0-12.el6.x86_64
--> Processing Dependency: libfcgi.so.0()(64bit) for package: fcgi-devel-2.4.0-12.el6.x86_64
--> Processing Dependency: libfcgi++.so.0()(64bit) for package: fcgi-devel-2.4.0-12.el6.x86_64
--> Running transaction check
---> Package fcgi.x86_64 0:2.4.0-10.el6 will be installed
---> Package fcgi-devel.x86_64 0:2.4.0-12.el6 will be installed
--> Processing Dependency: fcgi = 2.4.0-12.el6 for package: fcgi-devel-2.4.0-12.el6.x86_64
--> Finished Dependency Resolution
Error: Package: fcgi-devel-2.4.0-12.el6.x86_64 (epel)
           Requires: fcgi = 2.4.0-12.el6
           Available: fcgi-2.4.0-10.el6.x86_64 (Ceph)
               fcgi = 2.4.0-10.el6
Error: Package: fcgi-devel-2.4.0-12.el6.x86_64 (epel)
           Requires: fcgi = 2.4.0-12.el6
           Installing: fcgi-2.4.0-10.el6.x86_64 (Ceph)
               fcgi = 2.4.0-10.el6
 You could try using --skip-broken to work around the problem

將yum.repo.d文件夾下所有的repo文件刪除,只保留163的源,重新更新fcgi。后來(lái)編譯的過程中又提示

rgw/rgw_fcgi.cc:10:22: fatal error: fcgiapp.h: No such file or directory
 # include "fcgiapp.h"
                      ^
compilation terminated.

于是又安裝fcgi-devel,后成功找到頭文件,并進(jìn)行編譯。

關(guān)于“CentOS6.5下如何編譯Ceph源碼”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。

本文題目:CentOS6.5下如何編譯Ceph源碼
轉(zhuǎn)載注明:http://vcdvsql.cn/article0/pdcpoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)域名注冊(cè)網(wǎng)站導(dǎo)航建站公司關(guān)鍵詞優(yōu)化小程序開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司