Hi,
I am attempting to install a CPAN module, Tree::Suffix in my local home directory. First of all I have installed the required libstree library 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:
# .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/monkfan/lib/perl5/site_perl/5.8.5/i686-linux:/ho +me/monkfan/lib/perl5/site_perl/5.8.5


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


Besides, I also tried a manual method to install the module:
~/.cpan/build/Tree-Suffix-0.12$ perl Makefile.pl CFLAGS="$CFLAGS -I$HO +ME/MyBioTool/libstree-0.4.2/include" LDFLAGS="$LDFLAGS -L$HOME/MyBioT +ool/libstree-0.4.2/lib"
Which also leads me nowhere.
Did I miss anything here?

Update: I repositioned the Makefile.PL in front, as suggested by fizbin. It gives: doesn't recognize CFLAGS as MakeMaker parameter name.
Update 2: Finally I managed to get it installed
What I did is the following steps: 1. Add this line in my .bash_profile:
export LD_LIBRARY_PATH=/home/monkfan/MyBioTool/libstree-0.4.2/lib:${L +D_LIBRARY_PATH} export CFLAGS="-I $HOME/MyBioTool/libstree-0.4.2/include"; export LDFLAGS="-L $HOME/MyBioTool/libstree-0.4.2/lib";
2. Add this line in my .bashrc :
export LIBRARY_PATH=$HOME/MyBioTool/libstree-0.4.2/lib
3. Add this line in my Makefile.PL:
__BEGIN__ use strict; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Tree::Suffix', VERSION_FROM => 'lib/Tree/Suffix.pm', ABSTRACT_FROM => 'lib/Tree/Suffix.pm', AUTHOR => 'gray <gray@cpan.org>', PREREQ_PM => { 'Test::More' => 0 }, LIBS => [ '-L/home/monkfan/MyBioTool/libstree-0.4.2/lib -ls +tree' ], INC => '-I/home/monkfan/MyBioTool/libstree-0.4.2/include' + , clean => { FILES => 'Tree-Suffix-*' }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, ); __END__
4. Do this:
$ perl Makefile.PL PREFIX=~/lib/ LIB=~/lib/ OR $ perl Makefile.PL PREFIX=~/lib/perl5/site_perl/5.8.5 LIB=~/lib/perl5/ +site_perl/5.8.5
Depending on the location you wish to install.
5. Followed by standard: make, make test, make install

Regards,
Edward

In reply to Installing Perl Wrapper Module for a C Library (Tree::Suffix) Locally by monkfan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.