最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Gearman::XS在Centos下的編譯安裝方法

 更新時(shí)間:2014年07月08日 16:23:37   投稿:shichen2014  
這篇文章主要介紹了Gearman::XS在Centos下的編譯安裝方法,需要的朋友可以參考下

本文簡(jiǎn)述了Gearman::XS在Centos下編譯安裝方法,供大家參考學(xué)習(xí)一下!

目前Gearman能夠支持各種語言,其官網(wǎng)的描述如下:
 

Language Bindings/Drivers/Frameworks
Select your language – cross links to download section which details all your options.
C, C#/.NET, Go, Java, Lisp, Nodejs, PHP, Perl, Python, Ruby, Database UDFs.

 
個(gè)人嘗試了C、python、perl三種語言的API,感覺perl的API功能相對(duì)來說齊全一點(diǎn)。Gearman::XS是perl的開源支持。其鏈接如下:http://search.cpan.org/~krow/Gearman-XS/

在RHEL5.7下安裝的Gearman::XS,中間會(huì)出現(xiàn)各種問題,此處給出這些問題的解決方法供大家參考。

首先,我使用了cpanm來安裝Gearman::XS,結(jié)果如下:

[@localhost yunfei]# cpanm Gearman::XS
--> Working on Gearman::XS
Fetching http://www.cpan.org/authors/id/K/KR/KROW/Gearman-XS-0.15.tar.gz ... OK
Configuring Gearman-XS-0.15 ... OK
Building and testing Gearman-XS-0.15 ... FAIL
! Installing Gearman::XS failed. See /root/.cpanm/work/1392343258.18128/build.log for details. Retry with --force to force install it.

顯然force強(qiáng)制安裝肯定是不行的,所以就找原因。查看 /root/.cpanm/work/1392343258.18128/build.log文件,發(fā)現(xiàn)其中有如下的提示:

gcc -c -Wall -Wundef -Wno-shadow -Wmissing-prototypes -fdiagnostics-show-option -Wformat=2 -Wstrict-aliasing -Wextra -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wno-undef -Wno-unused-value -Wno-unused-variable -Wno-unused-parameter -Wno-format-invalid-specifier -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"0.15\" -DXS_VERSION=\"0.15\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" XS.c
cc1: error: unrecognized command line option "-Wno-format-invalid-specifier"
make: *** [XS.o] Error 1
-> FAIL Installing Gearman::XS failed.

看到是在編譯的時(shí)候出了問題,所以,咱們切換到它的編譯目錄(即 /root/.cpanm/work/1392343258.18128/這個(gè)目錄)

cd /root/.cpanm/work/1392343258.18128/Gearman-XS-0.15

然后執(zhí)行make命令,就可以看到上面報(bào)的編譯錯(cuò)誤了。ok,下面就著手解決它。

vi Makefile

可以找到:

CCFLAGS = -Wall -Wundef -Wno-shadow -Wmissing-prototypes -fdiagnostics-show-option -Wformat=2 -Wstrict-aliasing -Wextra -Wmissing-declarations -Wcast-align -Wswitch-default -Wswitch-enum -Wno-undef -Wno-unused-value -Wno-unused-variable -Wno-unused-parameter -Wno-format-invalid-specifier

刪掉最后的“-Wno-format-invalid-specifier”這個(gè)選項(xiàng),然后保存退出,再次執(zhí)行make。
 
會(huì)發(fā)現(xiàn)報(bào)出如下錯(cuò)誤:

In file included from XS.xs:11:
gearman_xs.h:18:36: error: libgearman-1.0/gearman.h: No such file or directory
XS.c: In function 'XS_Gearman__XS_strerror':
XS.c:229: error: 'gearman_return_t' undeclared (first use in this function)
XS.c:229: error: (Each undeclared identifier is reported only once
XS.c:229: error: for each function it appears in.)
XS.c:229: error: expected ';' before 'rc'
XS.xs:82: warning: implicit declaration of function 'gearman_strerror'
XS.xs:82: error: 'rc' undeclared (first use in this function)
XS.xs:82: warning: assignment makes pointer from integer without a cast
make: *** [XS.o] Error 1

很明顯,是找不到gearman.h,也就是說需要gearman-devel,正常情況下通過yum直接安裝gearman-devel包就可以解決這個(gè)問題,但是,我的rhel是手動(dòng)安裝的Gearman-1.1.11版本,和yum安裝的版本不一致,所以,再次打開并修改Makefile。

找到INC以及LDDLFLAGS,修改為如下內(nèi)容:

LDDLFLAGS = -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -L/usr/local/gearman/lib/ -lgearman
 
INC = -I/usr/local/gearman/include/ -L/usr/local/gearman/lib/

可以看到就是加入了Gearman的incule以及l(fā)ib相關(guān)的東西。保存退出Makefile,再次執(zhí)行make,順利通過,然后make install就安裝完畢了。

相關(guān)文章

最新評(píng)論

乌拉特后旗| 沅陵县| 新丰县| 凯里市| 汝阳县| 买车| 五指山市| 苍山县| 平阳县| 房产| 东至县| 双城市| 乌什县| 区。| 蚌埠市| 盈江县| 丰县| 绵竹市| 高邑县| 灵璧县| 兴仁县| 达拉特旗| 沙雅县| 台南县| 特克斯县| 鞍山市| 天柱县| 东兴市| 淳化县| 西青区| 天峻县| 扎囊县| 万州区| 莒南县| 永年县| 太白县| 景洪市| 合阳县| 蓬莱市| 江山市| 嘉义县|