11 Replies Latest reply: May 27, 2013 4:34 AM by alan.pae RSS

    Cannot install Date::Calc perl module

    931834
      I'm running Solaris 11 on my machine and I 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

      ---

      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

      ---

      So it looks like the C compiler is missing. So I installed gcc via the following commands:

      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.

      ---

      What should I do to fix this?

      Thanks for your advice,
      Dusan
        • 1. Re: Cannot install Date::Calc perl module
          Pascal Kreyer -Oracle
          Can you try to set CC variable ?
          • 2. Re: Cannot install Date::Calc perl module
            931834
            Can you try to set CC variable ?
            How do I do that?
            • 3. Re: Cannot install Date::Calc perl module
              Pascal Kreyer -Oracle
              export CC=/usr/gcc/4.5/bin/gcc
              • 4. Re: Cannot install Date::Calc perl module
                931834
                I tried to run the following two commands:

                export CC=/usr/gcc/4.5/bin/gcc
                sudo perl -MCPAN -e 'install Bit::Vector'

                but this yields the exact same output as before. The location of the gcc file is correct.
                • 5. Re: Cannot install Date::Calc perl module
                  1009622
                  Try editing:

                  /usr/perl5/5.12/lib/i86pc-solaris-64int/Config.pm

                  and adjusting the CC related variables there.
                  • 6. Re: Cannot install Date::Calc perl module
                    Pascal Kreyer -Oracle
                    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.
                    • 7. Re: Cannot install Date::Calc perl module
                      alan.pae
                      pkg install runtime/perl-584/extra

                      as root or equiv and then run:

                      perlgcc

                      which should modify whatever needs to be modified so Solaris perl can use gcc instead of Solaris Studio which was used to compile it originally.

                      alan
                      • 8. Re: Cannot install Date::Calc perl module
                        931834
                        I have successfully run the following command:

                        pkg install runtime/perl-584/extra

                        but when I tried to run

                        perlgcc

                        I got the "command not found" error.

                        So I looked up perlgcc via find and found the following two locations:

                        /usr/perl5/5.8.4/bin/perlgcc
                        /usr/perl5/5.12/bin/perlgcc

                        So I run the first one, but it seemed to just wait for text input and do nothing. I closed it after a while and tried to install the perl module, but nothing changed.
                        • 9. Re: Cannot install Date::Calc perl module
                          alan.pae
                          /usr/perl5/5.8.4/bin/perlgcc
                          /usr/perl5/5.12/bin/perlgcc

                          So I run the first one, but it seemed to just wait for text input and do nothing. I closed it after a while and tried to install the perl module, but nothing changed.
                          Right. So instead of running perl Makefile.pl you use perlgcc Makefil.pl.

                          http://search.cpan.org/~aburlison/Solaris-PerlGcc-1.3/pod/perlgcc.pod

                          For a complete explanation.

                          alan
                          • 10. Re: Cannot install Date::Calc perl module
                            931834
                            So I ran the following command:

                            +/usr/perl5/5.8.4/bin/perlgcc -MCPAN -e 'install Bit::Vector'+

                            but it did not work either. I got the following error output.

                            CPAN.pm: Going to build S/ST/STBEY/Bit-Vector-7.2.tar.gz

                            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/String.pod blib/lib/Bit/Vector/String.pod
                            cp lib/Bit/Vector/Overload.pod blib/lib/Bit/Vector/Overload.pod
                            cp lib/Bit/Vector/String.pm blib/lib/Bit/Vector/String.pm
                            gcc -c    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"7.2\"  -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE"   BitVector.c
                            gcc: unrecognized option '-KPIC'
                            gcc: language ildoff not recognized
                            gcc: language ildoff not recognized
                            gcc: BitVector.c: linker input file unused because linking not done
                            +/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap -typemap typemap Vector.xs > Vector.xsc && mv Vector.xsc Vector.c+
                            gcc -c    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"7.2\"  -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE"   Vector.c
                            gcc: unrecognized option '-KPIC'
                            gcc: language ildoff not recognized
                            gcc: language ildoff not recognized
                            gcc: Vector.c: linker input file unused because linking not done
                            Running Mkbootstrap for Bit::Vector ()
                            chmod 644 Vector.bs
                            rm -f blib/arch/auto/Bit/Vector/Vector.so
                            LD_RUN_PATH="" gcc  -G BitVector.o  Vector.o  -o blib/arch/auto/Bit/Vector/Vector.so
                            gcc: BitVector.o: No such file or directory
                            gcc: Vector.o: No such file or directory
                            gcc: no input files
                            *** Error code 1
                            make: Fatal error: Command failed for target `blib/arch/auto/Bit/Vector/Vector.so'
                            +/usr/bin/make -- NOT OK+
                            Running make test
                            Can't test without successful make
                            Running make install
                            make had returned bad status, install seems impossible
                            • 11. Re: Cannot install Date::Calc perl module
                              alan.pae
                              gcc -c    -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"7.2\"  -DXS_VERSION=\"7.2\" -KPIC "-I/usr/perl5/5.8.4/lib/i86pc-solaris-64int/CORE"   BitVector.c
                              So somewhere else it's calling perl and not perlgcc. -KPIC is used by Solaris Studio. If it was gcc it would be -fpic instead.

                              A couple of solutions would be to rename perl and link perlgcc to perl and then after the compile undo the changes or install Solaris Studio since it was used to compile perl in the first place and use it instead of gcc.

                              The overall issue is you can't mix Solaris Studio and gcc. And the perl on Solaris is built using Solaris Studio.

                              alan