What does this CPAN error mean? - perl

I would like to install IO::Uncompress::Gunzip, so I do
perl -MCPAN -e shell
install CPAN
install IO::Uncompress::Gunzip
and I get
cpan[11]> install IO::Uncompress::Gunzip
Running install for module 'IO::Uncompress::Gunzip'
Running make for P/PM/PMQS/IO-Compress-2.046.tar.gz
Has already been unwrapped into directory /root/.cpan/build/IO-Compress-2.046-d_Y9xt
---- Unsatisfied dependencies detected during ----
---- PMQS/IO-Compress-2.046.tar.gz ----
Compress::Raw::Zlib [requires]
Compress::Raw::Bzip2 [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
...
Result: FAIL
Failed 78/86 test programs. 35/328 subtests failed.
make: *** [test_dynamic] Error 255
PMQS/IO-Compress-2.046.tar.gz
2 dependencies missing (Compress::Raw::Bzip2,Compress::Raw::Zlib); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports PMQS/IO-Compress-2.046.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
PMQS/IO-Compress-2.046.tar.gz : make_test NO 2 dependencies missing (Compress::Raw::Bzip2,Compress::Raw::Zlib); additionally test harness failed
See full error output at http://pastebin.com/nGc80C8Z
If I try to install Compress::Raw::Bzip2 and Compress::Raw::Zlib I get
cpan[12]> install Compress::Raw::Zlib
Running install for module 'Compress::Raw::Zlib'
Running make for P/PM/PMQS/Compress-Raw-Zlib-2.045.tar.gz
Has already been unwrapped into directory /root/.cpan/build/Compress-Raw-Zlib-2.045-kBMzIh
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
cpan[13]>
Question
Does anyone what these errors mean, and perhaps how I can install these modules?

First error I can spot is /bin/sh: gcc: command not found. It is trying to compile binary parts of the libraries and can't find your compiler. You probably need to install GCC.
A lot (if not all) of the subsequent errors are likely side effects of this.

This was helpful to me, but one additional step that wasn't mentioned here that I needed to perform to be able to install a module was to do a clean [MODULE] before retrying the install [MODULE].
Probably not needed to be mentioned for non-noobs to this environment, but I needed it.

Related

What does the command "cpan reports" do exactly?

I tried to install Moose in perl 5.32.0 with the command cpan install Moose. The installation failed, with the following message:
Result: FAIL
Failed 448/478 test programs. 12/30 subtests failed.
Makefile:2047: recipe for target 'test_dynamic' failed
make: *** [test_dynamic] Error 255
ETHER/Moose-2.2013.tar.gz
13 dependencies missing (Class::Load,Class::Load::XS,Data::OptList,Devel::OverloadInfo,Dist::CheckConflicts,Module::Runtime::Conflicts,Package::DeprecationManager,Package::Stash,Package::Stash::XS,Params::Util,Sub::Exporter,Sub::Identify,Test::CleanNamespaces); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports ETHER/Moose-2.2013.tar.gz
I tried the command cpan reports ETHER/Moose-2.2013.tar.gz, and somehow this installed Moose correctly. What happened here? What does cpan reports do exactly? Is this the same as App::cpanreports?
The error message there refers to something you can do in the CPAN.pm shell, and the cpan command doesn't have anything to map to that. Even if it did, it wouldn't look the same.
cpan with no arguments puts you into the CPAN.pm shell, and it's there that you can issue commands (such as install and whatnot). For reports, you need to install LWP and CPAN::Reporter first:
% cpan LWP CPAN::Reporter
...
% cpan
cpan[1]> reports ETHER/Moose-2.2013.tar.gz
Distribution: E/ET/ETHER/Moose-2.2013.tar.gz
Fetching 'http://www.cpantesters.org/show/Moose.json'...DONE
2.2013:
+PASS 5.28.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)
+PASS 5.28.3 on GNU/Linux 5.4.34-0-lts (x86_64-linux-thread-multi)
+PASS 5.22.4 on GNU/Linux 5.4.0-26-generic (x86_64-linux)
+PASS 5.26.0 on FreeBSD 12.1-release (i386-freebsd-64int)
+PASS 5.26.0 on SunOS/Solaris 2.11 (i86pc-solaris-64)
However, it's probably easier to look on CPAN Testers to see the results for a particular module.
[You asked why using cpan reports ... instead of cpan install ... helped. This answers that. brian d foy's explains why cpan reports ... wasn't what you wanted to execute.]
It tries to install a module named reports.
The syntax for cpan is
cpan [options] <module_name> [<module_name> ...]
The operation is specified through options. The default operator is -i (install).
cpan install Moose
This command tries to install two distributions:
The newest one containing the module install.
A dummy module by this name was created, so this should not produce any errors.
Newer versions of cpan simply ignore this erroneous request.
The newest one containing the module Moose.
This is currently ETHER/Moose-2.2013.tar.gz.
cpan reports ETHER/Moose-2.2013.tar.gz
This command tries to install two distributions:
The newest one containing the module reports.
There's no module named reports, so that part fails.
>(error): Could not expand [reports]. Check the module name.
>(info): I can suggest names if you install one of Text::Levenshtein::XS, Text::Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Levenshtein::Damerau::PP
>(info): and you provide the -x option on invocation.
>(error): Skipping reports because I couldn't find a matching namespace.
ETHER/Moose-2.2013.tar.gz
So,
cpan install Moose
is merely a bad way of writing
cpan Moose
Also,
cpan reports ETHER/Moose-2.2013.tar.gz
is merely a bad way of writing
cpan ETHER/Moose-2.2013.tar.gz
Currently, this should currently be equivalent to
cpan Moose
In other words, there's no difference between the command you claimed didn't work and the one you claimed worked.

cpan "Set::IntervalTree " or "Algorithm::ExpectationMaximization" doesn't work - I explain below the complete error log

Here I explain more about troubles installing some Perl libraries:
trouble installing Set::IntervalTree
** I installed g++ - still the same issue
** I installed miniconda, and tried to conda the package - still having the same issue
here are the complete error logs:
** I copy part of it - as it is too long!
cpan Set::IntervalTree
Can't locate ExtUtils/CppGuess.pm in #INC (#INC contains: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at Makefile.PL line 11.
BEGIN failed--compilation aborted at Makefile.PL line 11.
Warning: No success on command[C:\Strawberry\perl\bin\perl.exe Makefile.PL]
SLOYD/Set-IntervalTree-0.12.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
I face similar problem trying to cpan Algorithm::ExpectationMaximization
one dependency not OK (Math::GSL); additionally test harness failed
C:\Strawberry\c\bin\dmake.EXE test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports AVIKAK/Algorithm-ExpectationMaximization-1.22.tar.gz
Running make install
make test had returned bad status, won't install without force
Suggestions:
Create a gist of the full log and post the link to it here. If you are philosophically opposed to GitHub, I believe there are other places you could post, but I don't know how permanent they are.
cpan and its related programs all (I believe) have options to automatically install dependencies which you do not already have installed. I wonder if deleting you cpan config file and reconfiguring to make sure that that option is set would help.
If the log of the run does not show it, make sure to add the output of perl -V to the gist. Perl version info helps in these situations.

How to install dmake with perl?

Can someone please tell me how to download dmake with Perl?
I have tried with CPAN, but this is what I get:
cpan> install dmake
Database was generated on Wed, 10 Jul 2019 10:13:05 GMT
Running install for module 'dmake'
'" "' is not recognized as an internal or external command,
operable program or batch file.
Checksum for C:\STRAWB~1\cpan\sources\authors\id\S\SH\SHAY\dmake-4.12.2.2.zip ok
Scanning cache C:\STRAWB~1\cpan\build for sizes
............................................................................DONE
Package contains both files[ChangeLog COPYING dmake.exe META.yml NEWS PATCH.TXT README.TXT] and directories[man readme startup]; not recognized as a perl package, giving up
Configuring S/SH/SHAY/dmake-4.12.2.2.zip with Makefile.PL
Running make for S/SH/SHAY/dmake-4.12.2.2.zip
gmake: *** No targets specified and no makefile found. Stop.
SHAY/dmake-4.12.2.2.zip
C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'dmake'.
Failed during this command:
SHAY/dmake-4.12.2.2.zip : writemakefile NO -- Package contains both files[ChangeLog COPYING dmake.exe META.yml NEWS PATCH.TXT README.TXT] and directories[man readme startup]; not recognized as a perl package, giving up
I have also tried with ppm install dmake, but I got this:
Installing package 'dmake'...
Error installing package 'dmake': Could not locate a PPD file for package dmake
Not answering the question because it's a XY problem, but giving you the info you need.
The most recent mod_perl2 compiled for Strawberry is against Perl 5.12, which is long out of support. Using any other version of Perl is not going to work. You should ask ApTest to update and recompile for a current Strawberry and release a new setup_spmp helper. They are relying on a dead piece of tech (mod_perl2), so they should either support the required dependency properly or move their application onto a modern stack.

Error installing perl module (cpan and manually)

I'm trying to install the SQL::Translator module. Everything runs fine until it gets to this test:
DBD::SQLite::db do failed: not an error at t/sqlite-rename-field.t line 62.
# Failed test '-- Convert schema '' to '':;'
# at t/sqlite-rename-field.t line 62.
# died: Died at t/sqlite-rename-field.t line 62.
# Looks like you failed 1 test of 16.
Failed 1/72 test programs. 1/1901 subtests failed.
make: *** [test_dynamic] Error 1
Any help is much appreciated, I was not able to find any similar questions. Thanks.
cpan link: http://search.cpan.org/~ilmari/SQL-Translator-0.11021/lib/SQL/Translator.pm
It could be because of missing dependencies and/or mismatch in version of other perl modules. Try using CPANM to install your desired package. It will take care of dependencies for you.
You can also try to install libsql-translator-perl library if you are on debian based systems. I am sure there will be a compatible library on red hat based systems too.
Also if you want to install from cpan then use CPANM to install the module.
Personally i prefer to use distro libraries in place of installing modules.
In case anyone stumbles across this question, my solution was:
install perlbrew
install latest version of perl via perlbrew
download required libraries
install module
It was much easier than dealing with the older system

Cannot install Date::Calc perl module

I'm running Solaris on my machine and I would need to install the Date::Calc perl module in order for one of my scripts to work.
When I run the following command:
sudo perl -MCPAN -e 'install Date::Calc'
I get the following error:
Tests succeeded but one dependency not OK (Bit::Vector)
STBEY/Date-Calc-6.3.tar.gz
[dependencies] -- NA
Running make install
make test had returned bad status, won't install without force
I have no prior experience in Perl development, so I have no clue about what the error might be or where to get more information.
What should I do to fix this?
When trying to install Bit::Vector first, i.e. when running the following command:
sudo perl -MCPAN -e 'install Bit::Vector'
i get the following error message:
Checking if your kit is complete...
Looks good
Writing Makefile for Bit::Vector
Writing patchlevel.h for /usr/bin/perl (5.012003)
cp lib/Bit/Vector/Overload.pm blib/lib/Bit/Vector/Overload.pm
cp Vector.pm blib/lib/Bit/Vector.pm
cp Vector.pod blib/lib/Bit/Vector.pod
cp lib/Bit/Vector/Overload.pod blib/lib/Bit/Vector/Overload.pod
cp lib/Bit/Vector/String.pod blib/lib/Bit/Vector/String.pod
cp lib/Bit/Vector/String.pm blib/lib/Bit/Vector/String.pm
cc -c -DPTR_IS_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4 -DVERSION=\"7.2\" -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.12/lib/i86pc-solaris-64int/CORE" BitVector.c
sh: line 1: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `BitVector.o'
STBEY/Bit-Vector-7.2.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
I installed gcc via the following commands (as adviced here):
pkg install gcc-45
pkg install system/header
but I still get the same error when trying to install Bit::Vector. Indeed, when I type cc on the command-line, I get the command not found error. When I type gcc, however, I get gcc: no input files.
The error means that Bit::Vector (a dependency of Date::Calc) failed to install for some reason. Bit::Vector requires compiling C code, which means your CPAN configuration will need access to the C compiler and libraries (and headers) that were used to build your perl.
From what I understand, that can sometimes be painful on Solaris.
If you have another C compiler available, you might consider building and installing a local Perl using perlbrew.
So it turns out that the only option is to install the Oracle Solaris Studio prior to installation of new perl modules which need to compile C code.
From a related discussion at Oracle Solaris forum:
CC modification in /usr/perl5/5.12/lib/i86pc-solaris-64int/Config.pm
will not resolve the compilation issue. New errors will be produced
and some part will not use this variable.
By default, this method to build modules will use perl compiled
options. And in this case, as we used Oracle Studio, this software
will be required because some options are not available with gcc.
I tried with Oracle Studio, and the compilation was done successfully.
If you want to use gcc, then this will be very tricky to modify
several perl config files. An another method is to compile manually
each necessary modules after you customize each Makefile.