1

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.

Bacon
  • 1,814
  • 3
  • 21
  • 36
  • What ahve you tried? What error are you getting? Why are you using visual studio with Strawberry Perl (normally, you want to use the included GCC) – Robert P Jan 20 '12 at 16:58
  • @RobertP I tried to use the CPAN brought with Strawberry to install RRDTools::OO, but when cpan tries to install RRDTools itself, the error is the following: 'gzip' is not recognized as an internal or external command, operable program or batch file. Install failed: at ..\..\strawberry\cpan\build\RRDTool-OO-0.31\Makefile.PL line 77, line 1. – Bacon Jan 20 '12 at 17:06
  • @RobertP Visual Studio is the tool to use to open the .sln files given in the RRDTool distribution. Those sln file will produce a .exe file that (as I understand it) will install the module on the machine – Bacon Jan 20 '12 at 17:09
  • 1
    This doesn't seem to be a strawberry Perl issue; the 'solution' file you're talking about is part of the RRDTool module itself and not the strawberry perl library. I'd check out the rrdtool e-mail list for help building it on windows. – Robert P Jan 20 '12 at 17:52

1 Answers1

3

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.

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • 1
    Seconded for using the precompiled versions. If you're willing to trust source code from the internet, you should be equally trusting of binaries distributed by the same group. – Robert P Jan 21 '12 at 20:04
  • @Schwern you exactly described the point I reached: trying to install by myself RRDTool and during the ::OO installation, say "no" when it tries to install RRDTool. But as I say in the first comments, the issue is that I have troubles installing from the official sources. Visual studio does not want to open the .vcproj files required. I will look for a solution on the net and then keep this topic updated. After this I guess that the step will be to place the bin at the correct place for smooth Strawberry use (that should be the easy part). And then, yes, it _should_ work, hopefully! :-) – Bacon Jan 23 '12 at 09:58
  • OK. An incomplete version of visual studio was the issue (for the build error). After having put the .dll's, rrdupdate.exe and rrdtool.exe in the strawberry "perl/bin" directory, I tried to launch again the CPAN command. – Bacon Jan 23 '12 at 13:27
  • (new comment for more clarity): Do you want me to install it for you right now (y/n)? [n] n [...####...] No 'Makefile' created MSCHILLI/RRDTool-OO-0.31.tar.gz C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determine prerequisites – Bacon Jan 23 '12 at 13:27
  • 1
    @Bacon A) You have CPAN configured to hide errors from you. Do the install manually using `look RRDTool::OO` so you can see them. B) It doesn't see that you have the `RRDs` module installed which is why it keeps trying to install rrdtool for you and stopping when you say no. You have to install the perl bindings as described in the INSTALL section. http://search.cpan.org/~mschilli/RRDTool-OO-0.31/lib/RRDTool/OO.pm#INSTALLATION I have no idea what the Windows equivalent is, you may have to contact the author. – Schwern Jan 24 '12 at 03:01
  • @Schwern Checked. You are right about the perl-shared directory. Actually I think that this is the faulty part. But I also think that I need to find a way to compile the RRDs.xs file that comes along, because installing only the .pm file still makes yell the instruction "use RRDs" (_Can't locate loadable object for module RRDs in @INC_). For the ppm part, this is OK for ActiveState Perl, not for Strawberry – Bacon Jan 24 '12 at 09:58
  • I mark the question as resolved as I think this is the core of the problem, and will update an answer as soon as everything's clearly installed. – Bacon Jan 24 '12 at 10:04
  • @Bacon Strawberry Perl should be able to just compile the XS code normally. Go into `bindings/perl-shared` and do the normal `Makefile.PL` thing. Also, I thought Strawberry had PPM support? – Schwern Jan 25 '12 at 03:23
  • @Schwern actually when I launch "dmake" in the bindings/perl-shared directory, a bunch of compilation error is thrown. I'm working on it actually: the .XS module that should be compiled is the last requirement to a working installation. For the PPM part, it seems that RRD is not present in the PPM repository used by the tool provided by strawberry. A google search told me that anyway RRD was not packaged as a PPM... – Bacon Jan 27 '12 at 14:35