This article describes the Gearman::xs in CentOS under the compiler installation method, for everyone to learn about!
At present Gearman can support a variety of languages, its official website description is as follows:
Language bindings/drivers/frameworks
Select your language–cross links to download section which details all your opt ions.
C, C#/.net, go, Java, Lisp, Nodejs, PHP, Perl, Python, Ruby, Database UDFs.
The individual tried the API in C, Python, and Perl three languages, and felt Perl's API functionality was relatively complete. GEARMAN::XS is open source support for Perl. Its links are as follows: http://search.cpan.org/~krow/Gearman-XS/
RHEL5.7 under the installation of the GEARMAN::XS, the middle will appear a variety of problems, here are the solutions to these problems for your reference.
First, I used the CPANM to install the GEARMAN::XS, and the results are as follows:
[@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.
Obviously force forced installation is definitely not good, so find the reason. Look at the/root/.cpanm/work/1392343258.18128/build.log file and find the following hints:
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.
See that there is a problem at compile time, so let's switch to its compiled directory (that is, the/root/.cpanm/work/1392343258.18128/directory)
cd/root/.cpanm/work/1392343258.18128/gearman-xs-0.15
Then execute the make command to see the reported compilation error. OK, let's fix it.
can find:
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
Delete the last "-wno-format-invalid-specifier" option, and then save the exit and execute make again.
You will find that the following error has been reported:
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 (the in the This function )
Xs.c:229:error: (each undeclared identifier are 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 (in the This function)
xs.xs:82:warning:assignment makes pointer from integer Without a cast make
: * * * [XS.O] Error 1
It is obvious that is unable to find Gearman.h, that is, need to gearman-devel, under normal circumstances through Yum directly installed Gearman-devel package can solve this problem, but, my Rhel is manually installed Gearman-1.1.11 version, and Yum installed version inconsistent, so, then Time to open and modify makefile.
Find Inc and Lddlflags and modify it to read as follows:
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/
Can see is to join the Gearman of Incule and Lib related things. Save Exit Makefile, execute make again, pass smoothly, then make install installed.