cpan module install woes - UTF-8 problem?

T

Troy Piggins

Not sure if this is the correct group. Please let me know if there's a
more applicable one.

I'm trying to install amavisd-new, spamassassin, and clamav on my ubuntu
7.10 system. One of amavisd-new's prerequisites is BerkeleyDB and there's
also an optional Mail::ClamAV that I want to install. All other modules
installed fine.

Not being that knowledgeable with perl, I usually install modules at the
commandline by:

$ sudo cpan BerkeleyDB

type commands. Trouble is for those 2 modules mentioned above, and also
some others required for spamassassin, I keep getting many errors[1].

I have read that there may be some problems with perl modules if the
environment is UTF-8. Mine is. I read that a solution may be to unset
LANG. Tried that with both:

$ env LANG= sudo cpan BerkeleyDB

and

$ LANG=
$ sudo cpan BerkeleyDB

to no avail. Any ideas? Please?


[1] Some of the output for BDB below. I can provide full if necessary.
---------------------------------------------
CPAN: Storable loaded ok
Going to read /var/cache/cpan/Metadata
Database was generated on Tue, 30 Oct 2007 12:36:36 GMT
Running install for module BerkeleyDB
Running make for P/PM/PMQS/BerkeleyDB-0.32.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for
/var/cache/cpan/sources/authors/id/P/PM/PMQS/BerkeleyDB-0.32.tar.gz ok
Scanning cache /var/cache/cpan/build for sizes BerkeleyDB-0.32/
BerkeleyDB-0.32/constants.
....
[snipped]
....
BerkeleyDB-0.32/Makefile.PL
Removing previously used /var/cache/cpan/build/BerkeleyDB-0.32

CPAN.pm: Going to build P/PM/PMQS/BerkeleyDB-0.32.tar.gz

WARNING: LICENSE is not a known parameter.
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
'LICENSE' is not a known MakeMaker parameter name.
Note (probably harmless): No library found for -ldb
Writing Makefile for BerkeleyDB
cp BerkeleyDB.pm blib/lib/BerkeleyDB.pm
AutoSplitting blib/lib/BerkeleyDB.pm (blib/lib/auto/BerkeleyDB)
cp BerkeleyDB/Hash.pm blib/lib/BerkeleyDB/Hash.pm
cp BerkeleyDB.pod blib/lib/BerkeleyDB.pod
cp BerkeleyDB/Btree.pm blib/lib/BerkeleyDB/Btree.pm
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -noprototypes -typemap
/usr/share/perl/5.8/ExtUtils/typemap -typemap typemap BerkeleyDB.xs >
BerkeleyDB.xsc && mv BerkeleyDB.xsc BerkeleyDB.c cc -c
-I/usr/local/BerkeleyDB/include -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-DVERSION=\"0.32\" -DXS_VERSION=\"0.32\" -fPIC "-I/usr/lib/perl/5.8/CORE"
BerkeleyDB.c BerkeleyDB.xs:68:16: error: db.h: No such file or directory
BerkeleyDB.xs:76:2: error: #error db.h is not for Berkeley DB at all.
BerkeleyDB.xs:211: error: expected specifier-qualifier-list before
'DB_ENV' BerkeleyDB.xs:222: error: expected specifier-qualifier-list
before 'DBTYPE' BerkeleyDB.xs:264: error: expected
specifier-qualifier-list before 'DBTYPE' BerkeleyDB.xs:306: error:
expected specifier-qualifier-list before 'DB_TXN' BerkeleyDB.xs:342:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'DBTKEY'
.... [snip]
....
BerkeleyDB.xs:4517: error: 'my_cxt_t' has no member named 'x_zero'
BerkeleyDB.xs:4518: error: 'my_cxt_t' has no member named 'x_empty'
BerkeleyDB.xs:4518: error: 'db_recno_t' undeclared (first use in this
function) BerkeleyDB.xs:4519: error: 'my_cxt_t' has no member named
'x_empty' make: *** [BerkeleyDB.o] Error 1
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible
 
T

Troy Piggins

Sherman Pendley is quoted & my replies are inline below :

I'm hearing ya! :)
It's a pet peeve of mine that missing libraries are described as
"probably harmless." At least nine times out of ten, a missing library
will result in an XS module that either fails to build or fails its
tests.

Let's see if that's the case here...


Yep. You're missing the Berkeley DB C library, and it's not as harmless
as the warning would have you believe. The Perl module is just a wrapper
for the C library, and without the C library it can't work.

So..... how do we fix it :)

Is the missing library installed from cpan, or deb package?
 
B

Ben Morrow

Quoth Troy Piggins said:
Not sure if this is the correct group. Please let me know if there's a
more applicable one.

I'm trying to install amavisd-new, spamassassin, and clamav on my ubuntu
7.10 system. One of amavisd-new's prerequisites is BerkeleyDB and there's
also an optional Mail::ClamAV that I want to install. All other modules
installed fine.

Not being that knowledgeable with perl, I usually install modules at the
commandline by:

$ sudo cpan BerkeleyDB

type commands. Trouble is for those 2 modules mentioned above, and also
some others required for spamassassin, I keep getting many errors[1].

I have read that there may be some problems with perl modules if the
environment is UTF-8.

This is not usually an issue if you are using 5.8.1 or above, and in any
case does not appear to be the problem here.
[1] Some of the output for BDB below. I can provide full if necessary.
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -noprototypes -typemap
/usr/share/perl/5.8/ExtUtils/typemap -typemap typemap BerkeleyDB.xs >
BerkeleyDB.xsc && mv BerkeleyDB.xsc BerkeleyDB.c cc -c
-I/usr/local/BerkeleyDB/include -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-DVERSION=\"0.32\" -DXS_VERSION=\"0.32\" -fPIC "-I/usr/lib/perl/5.8/CORE"
BerkeleyDB.c BerkeleyDB.xs:68:16: error: db.h: No such file or directory

Here is your problem: you don't have db.h, or, at least, not where perl
is looking for it. Have you installed the appropriate -dev db package?

Since you seem to be using Debian, it may be easier to install modules
through the package manager. This will handle external dependancies like
this for you.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top