Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems installing XML::Parser 1

Status
Not open for further replies.

tonykent

IS-IT--Management
Jun 13, 2002
251
GB
Has anyone had experience of installing XML::parser with perl 5.10.0? I am having no joy with it at all.

XMP::parser requires expat to be installed first. I have done this successfully (at least it did not throw up any errors).

I then create the XML::parser makefile with:

Code:
Makefile.PL EXPATLIBPATH=/net/myserver/opt/product/ticm/build_tools/hp/expat-2.0.1/lib EXPATINCPATH=/net/myserver/opt/product/ticm/build_tools/hp/expat-2.0.1/include

This outputs:
Code:
Checking if your kit is complete...
Looks good
Writing Makefile for XML::Parser::Expat
Writing Makefile for XML::Parser

When I then run make, however, I always get:
Code:
cp Parser/Encodings/x-sjis-cp932.enc blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
etc etc (lots of these until)....
make[1]: Entering directory `/opt/product/ticm/tonydev/CPAN_libs/XML-Parser-2.36/Expat'
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
/opt/product/ticm/tony/perl_test/bin/perl /opt/product/ticm/tony/perl_test/lib/5.10.0/ExtUtils/xsubpp -noprototypes -typemap /opt/product/ticm/tony/perl_test/lib/5.10.0/ExtUtils/typemap -typemap typemap  Expat.xs > Expat.xsc && mv Expat.
xsc Expat.c
cc -c  -I/net/myserver/opt/product/ticm/build_tools/hp/expat-2.0.1/include -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit   -DVERSION=\"2.36\" -DXS_VERSION=\"2.36\" +Z "-I/opt/prod
uct/ticm/tony/perl_test/lib/5.10.0/PA-RISC2.0-LP64/CORE"   Expat.c
Running Mkbootstrap for XML::Parser::Expat ()
chmod 644 Expat.bs
rm -f ../blib/arch/auto/XML/Parser/Expat/Expat.sl
LD_RUN_PATH="/net/myserver/opt/product/ticm/build_tools/hp/expat-2.0.1/lib" /usr/bin/ld  -b +vnocompatwarnings -L/usr/local/lib -L/lib/pa20_64 Expat.o  -o ../blib/arch/auto/XML/Parser/Expat/Expat.sl
\
           -L/net/myserver/opt/product/ticm/build_tools/hp/expat-2.0.1/lib -lexpat       \

ld: Can't find library for -lexpat
Fatal error.
I've tried this with several different versions of expat and XML::parser, but always get the 'ld: Can't find library for -lexpat' error at the end.

I'm trying this on an HPUX 11.11 server, with perl 5.10.0, expat 2.0.1 and XML::parser 2.36 (for the run generating the output above).

I'm obviously doing something fundamentally wrong; can anyone point me in the right direction?

 
I had no response to this but persevered and finally got to the bottom of it so I thought I'd post a reply in case anybody else is looking for information on the same issue in the future.

There were several issues involved with my setup. I had perl 5.10.0 compiled using the free HPUX compiler; and was trying to install expat and XML_Parser using gcc make.

Firstly, it is apparent that trying to use gcc make to install expat and then XML-Parser does NOT work with perl when the latter has been compiled using the HP compiler. If you want to use gcc make, you appear to have to compile perl using gcc as well.

(The free compiler supplied with HP 11 is itself buggy and requires a patch from the HP website. This does then work).

I compiled perl using gcc as follows:

Code:
./Configure -A prepend:libswanted='cl pthread ' -Dcc='<path>/gcc-3.4.6/bin/gcc' -Dprefix=/<path>/5.10.0
make
make test
make install

I had no joy with trying to use gcc-3.2.2 or 3.4.4. However, 3.4.6 worked ok.

Next, I installed expat as follows:

Code:
perl Makefile.PL
make
make test
make install

Finally, XML_Parser exactly as expat as above.

It finally linked and installed without any issues.


 
I should point out that XMP-Parser actually needed the following Makefile.PL command:

Code:
perl Makefile.PL EXPATLIBPATH=<path>expat-2.0.1/lib EXPATINCPATH=<path>expat-2.0.1/include

I also set the following environment variables:
LIBDIR=/<path>/expat-2.0.1/lib
SHLIB_PATH=$LIBDIR:etc etc

How essential those latter 2 are I'm not sure but I wanted to be safe rather than sorry.
 
Tony

Thanks for posting the answer, even though you didn't get any help from the forum. Have a star...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Thanks Steve, most kind. I've certainly learnt a lot about installing unix compilers and tools as a result of this exercise!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top