Friday 9 April 2010

installing GraphViz from perl CPAN problem

Just if someone else get caught by this problem:
I was trying to install GrapViz.pm.


First obviously it was failing because I didn't have GraphViz installed. Easy solved with:


sudo aptitude install graphviz graphviz-dev graphviz-doc libgraphviz-dev graphviz-cairo


But then when I tried again it was not working:


cpan> install GraphViz

GraphViz-2.04/MANIFEST
'/home/pablo/localperl/bin/perl Makefile.PL' returned status 512, won't make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install



So I went to the dir where GV was unpacked and tried to Make it by hand:


pablo@pmg-linux:~/.cpan/build/GraphViz-2.04-HQxvwp$ perl Makefile.PL
Scalar value @ENV{PATH} better written as $ENV{PATH} at Makefile.PL line 37.
Scalar value @ENV{PATH} better written as $ENV{PATH} at Makefile.PL line 40.
Looking for dot... found it at /usr/bin/dot
Checking if your kit is complete...
Looks good
Warning: prerequisite IPC::Run 0.6 not found.
Writing Makefile for GraphViz


OK, this explain it all: I need IPC::Run but it was not show in CPAN

After Intalling IPC::Run, deleting the GraphViz directory in the build dir (CPAN> clean GraphViz does not work) I tried to install again from CPAN but failed again with the same error that before.

I went to the extracted GraphViz dir and intalled manually and all was OK.


> perl Makefile.PL
> make
> make test
PERL_DL_NONLAZY=1 /home/pablo/localperl/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/dumper.t .. ok
t/foo.t ..... ok
t/pod.t ..... ok
t/simple.t .. ok
All tests successful.
Files=4, Tests=71, 1 wallclock secs ( 0.04 usr 0.06 sys + 0.42 cusr 0.58 csys = 1.10 CPU)
Result: PASS
> make install



So I don't know why the second time CPAN installation failed, but now it works after the manual install.

2 comments:

Anonymous said...

CPAN bailed out again because it remembers the failure from just before. The easiest work-around is the simply quit the shell, relaunch and run your install command again. No idea why the clean CPAN shell command did not work for you.

Pablo Marin-Garcia said...

The reason of the 'clean GraphViz' was not working is because there is not a clean directive in the makefile.

I thought that deleting the directory where the module was extracted was enough. CPAN looks first if the dir in build/ exist and if the make has failed before. But if no files there it must try the makefile and make again.But you are right sometimes the 'windows problem resolution approach' is better: quit and relaunch just in case.