aquaplanet has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

Thanks for all greate help before. Even though I already knew that I found the problem, people here has a tendency to bring more than I already knew. I hope you once again can help me here.

Skill level: Complete beginner

Summary (and question): I tried to install Crypt::Random, but faced some problems. Those were hunt down and solved by installing Math::Peri (dependency) separately. It made me wonder: How would you, the skilled Perl hackers, troubleshoot installation of Perl modules in CPAN (like the scenario below)? I found one solution, but is there a better one?

Longer: Today I was about to install Crypt::Random though CPAN and I got an error:

... Warning: prerequisite Math::Pari 2.001804 not found. Writing Makefile for Crypt::Random Could not read '/root/.cpan/build/Crypt-Random-1.25-BiQeM3/META.yml'. +Falling back to other methods to determine prerequisites ---- Unsatisfied dependencies detected during ---- ---- VIPUL/Crypt-Random-1.25.tar.gz ---- Math::Pari [requires] Running make test Delayed until after prerequisites Running make install Delayed until after prerequisites Running install for module 'Math::Pari' Running make for I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz Has already been unwrapped into directory /root/.cpan/build/Math-Par +i-2.01080604-eLAuGp Could not make: Unknown error Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Running make for V/VI/VIPUL/Crypt-Random-1.25.tar.gz Has already been unwrapped into directory /root/.cpan/build/Crypt-Ra +ndom-1.25-BiQeM3 CPAN.pm: Going to build V/VI/VIPUL/Crypt-Random-1.25.tar.gz Warning: Prerequisite 'Math::Pari => 2.001804' for 'VIPUL/Crypt-Random +-1.25.tar.gz' failed when processing 'ILYAZ/modules/Math-Pari-2.01080 +604.tar.gz' with 'make => NO'. Continuing, but cha nces to succeed are limited. cp lib/Crypt/Random/Provider/File.pm blib/lib/Crypt/Random/Provider/Fi +le.pm cp lib/Crypt/Random.pm blib/lib/Crypt/Random.pm cp lib/Crypt/Random/Provider/devrandom.pm blib/lib/Crypt/Random/Provid +er/devrandom.pm cp lib/Crypt/Random/Provider/rand.pm blib/lib/Crypt/Random/Provider/ra +nd.pm cp lib/Crypt/Random/Generator.pm blib/lib/Crypt/Random/Generator.pm cp lib/Crypt/Random/Provider/devurandom.pm blib/lib/Crypt/Random/Provi +der/devurandom.pm cp lib/Crypt/Random/Provider/egd.pm blib/lib/Crypt/Random/Provider/egd +.pm cp bin/makerandom blib/script/makerandom /usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/make +random Manifying blib/man3/Crypt::Random.3pm VIPUL/Crypt-Random-1.25.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/generator.t ........ Can't locate Math/Pari.pm in @INC (@INC contain +s: /root/.cpan/build/Crypt-Random-1.25-BiQeM3/blib/lib /root/.cpan/bu +ild/Crypt-Random-1.25-BiQeM3/blib/arch /usr/local/ lib/perl5 /usr/local/share/perl5 /usr/lib/perl5 /usr/share/perl5 /usr/ +lib/perl5 /usr/share/perl5 /usr/local/lib/perl5/site_perl/5.10.0/i386 +-linux-thread-multi /usr/local/lib/perl5/site_perl /5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr +/lib/perl5/vendor_perl /usr/lib/perl5/site_perl .) at /root/.cpan/bui +ld/Crypt-Random-1.25-BiQeM3/blib/lib/Crypt/Random. pm line 20. BEGIN failed--compilation aborted at /root/.cpan/build/Crypt-Random-1. +25-BiQeM3/blib/lib/Crypt/Random.pm line 20. Compilation failed in require at /root/.cpan/build/Crypt-Random-1.25-B +iQeM3/blib/lib/Crypt/Random/Generator.pm line 12. BEGIN failed--compilation aborted at /root/.cpan/build/Crypt-Random-1. +25-BiQeM3/blib/lib/Crypt/Random/Generator.pm line 12. Compilation failed in require at t/generator.t line 12. BEGIN failed--compilation aborted at t/generator.t line 12. t/generator.t ........ Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/makerandom_itv.t ... Can't locate Math/Pari.pm in @INC (@INC contain +s: ../lib /root/.cpan/build/Crypt-Random-1.25-BiQeM3/blib/lib /root/. +cpan/build/Crypt-Random-1.25-BiQeM3/blib/arch /usr/local/lib/perl5 /u +sr/local/share/perl5 /usr/lib/perl5 /usr/share/perl5 /usr/local/lib/p +erl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/si +te_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-mu +lti /usr/lib/perl5/vendor_perl /usr/lib/perl5/site_perl .) at /root/. +cpan/build/Crypt-Random-1.25-BiQeM3/blib/lib/Crypt/Random.pm line 20. BEGIN failed--compilation aborted at /root/.cpan/build/Crypt-Random-1. +25-BiQeM3/blib/lib/Crypt/Random.pm line 20. Compilation failed in require at t/makerandom_itv.t line 10. BEGIN failed--compilation aborted at t/makerandom_itv.t line 10. t/makerandom_itv.t ... Dubious, test returned 2 (wstat 512, 0x200) ...

It didn't help much except that it can't find Math/Pari. So I did what I thought was a good idea (still thinks), to install Math::Pari separetly but got an error:

cpan[5]> install Math::Pari Running install for module 'Math::Pari' Running make for I/IL/ILYAZ/modules/Math-Pari-2.01080604.tar.gz Has already been unwrapped into directory /root/.cpan/build/Math-Par +i-2.01080604-6jeupl Could not make: Unknown error Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible

Unkown error doesn't help much. Ofcourse I have been google-ing but didn't find anything (on the first 10+ seconds). I did another attempt, this time I had closed and restarted CPAN. This time I got a better error:

...Generating libPARI/paricfg.h ... Scanning header files... Error Filen eller katalogen finns inte from: gcc -E -D_REENTRANT -D_GN +U_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/in +clude utils/inc.h 2>&1 Creating libPARI/paricfg.h... sh: gp: command not found ...Processor of family `ix86' detected Checking if your kit is complete... Looks good ...Processor of family `ix86' detected ...I will use assembler build of type 'ix86'. ...Assembler is GNU assembler Writing Makefile for Math::PARI::libPARI Writing Makefile for Math::Pari Could not read '/root/.cpan/build/Math-Pari-2.01080604-eLAuGp/META.yml +'. Falling back to other methods to determine prerequisites cp libPARI.dumb.pod blib/lib/Math/libPARI.dumb.pod cp PariInit.pm blib/lib/Math/PariInit.pm cp Pari.pm blib/lib/Math/Pari.pm cp libPARI.pod blib/lib/Math/libPARI.pod cd libPARI && make LIBPERL_A="libperl.a" LINKTYPE="dynamic" OPTIMIZE=" +-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-prote +ctor --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchr +onous-unwind-tables" PREFIX="/usr/local" PASTHRU_DEFINE="" PASTHRU_IN +C="" make[1]: Går till katalogen "/root/.cpan/build/Math-Pari-2.01080604-eL +AuGp/libPARI" /usr/bin/perl -wle0 > pariinl.h /usr/bin/perl -pe1 ../pari-2.1.7/src/kernel/ix86/level0.h ../pari-2.1. +7/src/kernel/none/level1.h >> pariinl.h gcc -c -I ../pari-2.1.7/src -I ../pari-2.1.7/src/headers -I ../pari-2 +.1.7/src/graph -I . -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing - +pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FI +LE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexcept +ions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mt +une=atom -fasynchronous-unwind-tables -DVERSION=\"\" -DXS_VERSION=\ +"\" -fPIC -Derr=pari_err -DASMINLINE -DGCC_INLINE -DDYNAMIC_PLOTTING +-o es.o ../pari-2.1.7/src/language/es.c make[1]: gcc: Kommandot hittades inte make[1]: *** [es.o] Fel 127 make[1]: Lämnar katalogen "/root/.cpan/build/Math-Pari-2.01080604-eLAu +Gp/libPARI" make: *** [libPARI/libPARI.a] Fel 2 ILYAZ/modules/Math-Pari-2.01080604.tar.gz /usr/bin/make -- NOT OK 'YAML' not installed, will not store persistent state Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: ILYAZ/modules/Math-Pari-2.01080604.tar.gz : make NO

I saw gcc-not found. Installing it, still gave the same output when installing Crypt::Random, but installing Math::Pari caused some compiling which is good! After that installing Crypt::Random went perfect.

cpan[1]> install Math::Pari Going to read '/root/.cpan/Metadata' Database was generated on Mon, 28 Feb 2011 10:27:43 GMT Running install for module 'Math::Pari' ... Installing /usr/local/share/man/man3/Math::libPARI.dumb.3pm Installing /usr/local/share/man/man3/Math::Pari.3pm Installing /usr/local/share/man/man3/Math::libPARI.3pm Appending installation info to /usr/lib/perl5/perllocal.pod ILYAZ/modules/Math-Pari-2.01080604.tar.gz /usr/bin/make install -- OK cpan[2]> install Crypt::Random Running install for module 'Crypt::Random' ... /usr/bin/make test -- OK Running make install Installing /usr/local/share/perl5/Crypt/Random.pm Installing /usr/local/share/perl5/Crypt/Random/Generator.pm Installing /usr/local/share/perl5/Crypt/Random/Provider/rand.pm Installing /usr/local/share/perl5/Crypt/Random/Provider/devrandom.pm Installing /usr/local/share/perl5/Crypt/Random/Provider/egd.pm Installing /usr/local/share/perl5/Crypt/Random/Provider/devurandom.pm Installing /usr/local/share/perl5/Crypt/Random/Provider/File.pm Installing /usr/local/share/man/man3/Crypt::Random.3pm Installing /usr/local/bin/makerandom Appending installation info to /usr/lib/perl5/perllocal.pod VIPUL/Crypt-Random-1.25.tar.gz /usr/bin/make install -- OK

It all made me wonder though: how would the "correct way" to troubleshoot this problem? How would the skilled Perl hacker do in this case?

Replies are listed 'Best First'.
Re: General tips for CPAN troubleshooting
by Anonymous Monk on Mar 01, 2011 at 23:13 UTC