Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Howto Install a Perl Wrapper Module for a C Library Locally

Reply
Thread Tools

Howto Install a Perl Wrapper Module for a C Library Locally

 
 
Edward WIJAYA
Guest
Posts: n/a
 
      03-22-2006
Hi,
I am attempting to install a CPAN module: Tree::Suffix, in my local home
directory.
Since I don't have SU previlege.

First of all I have installed the required libstree library
(http://www.cl.cam.ac.uk/~cpk25/libstree/)
in my particular home directory, namely $HOME/MyBioTool/libstree-0.4.2.

I have also set the environment like the following in my .bash_profile, so
that the module can call it. The bash_profile looks like this:


__BEGIN__
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# My path to the C library program
export CFLAGS="-I $HOME/MyBioTool/libstree-0.4.2/include"
export LDFLAGS="-L $HOME/MyBioTool/libstree-0.4.2/lib"

PATH=$PATH:$HOME/bin:

export PATH
unset USERNAME
export
PERL5LIB=/home/ewijaya/lib/perl5/site_perl/5.8.5/i686-linux:/home/ewijaya/lib/perl5/site_perl/5.8.5
__END__


However, when I tried installing the Tree::Suffix module using CPAN shell,
I found error message that seems to fail to recognize where does my C
library is stored. It returns something like this in the end:

Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible


It seems to me it doesn't recognize the place where I store this libstree
library.
I then try various way to install it manually:


$perl Makefile.PL CFLAGS="$CFLAGS -I$HOME/MyBioTool/libstree-0.4.2/
include" LDFLAGS="$LDFLAGS -L$HOME/MyBioTool/libstree-0.4.2/lib"

or

$perl Makefile.PL CCFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"

or

perl -w Makefile.PL "INC=-I $HOME/MyBioTool/libstree-0.4.2/include"
"LIB=-L $HOME/MyBioTool/libstree-0.4.2/lib"

But without any success.
Does anybody have any experience with this kind of installation?
Is there anything I am missing here?

--
Edward WIJAYA
SINGAPORE
 
Reply With Quote
 
 
 
 
attn.steven.kuo@gmail.com
Guest
Posts: n/a
 
      03-22-2006
Edward WIJAYA wrote:
> Hi,
> I am attempting to install a CPAN module: Tree::Suffix, in my local home
> directory.



(snipped)


> However, when I tried installing the Tree::Suffix module using CPAN shell,
> I found error message that seems to fail to recognize where does my C
> library is stored. It returns something like this in the end:
>
> Running make test
> Can't test without successful make
> Running make install
> make had returned bad status, install seems impossible
>
>
> It seems to me it doesn't recognize the place where I store this libstree
> library.
> I then try various way to install it manually:
>
>
> $perl Makefile.PL CFLAGS="$CFLAGS -I$HOME/MyBioTool/libstree-0.4.2/
> include" LDFLAGS="$LDFLAGS -L$HOME/MyBioTool/libstree-0.4.2/lib"
>
> or
>
> $perl Makefile.PL CCFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
>
> or
>
> perl -w Makefile.PL "INC=-I $HOME/MyBioTool/libstree-0.4.2/include"
> "LIB=-L $HOME/MyBioTool/libstree-0.4.2/lib"
>
> But without any success.
> Does anybody have any experience with this kind of installation?
> Is there anything I am missing here?




Tree::Suffix uses EUMM for module installation; and
the documentation for EUMM:


http://search.cpan.org/~mschwern/Ext...s/MakeMaker.pm

indicates that you should use CCFLAGS and LDDLFLAGS
(note the spelling) for configuration.

Thus, I'd try:

perl Makefile.PL CCFLAGS=... LDDLFLAGS=...

--
Hope this helps,
Steven

 
Reply With Quote
 
 
 
 
Edward wijaya
Guest
Posts: n/a
 
      03-22-2006
On Wed, 22 Mar 2006 23:08:26 +0800, http://www.velocityreviews.com/forums/(E-Mail Removed)
<(E-Mail Removed)> wrote:

Hi Steven,
Thanks so much for your reply.

>
> Thus, I'd try:
>
> perl Makefile.PL CCFLAGS=... LDDLFLAGS=...
>


Following your suggestion I tried this:

$ perl Makefile.PL CCFLAGS="$CCFLAGS
-I$HOME/MyBioTool/libstree-0.4.2/include" LDDLFLAGS="$LDDLFLAGS
-L$HOME/MyBioTool/libstree-0.4.2/lib"

It returns:

Note (probably harmless): No library found for -lstree
Writing Makefile for Tree::Suffix

Which I think is problematic (although it says harmless).
Because when I do

$ make test

It returns error:

Suffix.o(.text+0x3bb1):/home/ewijaya/.cpan/build/Tree-Suffix-0.12/Suffix.c:489:
undefined reference to `pthread_getspecific'
Suffix.o(.text+0x3bcf):/home/ewijaya/.cpan/build/Tree-Suffix-0.12/Suffix.c:489:
undefined reference to `Perl_sv_2pv_flags'
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Tree/Suffix/Suffix.so] Error 1

Similarly I can't do make install.
Any idea what went wrong?

--
Regards,
Edward WIJAYA
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Install a perl module to the main perl lib dir Thomas Steinbach Perl Misc 1 02-13-2009 08:25 AM
Perl MakeMaker - how to force Perl linking with the static C library (libcrt.lib) instead of dynamic C library (msvcrt.lib) Avi Perl Misc 0 04-17-2007 09:20 PM
trying to install gems locally msoulier Ruby 1 06-12-2006 12:44 PM
HOWTO - do local ppm module install (fix "Could not locate a PPDfile") ROC Perl Misc 0 07-09-2005 05:25 PM
[Dream] A meta-wrapper module to interface any C dynamic library Francesco Bochicchio Python 6 07-04-2003 05:39 PM



Advertisments