本文简述了Gearman::XS在Centos下编译安装方法,供大家参考学习一下!
目前Gearman能够支持各种语言,其官网的描述如下:
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,中间会出现各种问题,此处给出这些问题的解决方法供大家参考。
首先,我使用了cpanm来安装Gearman::XS,结果如下:
[@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文件,发现其中有如下的提示:
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
然后执行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”这个选项,然后保存退出,再次执行make。
会发现报出如下错误:
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,修改为如下内容:
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以及lib相关的东西。保存退出Makefile,再次执行make,顺利通过,然后make install就安装完毕了。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。
更新日志
- 《蛋仔派对》发条鹦鹉巴洛皮肤图鉴
- 沈文程1988-畅销曲精华[爱莉亚][WAV+CUE]
- Brahms-ViolinConcerto,C.Schumann-3Romances-Batiashvili(2013)[96-24]
- Tchaikovsky-SymphonyNo.6-Nezet-Seguin,LisaBatiashvili(2014)[96-24].
- 《鸦卫奇旅》自定义是不是解锁不了难度
- 《海贼王赏金猎人》配置要求一览
- 《狗钩宇宙狗狗》联机失败解决方法
- 两款《宝可梦》国行版发售!售价299元 还有新外设
- 《塞尔达》新作常规通关20小时 全收集需30小时
- 腾讯Switch开启假日折扣!多款国产游戏迎史低
- 群星.1998-在那一年2CD【宝丽金】【WAV+CUE】
- 黄征.2012-征爱·拾力【乐华娱乐】【FLAC分轨】
- 凤飞飞.1998-凤飞飞30周年飞精选CD书2CD【歌林】【WAV+CUE】
- 《发烧大牌榜 精雕细琢的珍品 10CD》[WAV/分轨][5.1GB]
- 《张学友 最经典发烧金典》[WAV/分轨][600MB]