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

Hi,

When I install CPAN packages like XML::LibXML on various machines, sometimes I get a tree with the "lib" subdirectory and sometimes - with the "lib64" subdirectory. And I always do all my installations on AMD or Intel 64-bit machines.

My question - how can I control this choice? For example, I want all my trees to have only "lib" directories.

Thanks,
Alex
  • Comment on How does the Perl choose between lib and lib64?

Replies are listed 'Best First'.
Re: How does the Perl choose between lib and lib64?
by Plankton (Vicar) on Nov 09, 2011 at 23:41 UTC
    Have you considered packaging your Perl modules into .rpm files for Redhat or .deb files for Debian?
      No... Will it help?
      Alex
Re: How does the Perl choose between lib and lib64?
by Anonymous Monk on Nov 10, 2011 at 07:56 UTC

      Why do I want to control this choice? Because when I install a Perl module into some central place (let's say with "lib"), then somebody tries to access it from another machine, where the same Perl looks for "lib64" - it's a disaster...

      So I used to write my modulefiles with both "lib" and "lib64", so the PERL5LIB value becomes twice as long as it should be - it doesn't look right

      Thanks
      Alex

        As a workaround, you could make one directory a symlink to the other... (so they're effectively the same)

Re: How does the Perl choose between lib and lib64?
by afoken (Chancellor) on Nov 12, 2011 at 10:59 UTC

    The current Slackware64 13.37 uses a build script that applies a small patch to Configure, and it changes hints/linux.sh. Apparently, those two changes make perl use lib64 instead of plain lib.

    Note that Slackware64 is a pure 64 bit distribution, it has no 32 bit parts, and so the lib64 directories appear to be nonsense. The only reason for their existance is that Slackware64 is prepared for a 32 bit multilib addon. The other commonly known Linux distributions are multilib out of the box.

    I think your OS distribution has more patches applied to perl that cause the lib/lib64 mix. Perhaps it installs pure-perl modules below lib (they could be used by both 32 bit and 64 bit perls) and modules with XS parts below lib64 or lib32, depending on which perl (32 bit or 64 bit) you use.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: How does the Perl choose between lib and lib64?
by ikegami (Patriarch) on Nov 14, 2011 at 19:53 UTC

    When you install the modules, the installers install them into existing library directories hardcoded during the configuration/installation of Perl itself. Neither a lib nor a lib64 directory is created.

    Did you perhaps told the installer to behave differently than by default? If so, please specify how. Posting the Makefile generated by perl Makefile.PL wouldn't hurt.

Re: How does the Perl choose between lib and lib64?
by AlexFromNJ (Novice) on Nov 11, 2011 at 22:24 UTC
    And it's only half of the problem. How can I tell Perl to look for libraries in "lib" subtrees, but not in "lib64" subtrees?

    Thanks,
    Alex