Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Perl Modules In My Own Directory

by Anonymous Monk
on Apr 16, 2003 at 12:35 UTC ( [id://250867]=perlquestion: print w/replies, xml ) Need Help??

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

Hi Monks,

The company I work for has perl and all it's libraries/modules/etc on a server that the rest of us mount from our local machines. Unfortunately, we don't have write access. So if we want to install perl modules that aren't already there, we have to put them in a different directory on our local machines. So in theory I should do something like set my PERL5LIB environmental variable to /my/perl/dir and then do:

perl Makefile.PL PREFIX=/my/perl/dir
make
make test
make install

Unfortunately, when I do that, it still tries to install to the mounted directory on the server! If I look at Makefile after doing "perl Makefile.PL PREFIX=/my/perl/dir", I see that PREFIX is set properly, but INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSITELIB, INSTALLSITEARCH, INSTALLBIN, and INSTALLSCRIPT are still pointing to directories on the server. Can anyone help? Just for the record, I did "echo $PERL5LIB" before doing all this just to make sure that the environmental variable did indeed get set. The modules I'm dealing with currently are GD and GDGraph.

Replies are listed 'Best First'.
Re: Perl Modules In My Own Directory
by physi (Friar) on Apr 16, 2003 at 12:45 UTC
    Maybe try :
    perl Makefile.PL LIB=/my/perl/dir
    as described in
    perldoc ExtUtils::MakeMaker
    -----------------------------------
    --the good, the bad and the physi--
    -----------------------------------
    

      My favorite part of this was reading perldoc ExtUtils::MakeMaker, getting to the "PREFIX and LIB atribute" section, and finding a paragraph that ends with:

      Conflicts between parameters LIB, PREFIX, and the various INSTALL* arguments are resolved so that XXX
      where I can only assume that "XXX" is like perl6's ... (the "yadda yadda yadda" operator).

                      - tye
Re: Perl Modules In My Own Directory
by Helter (Chaplain) on Apr 16, 2003 at 12:47 UTC
    I too have to install modules locally. I have never had a problem (besides dependancies...oh how I hate dependancies :) ). For all of the packages there is some sort of README file that has information on doing a local build.

    It usually comes down to opening the Makefile.PL in your favorite editor, and looking for all the path variables that are set to something you don't like and changing them.

    Good luck!
Re: Perl Modules In My Own Directory (details/debug)
by tye (Sage) on Apr 16, 2003 at 17:13 UTC

    You give a good description but I think the key lies in some of the details that you have (reasonably) omitted. If I ran into this problem, I'd use

    % perl -d Makefile.PL PREFIX=/my/perl/dir DB<1> require ExtUtils::MM_Unix DB<2> b ExtUtils::MM_Unix::init_main DB<3> c
    and then step through that subroutine in rather large chunks, watching how $self->{INSTALLPRIVLIB} (for example) gets manipulated as it goes along, figuring out why $self->{PREFIX} does not end up affecting it.

    The code that does this is complex enough that I didn't see any hope of me spotting the problem without concrete details about your Config.pm file settings, etc.

                    - tye
Re: Perl Modules In My Own Directory
by RollyGuy (Chaplain) on Apr 16, 2003 at 14:39 UTC
    I think that you might need to type:
    make install PREFIX=/my/perl/dir
    This would override the PREFIX directive in the makefile and use your directory as the install directory. Look in the makefile for other clues as to what "variables" to set.

    Also, you could just do the steps up until the make install. At that point you will have a directory named ".blib". This directory contains all of the files that would've been copied by the install script. You can simply copy them yourself.

    Hope this helps.
Re: Perl Modules In My Own Directory
by thejoker101 (Initiate) on Apr 16, 2003 at 18:41 UTC
    You seem to be having the same troubles I was. I didn't have permissions to the Perl library directory, which is where - when I did a 'make install' - the module was attempting to install itself.

    Here's your solution I belive: You said that INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSITELIB, INSTALLSITEARCH, INSTALLBIN, and INSTALLSCRIPT where all set incorrectly. To correct that, just do what you did with PREFIX. Any of those variables can be overridden. As in:

    perl Makefile.PL INSTALLPRIVLIB=/my/dir INSTALLARCHLIB=/my/dir etc.

    That's worked for me.
      Also then do a 'make pure_perl_install'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found