Solved

Problems installing Perl modules using CPAN/make...

Posted on 2007-03-20
6
938 Views
Last Modified: 2010-05-18
I'm having some problems installing perl mods using the CPAN module.  The install command completes successfully, but when I go to use the installed module it cannot be found.  I already ran 'install CPAN::Bundle' and 'cpan reload' but the issue persists.

Here's an example...I'm trying to install XML::LibXML::Common.  There are no errors thrown, but it appears the install is incomplete.

Oh and I've tried installing the modules using the 'make' approach as well.  The same thing happens...the installations appear successful, but the modules cannot be called.

Please help!

$ cpan
CPAN: File::HomeDir loaded ok

cpan shell -- CPAN exploration and modules installation (v1.8802)
ReadLine support enabled

cpan[1]> install XML::LibXML::Common
CPAN: Storable loaded ok
Going to read /home/share/.cpan/Metadata
  Database was generated on Tue, 20 Mar 2007 10:08:57 GMT
Running install for module XML::LibXML::Common
Running make for P/PH/PHISH/XML-LibXML-Common-0.13.tar.gz
CPAN: Digest::SHA loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for /home/share/.cpan/sources/authors/id/P/PH/PHISH/XML-LibXML-Common-0.13.tar.gz ok
Scanning cache /home/share/.cpan/build for sizes
XML-LibXML-Common-0.13/
XML-LibXML-Common-0.13/ppport.h
XML-LibXML-Common-0.13/test.pl
XML-LibXML-Common-0.13/Common.pm
XML-LibXML-Common-0.13/Changes
XML-LibXML-Common-0.13/MANIFEST
XML-LibXML-Common-0.13/typemap
XML-LibXML-Common-0.13/Common.xs
XML-LibXML-Common-0.13/LICENSE
XML-LibXML-Common-0.13/Makefile.PL
XML-LibXML-Common-0.13/README
Removing previously used /home/share/.cpan/build/XML-LibXML-Common-0.13

  CPAN.pm: Going to build P/PH/PHISH/XML-LibXML-Common-0.13.tar.gz

enable native perl UTF8
running xml2-config... ok
looking for -lxml2... yes
Checking if your kit is complete...
Looks good
Writing Makefile for XML::LibXML::Common
cp Common.pm blib/lib/XML/LibXML/Common.pm
/usr/bin/perl.exe /usr/lib/perl5/5.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8/ExtUtils/typemap -typemap typemap  Common.xs > Common.xsc && mv Common.xsc Common.c
gcc -c  -I/usr/include/libxml2 -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -I/usr/local/include -DUSEIMPORTLIB -O3   -DVERSION=\"0.13\" -DXS_VERSION=\"0.13\"  "-I/usr/lib/perl5/5.8/cygwin/CORE"
 -DHAVE_UTF8 -DHAVE_BLANK Common.c
Running Mkbootstrap for XML::LibXML::Common ()
chmod 644 Common.bs
rm -f blib/arch/auto/XML/LibXML/Common/Common.dll
LD_RUN_PATH="" ld2  -s -L/usr/local/lib Common.o  -o blib/arch/auto/XML/LibXML/Common/Common.dll  /usr/lib/perl5/5.8/cygwin/CORE/libperl.dll.a -L/usr/lib -lxml2 -lz -liconv -lm
gcc -shared -o  Common.dll -Wl,--out-implib=libCommon.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 -Wl,--enable-auto-image-base \
-s -L/usr/local/lib Common.o  /usr/lib/perl5/5.8/cygwin/CORE/libperl.dll.a -L/usr/lib -lxml2 -lz -liconv -lm
Creating library file: libCommon.dll.a
mv Common.dll libCommon.dll.a blib/arch/auto/XML/LibXML/Common/
chmod 755 blib/arch/auto/XML/LibXML/Common/Common.dll
cp Common.bs blib/arch/auto/XML/LibXML/Common/Common.bs
chmod 644 blib/arch/auto/XML/LibXML/Common/Common.bs
  /usr/bin/make  -- OK
Running make test
/usr/bin/perl.exe "-Iblib/lib" "-Iblib/arch" test.pl
1..8
# Running under perl version 5.008007 for cygwin
# Current time local: Tue Mar 20 19:05:43 2007
# Current time GMT:   Tue Mar 20 23:05:43 2007
# Using Test.pm version 1.25
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
  /usr/bin/make test -- OK
Running make install
Installing /usr/lib/perl5/site_perl/5.8/cygwin/auto/XML/LibXML/Common/Common.bs
Installing /usr/lib/perl5/site_perl/5.8/cygwin/auto/XML/LibXML/Common/Common.dll
Installing /usr/lib/perl5/site_perl/5.8/cygwin/auto/XML/LibXML/Common/libCommon.dll.a
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/site_perl/5.8/cygwin/XML/LibXML/Common.pm
Writing /usr/lib/perl5/site_perl/5.8/cygwin/auto/XML/LibXML/Common/.packlist
Appending installation info to /usr/lib/perl5/5.8/cygwin/perllocal.pod
  /usr/bin/make install UNINST=1 -- OK

cpan[2]> exit
Lockfile removed.

$ perl -e 'use XML::LibXML::Common;'
Can't locate XML/LibXML/Common.pm in @INC (@INC contains: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8/cyg
win /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/cygwin /usr/lib/perl5/vendor_perl/5.8 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

$
0
Comment
Question by:kellytroym
  • 3
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
Kim Ryan earned 250 total points
ID: 18760476
It could be a permision problem. I have had cases were a module is installed OK, but the execute bit is not set on the file permisions. Seems to be a problelm if you install as root. FOr Unix, solutuion was just to chmod the file.
You may need to do the equivalnet with Windows.
0
 

Author Comment

by:kellytroym
ID: 18760604
At the end of the 'install XML::LibXML::Common' command one of the final lines reads "Installing /usr/lib/perl5/site_perl/5.8/cygwin/XML/LibXML/Common.pm".  This file doesn't exist.  It seems the install process made an attempt to copy the Common.pm mod to the proper directory (where Perl would see it), but wasn't able to.  The odd thing is that no error was thrown.

This is a Cygwin environment.  I could recursively chmod 777 the entire /usr/lib/perl5/site_perl/5.8/cygwin directory, but doesn't it seem like there should be a better solution (if this in fact IS a solution)?

Thanks.
0
 
LVL 17

Expert Comment

by:mjcoyne
ID: 18762733
No errors are thrown by the manual ./configure, make, make install method either?

Does the module install correctly via CPAN in Windows (outside Cygwin)?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:kellytroym
ID: 18763065
Right, no errors, but the .PM file cannot be found when calls are made to the module.

The Cygwin Perl interpreter cannot be called outside of Cygwin.

Just don't understand why the .PM files don't get placed in any @INC dir...
0
 
LVL 17

Assisted Solution

by:mjcoyne
mjcoyne earned 250 total points
ID: 18763253
"The Cygwin Perl interpreter cannot be called outside of Cygwin."

Yes, but the Windows Perl Interpreter can, if you have Windows Perl installed (see http://www.activestate.com/downloads/).  If you can install the module successfully in Windows or to a Linux installation (e.g. anywhere outside of Cygwin), then the problem's not with Perl, XML::LibXML::Common, or CPAN, but with Cygwin.

BTW, the readme for this module mentions:

"Of course libxml2 2.4.20 needs to be installed, to compile this package. You can get the latest libxml2 version from ftp://xmlsoft.org.

If this library is not installed, don't expect any XML::LibXML module to compile."

Do you have libxml2 installed?

And, finally, is there a reason you must use this (rather old) module?  What task are you trying to accomplish?  There are likely several ways of accomplishing your task without going through XML::LibXML::Common.

0
 

Author Comment

by:kellytroym
ID: 18763744
I don't want to install activestate perl on this box, thanks.

Yes, the prerequisites were all met.

I use XML::LibXML to store XML files in an easy to manipulate hash.  XML::LibXML::Common is a prereq for XML::LibXML.

I re-installed perl (in cyg) and everything is now building properly.

Thanks guys...I'll split the points...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now