Solved

How to handle perl package installation error

Posted on 2012-04-08
4
515 Views
Last Modified: 2013-11-13
I already have perl 5.8.4 installed. Now I'm trying to install pear package Compress-Raw-Zlib-2.049 on this unix host (SunOS). After download the paclage from cpan perl website, I following the step  to build:
     perl Makefile.PL
     make
then I got a lot of compile errors starting with following:
cc -c  -I./zlib-src  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO -xO3 -xspace -xildoff    -DVERSION=\"2.049\"  -DXS_V
ERSION=\"2.049\" -KPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"  -DNO_VIZ -DZ_SOLO   -DGZIP_OS_CODE=3 -DUSE_PPPORT_H Zlib.c
cc: unrecognized option `-KPIC'
cc: language ildoff not recognized

How can I fix above compile error?
0
Comment
Question by:dominoPgr
  • 2
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 500 total points
Comment Utility
Solaris build fails with "gcc: unrecognized option `-KPIC'"
-----------------------------------------------------------

You are running Solaris and you get an error like this when you try to
build this Perl module

    gcc: unrecognized option `-KPIC'

This symptom usually means that you are using a Perl binary that has been
built with the Sun C compiler, but you are using gcc to build this module.

When Perl builds modules that need a C compiler, it will attempt to use
the same C compiler and command line options that was used to build perl
itself. In this case "-KPIC" is a valid option for the Sun C compiler,
but not for gcc. The equivalent option for gcc is "-fPIC".

The solution is either:

    1. Build both Perl and this module with the same C compiler, either
       by using the Sun C compiler for both or gcc for both.

    2. Try generating the Makefile for this module like this perl

           perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" " LD=gcc
           make test

       This second option seems to work when mixing a Perl binary built
       with the Sun C compiler and this module built with gcc. Your
       mileage may vary.


http://www.cpan.org/modules/by-module/Compress/Compress-Raw-Zlib-2.049.readme
0
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
Solaris build fails with "language optional software package not installed"
---------------------------------------------------------------------------

If you are trying to build this module under Solaris and you get an
error message like this

    /usr/ucb/cc: language optional software package not installed

it means that Perl cannot find the C compiler on your system. The cryptic
message is just Sun's way of telling you that you haven't bought their
C compiler.

When you build a Perl module that needs a C compiler, the Perl build
system tries to use the same C compiler that was used to build perl
itself. In this case your Perl binary was built with a C compiler that
lived in /usr/ucb.

To continue with building this module, you need to get a C compiler,
or tell Perl where your C compiler is, if you already have one.

Assuming you have now got a C compiler, what you do next will be dependent
on what C compiler you have installed. If you have just installed Sun's
C compiler, you shouldn't have to do anything. Just try rebuilding
this module.

If you have installed another C compiler, say gcc, you have to tell perl
how to use it instead of /usr/ucb/cc.

This set of options seems to work if you want to use gcc. Your mileage
may vary.

    perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" "
    make test


http://www.cpan.org/modules/by-module/Compress/Compress-Raw-Zlib-2.049.readme
0
 

Author Comment

by:dominoPgr
Comment Utility
Thanks for all your responses.

I tried the step:
perl Makefile.PL CC=gcc CCCDLFLAGS=-fPIC OPTIMIZE=" "
make test

Now I got following error:
>make test
gcc -c  -I./zlib-src  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO     -DVERSION=\"2.049\"  -DXS_VERSION=\"2.049\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"  -DNO_VIZ -DZ_SOLO   -DGZIP_OS_CODE=3 -DUSE_PPPORT_H Zlib.c
gcc: language arch=v8 not recognized

I can see CCFLAGS -xarch=v8 in the Makefile. Is there a equivalent compiler switch for arch=v8 in gcc?
0
 

Author Comment

by:dominoPgr
Comment Utility
i'm going to take another approach: install perl from scratch. Thanks for the help.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A short article about a problem I had getting the GPS LocationListener working.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now