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

Oh great and Holy Holders of the devine and sacred knowedge,

I am currently attempting to install a series of Perl modules which are nessecary for running the mon Services Monitoring Deamon onto a Sparc Ultra 5 running Solaris 8. During compilation (running make) I am getting the following error:

cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: HiRes.c: linker imput file unused since linking not done
Running Mkbootstrap for Time::HiRes ()
chmod 644 HiRes.bs
LD_RUN_PATH="" cc -o blib/arch/auto/Time/HiRes/HiRes.so -G HiRes.o
cc: HiRes.o: No Such File or directory
cc: No input files
*** Error code 1
make: Fatal Error: Command failed for target `blib/arch/auto/Time/HiRes/HiRes.so

everything appears normal until that point. I am using gcc version 2.95.2 (cc is a link pointing to gcc).
I'm running Perl verion 5.005_03

This happens when i run make on the Time:HiRes module and a similar error occurs while I run make for the Authen::PAM module (however the later is not nessecary for my purposes).

Replies are listed 'Best First'.
Re: Problems Compiling Modules.
by chipmunk (Parson) on Dec 13, 2000 at 03:14 UTC
    Is gcc version 2.95.2 the same compiler you used to compile perl? The compiler configuration used to build perl is also used to build binary modules, so compiling modules with a different compiler can cause problems.
      No, the installation of perl on the box is the default perl installation that comes with Solaris 8, however the default cc compiler also failed to compile the perl modules (however I switched to gcc because I had needed it to install another program) and it seemed to get furthur into the Module compile than the default cc compiler. I will post the errors from that cc compiler tommorow as I am leaving work now.However I do remember it saying something like the:

      cc: language depend not recognized

      Line in the gcc error message.

      LordOmar

        The default Sun compiler really isn't up to much. As you know, gcc is far better.

        Your problem is that you have some pre-built Sun version of Perl which was built using Sun's compiler. This therefore expects all new modules to be compiled with the same compiler (or, more accurately, the same compiler options). As the Sun compiler and gcc have different command-line options, you see the problems that you are getting.

        I've never yet seen a pre-built Perl that I really have confidence in, so my solution would be to rebuilt Perl from the sources using gcc.

        --
        <http://www.dave.org.uk>

        "Perl makes the fun jobs fun
        and the boring jobs bearable" - me

        I've seen the -KPIC trouble; Sol's cc using one form and gcc uses another (lower case maybe?). The Config.pm has the options used on the perl compile and they get put in when installing modules, so you've got that conflict. Same w/ the "language" depend, you're getting the command line for one compiler (gcc, I guess) w/ the other (cc). I've modified Config.pm (probably a really bad idea), you're probably looking at other troubles and 'changing' compilers isn't going to help. Lord, er, goodness, er, Larry knows I tried it enough.

        a