0

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.

Community
  • 1
  • 1
Dušan Rychnovský
  • 11,699
  • 8
  • 41
  • 65
  • `Data::Calc` depends on `Bit::Vector` . the command you have run should have installed `Bit::Vector` automatically with no issues. But in your case it is failing. Try installing `Bit::Vector` and later install `Data::Calc` – slayedbylucifer May 20 '13 at 15:45
  • check: http://www.linuxquestions.org/questions/linux-software-2/bin-sh-cc-command-not-found-641293/ – slayedbylucifer May 20 '13 at 16:00

2 Answers2

2

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.

friedo
  • 65,762
  • 16
  • 114
  • 184
  • 1
    it used to need a workaround (Solaris::PerlGcc) to compile modules with a free compiler when the system perl wasn't, but that's in the fairly distant past; I suspect the issue here is just not having a compiler at all, a problem that isn't unique to Solaris – ysth May 20 '13 at 16:20
0

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.

Dušan Rychnovský
  • 11,699
  • 8
  • 41
  • 65