Problems installing Perl modules on Solaris 9

Hi,

I'm trying to install the DBI and DBD-mysql modules for Perl on a Solaris 9 system. Perl version is 5.6.1. The Makefile.PL executes fine, but when I run make, the system gets cranky and spits out some nasty errors. If anyone has any insight into what my problem is, and how I may go about resolving it, I would appreciate very much. I've pasted some of the errors below.

Thanks,
Jeff

> make
/bin/sh -c true
cc -c  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend    -DVERSION=\"1.50\"  -DXS_VERSION=\"1.50\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DDBI_NO_THREADS Perl.c
/usr/ucb/cc:  language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `Perl.o'

So I changed cc to gcc in Makefile and tried again.

> make
/bin/sh -c true
gcc -c  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend    -DVERSION=\"1.50\"  -DXS_VERSION=\"1.50\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DDBI_NO_THREADS Perl.c
gcc: unrecognized option `-KPIC'
gcc: language depend not recognized
gcc: Perl.c: linker input file unused because linking not done
/usr/bin/perl -I/usr/perl5/5.6.1/lib/sun4-solaris-64int -I/usr/perl5/5.6.1/lib /usr/perl5/5.6.1/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap -typemap typemap DBI.xs > DBI.xsc && mv DBI.xsc DBI.c
gcc -c  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend    -DVERSION=\"1.50\"  -DXS_VERSION=\"1.50\" -KPIC -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DDBI_NO_THREADS DBI.c
gcc: unrecognized option `-KPIC'
gcc: language depend not recognized
gcc: DBI.c: linker input file unused because linking not done
Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/DBI.so
LD_RUN_PATH="" gcc  -G DBI.o  -o blib/arch/auto/DBI/DBI.so
gcc: DBI.o: No such file or directory
gcc: no input files
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBI/DBI.so'

Took out flags `-KPIC' and tried once more

> make
/bin/sh -c true
gcc -c  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend    -DVERSION=\"1.50\"  -DXS_VERSION=\"1.50\"  -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DDBI_NO_THREADS Perl.c
gcc: language depend not recognized
gcc: Perl.c: linker input file unused because linking not done
/usr/bin/perl -I/usr/perl5/5.6.1/lib/sun4-solaris-64int -I/usr/perl5/5.6.1/lib /usr/perl5/5.6.1/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap -typemap typemap DBI.xs > DBI.xsc && mv DBI.xsc DBI.c
gcc -c  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3 -xdepend    -DVERSION=\"1.50\"  -DXS_VERSION=\"1.50\"  -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE -DDBI_NO_THREADS DBI.c
gcc: language depend not recognized
gcc: DBI.c: linker input file unused because linking not done
Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/DBI.so
LD_RUN_PATH="" gcc  -G DBI.o  -o blib/arch/auto/DBI/DBI.so
gcc: DBI.o: No such file or directory
gcc: no input files
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/DBI/DBI.so'
jpetterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NukfrorCommented:
I'm pretty sure the problem you are hitting is you are trying to update the Sun provide Perl package.  Perl is VERY picky about how it was original compiled.  Any modules you add to Perl are compiled (the ones requiring compiling that is) using the same compiler setup as what Perl was compiled with.

In Solaris 9 for Perl 5.6.1, Sun used the SunPro C compiler to compile Perl.  You pretty much have to use the Sun compiler to add packages into the Sun provide Perl distro that comes with the box.  There is a Perl module that attempts to deal with this situation by faking out the Makefile.PL process into using GCC but I've had limited luck making it work.

So you have two choices:

- Get the SunPro C compiler for Solaris 9 and add your modules using it.

- Download a Perl distro from say www.sunfreeware.com, buid your own, whatever.  Basically get one that uses GCC was it compiler definition indicates and add your modules to that Perl distro.

This is from a Sun provided Perl 5.8.4 running on a Solaris 10.  See that compiler section - notice it says "cc" e.g. Sun compiler which isn't free under Solaris 9 - or it wasn't.  I think you may be in luck as I *think* you can get the compiler for free now - obvioulsy without support.  I would try to see if the Sun compiler is free for Solaris 9 first and if its not then go down the path of downloading another distro (say from www.sunfreeware.com), installing it, and adding your modules to it.

bash-3.00# perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.10, archname=sun4-solaris-64int
    uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO',
    optimize='-xO3 -xspace -xildoff',
<snip>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jpetterAuthor Commented:
Nukfror,

Thanks for the quick response. I'll give this a try and get back.

Jeff
0
bpeterseCommented:
>rm -f blib/arch/auto/DBI/DBI.so
>LD_RUN_PATH="" gcc  -G DBI.o  -o blib/arch/auto/DBI/DBI.so
>gcc: DBI.o: No such file or directory
>gcc: no input files

The above indicates that the script is removing the file that is needed in the subsequent step, right?  

Other than that, it appears you're missing a variable, i.e. LD_RUN_PATH.

Do a find on 'DBI.o' and DBI.so and put those paths in your LD_RUN_PATH and retry.

Another recommendation - instead of editing the makefile, mv /usr/ucb/cc -> oldcc and create a symlink named cc pointing to gcc.

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

NukfrorCommented:
bpeterse, just out of curiousity - have you personally hacked the Sun provided version of Perl to work with GCC rather then CC and had *all* your Perl module installations work out flawlessly ?
0
jpetterAuthor Commented:
Nukfror,

Thanks a bunch for the help. The SunPro compiler is not a free item yet, but the latter option worked like a charm.

Thanks,
Jeff
0
bpeterseCommented:
Nukfror, just for your edification, I'm trying to help others - just like you.  I don't however feel the need to challenge anyone who's got an idea different from mine.  Based on your points - you're obviously the expert.  

To answer your question though, no I have not hacked anything.  And I haven't worked with Perl as much as you.  I hope this satisfies your *curiosity* about my experience with Perl.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.