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

Howdy kind monks! I need to install List::MoreUtils in a cluster. Needless to say, I do not have administrative privileges. If I do ( I used the full $HOME path, I am omitting it for the sake of brevity ):

 perl Makefile.PL INSTALL_BASE=~/usr/local/lib/perl5

After running

 make install

I get:

 Warning: You do not have permissions to install into /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 114.

And if I try:

 make install --directory=~/usr/local/lib/perl5

I get:

make: Entering directory `~/usr/local/lib/perl5' make: *** No rule to make target `install'. Stop. make: Leaving directory `~/usr/local/lib/perl5'

I checked Makefile and I see:

 MakeMaker ARGV: (q[INSTALL_BASE=~/usr/local/lib/perl5])

But further down the file I find:

INSTALLPRIVLIB = /usr/lib/perl5/5.8.8 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /usr/lib/perl5/site_perl/5.8.8 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /usr/lib/perl5/vendor_perl/5.8.8 DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread +-multi DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-th +read-multi DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/share/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/share/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)

How do I change these to paths in my home folder? I also tried to use CPAN after duly specifying the same local path, but I got the same deal. Any help? Perlish regards!

Replies are listed 'Best First'.
Re: Installing List::MoreUtils in a computer cluster
by hippo (Archbishop) on Feb 23, 2015 at 23:08 UTC

    List::MoreUtils uses ExtUtils::MakeMaker as its installation method. Therefore all you should need is

    export PERL_MM_OPT='INSTALL_BASE=/your/choice/of/path'

    and then you can install in the usual way from a clean start.

      Therefore all you should need is export PERL_MM_OPT='INSTALL_BASE=/your/choice/of/path'

      Yeah, this is what  perl Makefile.PL INSTALL_BASE=~/usr/local/lib/perl5 accomplishes

      If it doesn't , then MakeMaker is corrupted (or super old) or being overridden

Re: Installing List::MoreUtils in a computer cluster
by soonix (Chancellor) on Feb 24, 2015 at 10:01 UTC

    Don't mess with the system perl (5.8.8 isn't quite the newest version, anyway). Can you use something like perlbrew?
    This way your admins can have their way and you can, too :-)

    Disclaimer: I didn't use it yet, I'm working in the Windows world, where nobody is even able to mess with the system perl :-)

Re: Installing List::MoreUtils in a computer cluster
by taioba (Acolyte) on Feb 24, 2015 at 14:22 UTC

    Many thanks for all the sage advice. soonix put me on the right track, from the perlbrew page I was guided to local::lib. As far as I can tell, doing

    perl -MCPAN -Mlocal::lib -e 'install List::MoreUtils'

    was enough to get it locally installed. Using the same strategy, I was able to install all the additional modules that depend on the first one. Let's see if I get this to work now. Thanks once more for all the help!

Re: Installing List::MoreUtils in a computer cluster
by locked_user sundialsvc4 (Abbot) on Feb 24, 2015 at 12:37 UTC

    This kind of requirement is essentially a re-statement of “installing Perl [packages ...] as a non-root user.”   You can, indeed, configure a local directory, arrange for PERL5LIB to include it, then arrange for cpan[m] to install things there, all without elevated privileges.   Many Un*xers will use part of /usr/local for this purpose.

    It is very advisable not to tamper with whatever Perl installation might be present at the system-wide level, because many system maintenance utilities provided by [distro ...] software vendors are written in Perl, and they implicitly rely upon their database of installed packages to know what the state of the system is.   If you hose up out-of-band modify that, you’re screwed recovery can be a little delicate . . .

    On the other hand, the research teams can readily configure their own, even project-specific, CPAN library configuration, superimposed upon top of the standard system installation which should remain the same, and either share that among all computers in a cluster or use version control and/or rsync to spread it across the local hard-drives of each cluster node.   The IT Team does not need to be directly involved in this, although they do need to know to inform you if and when the underlying system-wide Perl configuration might change.   (It is possible, although more rare, to create a completely isolated Perl, right down to recompiling the executable itself from source.)

      (It is possible, although more rare, to create a completely isolated Perl, right down to recompiling the executable itself from source.)

      No, it's not "more rare". A custom perl build is even advisable if the system perl and modules aren't under your control.

      See http://perlbrew.pl/