How to install RRDTool::OO on Strawberry perl

2019-08-12 05:27发布

问题:

I'm actually trying to install RRDTool on windows, using strawberry perl and it's nice cpan command. The issue is that the tool will not install correctly the RRDTool package, on which the ::OO package depends.

I've tried to compile myself the module (downloading it from http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz). But when I try to open the .sln file with Visual studio (2008 or 2010), I encounter an error yelling that the .vcproj files are not taken in count by VS...

So my two main questions are:

  • How to compile RRDTool on windows with the official package? Am I missing something? note that I rather not find a precompiled version of this lib, like one can found at http://www.thebits.info/general/rrdtool-v-1-4-4-win32-binaries-226.htm , for security reasons

  • How to integrate the compiled module to Strawberry perl? By simply copying and pasting files from the module into the strawberry\perl directory?

edit: as said in the first comments, I'd like to add that I understand that the error trigered by Strawberry's CPAN means that some system command used for RRDTool installation must be linux command, so it fails to be executed on powershell.

回答1:

The Makefile.PL for RRDTool::OO makes use of the gzip tool and a whole bunch of other Unix tools and assumptions.

system("gzip -dc rrdtool.tar.gz | tar xfv -; cd `ls -t | grep rrdtool | grep -v gz | head -1`; ./configure $CONFIGURE_OPTS; make; cd bindings/perl-shared; perl Makefile.PL; make; make test; make install") and die "Install failed: $!";

That's a very Unix line of code and ain't gonna work on Windows, no matter how many programs you install. It's doing what is recommended in the INSTALLATION section of the docs to install rrdtool and configure the Perl bindings.

Fortunately, it appears this is only necessary to build and install rrdtool. Install rrdtool yourself, being sure to compile the Perl bindings, then retry installing RRDTool::OO. If it asks to install rrdtool for you then it was unable to load the RRDs module which comes with rrdtool.

To install RRDs, compile rrdtool then go into bindings/perl-shared and install it like any other module. It's also possible that ppm will be able to install a precompiled RRDs with ppm install RRDs.



标签: perl rrdtool