Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

MakeMaker dies looking for Perl headers

by fuzzyping (Chaplain)
on May 03, 2005 at 15:10 UTC ( [id://453622]=perlquestion: print w/replies, xml ) Need Help??

fuzzyping has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to build a statically compiled version of Apache/mod_perl using a localized version of Perl 5.8.6 installed in my home directory. For the most part, everything is running smoothly except now I've run into a problem with MakeMaker.pm. When I try to run the Makefile.PL for mod_perl, MakeMaker complains that it can't find the Perl headers. Reviewing the perldoc for MakeMaker, it appears that PERL_INC should override this behavior, but it still keeps trying to find the headers under /usr/local instead of ~/perl5.

Here are all the steps I used to get to this point:

$ mkdir ~/perl5 ~/apache $ cd perl-5.8.6 $ sh Configure -Umymalloc -des $ make $ make test $ make install DESTDIR=~/perl5 $ mv ~/perl5/usr/local/* ~/perl5/ $ rm -rf ~/perl5/usr/ $ export PERL5LIB=~/perl5/lib/perl5/5.8.6:~/perl5/lib/perl5/site_perl/ +5.8.6 $ cd ../mod_perl-1.29/ $ export PERL_INC=~/perl5/lib/perl5/5.8.6/x86_64-linux/CORE $ ~/perl5/bin/perl Makefile.PL \ PREFIX=~/perl5 \ APACHE_PREFIX=~/apache \ APACHE_SRC=../apache_1.3.33/src \ DO_HTTPD=1 \ PREP_HTTPD=1 \ EVERYTHING=1 \ USE_APACI=1

And the trailing error:

Error: Unable to locate installed Perl libraries or Perl source code. It is recommended that you install perl in a standard location before building extensions. Some precompiled versions of perl do not contain these header files, so you cannot build extensions. In such a case, please build and install your perl from a fresh perl distribution. It usually solves this kind of problem. (You get this message, because MakeMaker could not find "/usr/local/li +b/perl5/5.8.6/x86_64-linux/CORE/perl.h")

Why does it continue to look in /usr/local instead of ~/perl5?

Update: I fixed it by properly installing the local perl with the prefix option. Full instructions for a non-root static Apache/mod_perl 1.x installation...

$ mkdir ~/perl5 ~/apache $ cd perl-5.8.6 $ sh Configure -Umymalloc -des -Dprefix=~/perl5 $ make $ make test $ make install $ export PERL5LIB=~/perl5/lib/5.8.6:~/perl5/lib/site_perl/5.8.6 $ cd ../mod_perl-1.29/ $ ~/perl5/bin/perl Makefile.PL \ PREFIX=~/perl5 \ APACHE_PREFIX=~/apache \ APACHE_SRC=../apache_1.3.33/src \ DO_HTTPD=1 \ PREP_HTTPD=1 \ EVERYTHING=1 \ USE_APACI=1 $ make $ make install $ cd ../apache_1.3.33 $ ./configure --prefix=$HOME/apache \ --with-layout=Apache \ --disable-rule=EXPAT \ --enable-module=rewrite \ --activate-module=src/modules/perl/libperl.a \ --disable-shared=perl $ make $ make install $ cd ../Apache-Session-1.6 $ ~/perl5/bin/perl Makefile.PL PREFIX=~/perl5 $ make $ make install $ cd ../libapreq-1.33 $ ~/perl5/bin/perl Makefile.PL PREFIX=~/perl5 $ make $ make install

Thanks,

-fp

Replies are listed 'Best First'.
Re: MakeMaker dies looking for Perl headers
by dragonchild (Archbishop) on May 03, 2005 at 15:13 UTC
    Try setting INC and LIB as well.

    Did you actually try to read the ExtUtils::MakeMaker documentation? It lists every single parameter it knows about and what it means ...


    The Perfect is the Enemy of the Good.

      Did you read the OP's node? He clearly states the use of perldoc for MakeMaker. I've been trying to help him fix this OOB for a few days and we've both exhausted all logical paths with the installation and configuration. This should be easier. Someone has to have done this.

      While I appreciate your concern and excellent link to the ExtUtils::MakeMaker documentation, I find it slightly offensive to read considering I just clicked from that open tab (where its been open for a while as we read through each of the ENV variables we could be setting) to this one.

      Sure, RTFM replies are great, but it'd be nice if someone who's actually solved this problem posted a reply saying "OH HEY I SET THIS VARIABLE!" so when google spiders thepen someone in our position can actually find the solution to their problem instead of links to general documentation that they're probly already reading.

      -brad..
      Of course I did, that's where I found out about PERL_INC. I don't see how modifying @INC or @LIB will help:

      $ ~/perl5/bin/perl -e 'print "$_\n" foreach (@INC)' /home/jason/perl5/lib/perl5/5.8.6/x86_64-linux /home/jason/perl5/lib/perl5/5.8.6 /home/jason/perl5/lib/perl5/site_perl/5.8.6/x86_64-linux /home/jason/perl5/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/5.8.6/x86_64-linux /usr/local/lib/perl5/5.8.6 /usr/local/lib/perl5/site_perl/5.8.6/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl . $ ~/perl5/bin/perl -e 'print "$_\n" foreach (@LIB)' $ /usr/bin/perl -e 'print "$_\n" foreach (@LIB)'
      -fp
        Not @INC or @LIB. The INC and LIB parameters to Makefile.PL

        The Perfect is the Enemy of the Good.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://453622]
Approved by polettix
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found