Discussion:
XML::Parser::Expat install problem
(too old to reply)
Justin Wyllie
2005-04-23 23:44:22 UTC
Permalink
Hi

I am trying to install this module. I have installed XML-Parser-2.34 and
this seems to be ok. It is supposed to install XML::Expat with it.

On my system it seems to have partly installed XML:;Expat. I have:

Expat::Expat.so
Expat.Expat.bs - which is in fact empty.

However when I try to use this in a Perl Script it fails with this message:

'/usr/home/xxx/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/auto/XML/Par
ser/Expat/Expat.so' for module XML::Parser::Expat: Shared object
"libexpat.so.5" not found at
/usr/local/lib/perl5/5.6.1/i386-freebsd/DynaLoader.pm line 206.

I dedice from this that the libexpat.so.5 compiled file is missing. I have
tried installing Expat directly rather than as part of the XML-Parser-2.34
build from CPAN. Doing this with expat-1.95.6 it does install expat.so.4
(not in my Perl libaries - but still it looks promising.

So I tried doing this with expat-1.95.8 which I got as a .tar.gz file from
sourceforge.net and my attempts to unzip and uncompress this all fail.

Can anyone tell me how I can get libexpat.so.5 installed onto my system ?


Many thanks for any help

Justin Wyllie
Sisyphus
2005-04-24 09:04:11 UTC
Permalink
Post by Justin Wyllie
Expat::Expat.so
Expat.Expat.bs - which is in fact empty.
'/usr/home/xxx/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/auto/XML/Par
Post by Justin Wyllie
ser/Expat/Expat.so' for module XML::Parser::Expat: Shared object
"libexpat.so.5" not found at
/usr/local/lib/perl5/5.6.1/i386-freebsd/DynaLoader.pm line 206.
Installing XML::Parser will install *that* module and nothing else. It won't
install expat (which is needed by XML::Parser). The Expat.so and Expat.bs
files that you found are both part of the XML::Parser module. It's normal
that Expat.bs is empty.
Post by Justin Wyllie
I dedice from this that the libexpat.so.5 compiled file is missing. I have
tried installing Expat directly rather than as part of the XML-Parser-2.34
build from CPAN. Doing this with expat-1.95.6 it does install expat.so.4
(not in my Perl libaries - but still it looks promising.
Yep - that's pretty much right - when you build and install expat, it will
*not* be installed within perl. I imagine that libexpat.so will be installed
into /usr/local/lib. The solution to your problem may be as simple as
renaming 'libexpat.so.4' to 'libexpat.so.5' - though I don't really
understand this suffix numbering stuff.

On my (Mandrake) linux box I find that I already have /usr/lib/libexpat.so
and /usr/lib/libexpat.so.0.4.0 (which are identical files, I think). The
fact that they're in /usr/lib/ leads me to believe that they were probably
installed from the OS installation disks (either when the OS was installed,
or at a later date).

I found that I could rename /usr/lib/libexpat.so to whatever I liked and it
made no difference re XML::Parser - but if I renamed
/usr/lib/libexpat.so.0.4.0, then any perl script that attempted to load
XML::Parser would fail because 'libexpat.so.0' could not be found.

If 'libexpat.so' had not been found on your box in at least one of the
directories reported by 'perl -V:libpth', then the XML::Parser build process
would have died at the 'perl Makefile.PL' stage. (Take a look at the
XML::Parser Makefile.PL and you'll see why.) So ... it seems to me that you
already had everything you needed when you set out to build XML::Parser -
but that there's something not quite right in regard to the naming of the
libexpat '.so' file.

Hope there's something there that helps.

Cheers,
Rob
Justin Wyllie
2005-04-26 21:47:11 UTC
Permalink
Post by Sisyphus
Post by Justin Wyllie
Expat::Expat.so
Expat.Expat.bs - which is in fact empty.
However when I try to use this in a Perl Script it fails with this
'/usr/home/xxx/usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/auto/XML/Par
Post by Sisyphus
Post by Justin Wyllie
ser/Expat/Expat.so' for module XML::Parser::Expat: Shared object
"libexpat.so.5" not found at
/usr/local/lib/perl5/5.6.1/i386-freebsd/DynaLoader.pm line 206.
Installing XML::Parser will install *that* module and nothing else. It won't
install expat (which is needed by XML::Parser). The Expat.so and Expat.bs
files that you found are both part of the XML::Parser module. It's normal
that Expat.bs is empty.
Post by Justin Wyllie
I dedice from this that the libexpat.so.5 compiled file is missing. I have
tried installing Expat directly rather than as part of the
XML-Parser-2.34
Post by Sisyphus
Post by Justin Wyllie
build from CPAN. Doing this with expat-1.95.6 it does install expat.so.4
(not in my Perl libaries - but still it looks promising.
Yep - that's pretty much right - when you build and install expat, it will
*not* be installed within perl. I imagine that libexpat.so will be installed
into /usr/local/lib. The solution to your problem may be as simple as
renaming 'libexpat.so.4' to 'libexpat.so.5' - though I don't really
understand this suffix numbering stuff.
On my (Mandrake) linux box I find that I already have /usr/lib/libexpat.so
and /usr/lib/libexpat.so.0.4.0 (which are identical files, I think). The
fact that they're in /usr/lib/ leads me to believe that they were probably
installed from the OS installation disks (either when the OS was installed,
or at a later date).
I found that I could rename /usr/lib/libexpat.so to whatever I liked and it
made no difference re XML::Parser - but if I renamed
/usr/lib/libexpat.so.0.4.0, then any perl script that attempted to load
XML::Parser would fail because 'libexpat.so.0' could not be found.
If 'libexpat.so' had not been found on your box in at least one of the
directories reported by 'perl -V:libpth', then the XML::Parser build process
would have died at the 'perl Makefile.PL' stage. (Take a look at the
XML::Parser Makefile.PL and you'll see why.) So ... it seems to me that you
already had everything you needed when you set out to build XML::Parser -
but that there's something not quite right in regard to the naming of the
libexpat '.so' file.
Hope there's something there that helps.
Cheers,
Rob
Hi Rob

Thanks, that was helpful. Esp. understanding that the Expat.pm is part of
XML::Parser and nothing to do with Expat itself. It 'provides an interface
to Expat' according to its documentation.

I installed Expat into the expected directory /usr/local/lib. The question
of versions is just to do with the latest version of Expat. If you install
from Expat-1.95.8 you get Expat.so.5.

Running Makefile.PL in the XML-Parser directory then seemed to know about
Expat and it all went smoothly from then on.

I don't really know much about Perl and C. It seems that the files with
extension .so are compiled C code which is accessed by the Perl modules when
the modules are complied. The Makefile for XML::Parser seems to expect the
Expat files to be in usr/local/lib and to put a link in the Perl directories
to the shared libraries here.

Thanks for your help

Thrilled to get RSS working - now I can start on my blog

Best regards

Justin Wyllie

Loading...