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

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

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

本文簡述了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.

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

在RHEL5.7下安裝的Gearman::XS,中間會出現(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強制安裝肯定是不行的,所以就找原因。查看 /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.

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

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

然后執(zhí)行make命令,就可以看到上面報的編譯錯誤了。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”這個選項,然后保存退出,再次執(zhí)行make。
 
會發(fā)現(xiàn)報出如下錯誤:

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包就可以解決這個問題,但是,我的rhel是手動安裝的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)文章

最新評論

永春县| 琼海市| 天镇县| 新安县| 锡林浩特市| 呼图壁县| 连南| 宁波市| 庆安县| 安宁市| 昆山市| 满洲里市| 远安县| 岳阳县| 屯门区| 玛纳斯县| 西乌| 大城县| 若羌县| 麻栗坡县| 梓潼县| 桐城市| 京山县| 关岭| 兰西县| 兰州市| 玛多县| 邯郸市| 工布江达县| 绿春县| 报价| 格尔木市| 阳春市| 丹巴县| 朝阳区| 沙田区| 集贤县| 如东县| 长顺县| 石渠县| 聂荣县|