Errors installing XML::Parser from CPAN on Solaris 9

Errors installing XML::Parser from CPAN on Solaris 9

am 07.09.2005 19:29:48 von terrapin44

Hello all,

Has anyone that has succefully installed XML::Parser on Soalris 9 able
to help me out. I can't seem to get it to install. It seems to mostly
complain abour expat. I have expat installed on this machine (I used
the one from sunfreeware.com). Here is what happens:

# perl Makefile.PL cc=gcc
Note (probably harmless): No library found for -lexpat

Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. You can download expat from:

http://sourceforge.net/projects/expat/

If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:

EXPATLIBPATH=... To set the directory in which to find libexpat

EXPATINCPATH=... To set the directory in which to find expat.h

For example:

perl Makefile.PL EXPATLIBPATH=/home/me/lib
EXPATINCPATH=/home/me/include

Note that if you build against a shareable library in a non-standard
location
you may (on some platforms) also have to set your LD_LIBRARY_PATH
environment
variable at run time for perl to find the library.

# ls -al /usr/local/lib/libexpat*
-rw-r--r-- 1 bin bin 370868 Dec 17 2002
/usr/local/lib/libexpat.a
-rwxr-xr-x 1 bin bin 806 Dec 17 2002
/usr/local/lib/libexpat.la
lrwxrwxrwx 1 root other 17 Jun 8 09:29
/usr/local/lib/libexpat.so -> libexpat.so.0.4.0
lrwxrwxrwx 1 root other 17 Jun 8 09:29
/usr/local/lib/libexpat.so.0 -> libexpat.so.0.4.0
-rwxr-xr-x 1 bin bin 323716 Dec 17 2002
/usr/local/lib/libexpat.so.0.4.0

# ls -al /usr/local/include/expat.h
-rw-r--r-- 1 bin bin 35616 Dec 17 2002
/usr/local/include/expat.h

# perl Makefile.PL cc=gcc EXPATLIBPATH=/usr/local/lib
EXPATINCPATH=/usr/local/include
Checking if your kit is complete...
Looks good
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parser

(so far so good..... however...)


# make
cp Parser/Encodings/README blib/lib/XML/Parser/Encodings/README
cp Parser/Style/Debug.pm blib/lib/XML/Parser/Style/Debug.pm
cp Parser/Encodings/iso-8859-7.enc
blib/lib/XML/Parser/Encodings/iso-8859-7.enc
cp Parser/Encodings/x-sjis-cp932.enc
blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
cp Parser/Encodings/big5.enc blib/lib/XML/Parser/Encodings/big5.enc
cp Parser/Encodings/windows-1250.enc
blib/lib/XML/Parser/Encodings/windows-1250.enc
cp Parser/Encodings/iso-8859-8.enc
blib/lib/XML/Parser/Encodings/iso-8859-8.enc
cp Parser/Encodings/iso-8859-2.enc
blib/lib/XML/Parser/Encodings/iso-8859-2.enc
cp Parser/Style/Subs.pm blib/lib/XML/Parser/Style/Subs.pm
cp Parser/Style/Objects.pm blib/lib/XML/Parser/Style/Objects.pm
cp Parser/Encodings/x-euc-jp-jisx0221.enc
blib/lib/XML/Parser/Encodings/x-euc-jp-jisx0221.enc
cp Parser/Encodings/iso-8859-9.enc
blib/lib/XML/Parser/Encodings/iso-8859-9.enc
cp Parser/Encodings/x-sjis-unicode.enc
blib/lib/XML/Parser/Encodings/x-sjis-unicode.enc
cp Parser/Encodings/iso-8859-3.enc
blib/lib/XML/Parser/Encodings/iso-8859-3.enc
cp Parser/Style/Stream.pm blib/lib/XML/Parser/Style/Stream.pm
cp Parser/Encodings/windows-1252.enc
blib/lib/XML/Parser/Encodings/windows-1252.enc
cp Parser/Encodings/x-sjis-jdk117.enc
blib/lib/XML/Parser/Encodings/x-sjis-jdk117.enc
cp Parser/Encodings/euc-kr.enc blib/lib/XML/Parser/Encodings/euc-kr.enc
cp Parser/Encodings/iso-8859-4.enc
blib/lib/XML/Parser/Encodings/iso-8859-4.enc
cp Parser/Style/Tree.pm blib/lib/XML/Parser/Style/Tree.pm
cp Parser/Encodings/Japanese_Encodings.msg
blib/lib/XML/Parser/Encodings/Japanese_Encodings.msg
cp Parser/Encodings/x-sjis-jisx0221.enc
blib/lib/XML/Parser/Encodings/x-sjis-jisx0221.enc
cp Parser.pm blib/lib/XML/Parser.pm
cp Parser/Encodings/iso-8859-5.enc
blib/lib/XML/Parser/Encodings/iso-8859-5.enc
cp Parser/Encodings/x-euc-jp-unicode.enc
blib/lib/XML/Parser/Encodings/x-euc-jp-unicode.enc
cp Parser/LWPExternEnt.pl blib/lib/XML/Parser/LWPExternEnt.pl
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
/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
-noprototypes -typemap /usr/perl5/5.6.1/lib/ExtUtils/typemap -typemap
typemap Expat.xs > Expat.xsc && mv Expat.xsc Expat.c
cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-xO3 -xdepend -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -KPIC
-I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE Expat.c
cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: Expat.c: linker input file unused because linking not done
Running Mkbootstrap for XML::Parser::Expat ()
chmod 644 Expat.bs
rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.so
LD_RUN_PATH="/usr/local/lib" cc -G Expat.o -o
.../blib/arch/auto/XML/Parser/Expat/Expat.so -L/usr/local/lib -lexpat

cc: Expat.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target
`../blib/arch/auto/XML/Parser/Expat/Expat.so'
Current working directory
/local/home/corrado/perl/XML-Parser-2.34/Expat
*** Error code 1
make: Fatal error: Command failed for target `subdirs'
#


It seems to be dying asking for Expat.o. I don't seem to have this even
though I have expat. I decide to try linking Expat.o to the expat
library....

# ln -s libexpat.so Expat.o


I try again.....


# make
cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-xO3 -xdepend -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -KPIC
-I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE Expat.c
cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: Expat.c: linker input file unused because linking not done
rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.so
LD_RUN_PATH="/usr/local/lib" cc -G Expat.o -o
.../blib/arch/auto/XML/Parser/Expat/Expat.so -L/usr/local/lib -lexpat

cc: Expat.o: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target
`../blib/arch/auto/XML/Parser/Expat/Expat.so'
Current working directory
/local/home/corrado/perl/XML-Parser-2.34/Expat
*** Error code 1
make: Fatal error: Command failed for target `subdirs'


Still no good. Any ideas? FWIW: I also tried downloaded expat and
install form source in case something might have been missing from the
Sunfreeware one.

Thanks,

Edward

Re: Errors installing XML::Parser from CPAN on Solaris 9

am 08.09.2005 02:59:06 von Sisyphus

wrote in message

>
> # perl Makefile.PL cc=gcc
> Note (probably harmless): No library found for -lexpat
>
> Expat must be installed prior to building XML::Parser and I can't find
> it in the standard library directories. You can download expat from:
>
> http://sourceforge.net/projects/expat/
>
> If expat is installed, but in a non-standard directory, then use the
> following options to Makefile.PL:
>
> EXPATLIBPATH=... To set the directory in which to find libexpat
>
> EXPATINCPATH=... To set the directory in which to find expat.h
>
> For example:
>
> perl Makefile.PL EXPATLIBPATH=/home/me/lib
> EXPATINCPATH=/home/me/include

I'm not on Solaris, but you need to get rid of those warnings. They're
telling you that your expat library can't be found - and if it can't be
found, then XML::Parser won't build.

Rather than fix it according to the instructions given, I would instead open
the top level Makefile.PL and hard code $expat_libpath to the directory that
contains libexpat.a, and hard code $expat_incpath to the directory that
contains the expat library's expat.h.

At some stage you're going to need to re-run 'perl Makefile.PL cc=gcc'.
Whenever you do re-run that command make sure that you run 'make clean'
beforehand.

>
> Note that if you build against a shareable library in a non-standard
> location
> you may (on some platforms) also have to set your LD_LIBRARY_PATH
> environment
> variable at run time for perl to find the library.
>

I don't think this particular part (immediately above) of the warning will
come into play ... but I could be wrong

[snip]

> cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -xO3 -xdepend -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -KPIC
> -I/usr/perl5/5.6.1/lib/sun4-solaris-64int/CORE Expat.c
> cc: unrecognized option `-KPIC'
> cc: language depend not recognized
> cc: Expat.c: linker input file unused because linking not done
> Running Mkbootstrap for XML::Parser::Expat ()
> chmod 644 Expat.bs
> rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.so
> LD_RUN_PATH="/usr/local/lib" cc -G Expat.o -o
> ../blib/arch/auto/XML/Parser/Expat/Expat.so -L/usr/local/lib -lexpat
>
> cc: Expat.o: No such file or directory

Two things I notice here:

1) 'cc' is being invoked. I expected to see 'gcc' since that's what you
specified when you ran 'perl Makefile.PL cc=gcc'. I'm not sure about this
either, but I notice that the top level Makefile.PL does things with @ARGV -
expecting that @ARGV will contain the locations of libexpat.lib and expat.h.
It's not expecting @ARGV to contain 'cc=gcc'. I wonder if that's stuffing
something up ? If you've hard coded $expat_libpath and $expat_incpath you
should be able to remove the section of code that deals with @ARGV from the
Makefile.PL. ie remove from 'foreach (@ARGV) {' to '@ARGV =
@replacement_args;' (inclusive).

2) The command
'cc -c -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xO3
-xdepend -DVERSION=\"2.34\" -DXS_VERSION=\"2.34\" -KPIC -I/usr/perl5/5.6
..1/lib/sun4-solaris-64int/CORE Expat.c' is supposed to build Expat.o, but
that command is failing because " linker input file unused because linking
not done". I don't know exactly what that's telling us - even though I had a
very similar situation on Win32 trying to build OpenSSL. Hopefully that
problem will go away once you've fixed the other things already covered.
If it doesn't, then there's no reason why you couldn't cd to the folder that
contains Expat.c and run that command from the command line. (I guess you'd
be running gcc instead of cc, naturally) It will probably fail again - but
you might be able to discover why it fails, and modify the command
accordingly to allow it to succeed. Once you've manged to create Expat.o,
you can then cd back to the top level and just enter 'make' and it should
pick up where it left off, and continue on ( to completion ... or until the
next error :-)

Hth.

Cheers,
Rob