5

I would like to be able to install multiple versions of Perl but I need to have them by architecture as well.

I know that I can use perlbrew to get installs by version: 5.10.1, 5.12.3, 5.16.0, etc. I couldn't find a way to also have installs by architecture, Solaris-sparc, Solaris-x86, Linux-i686, Linux-x86_64, etc.

Doing a hand install I can do this

It's no big deal doing hand installs but perlbrew makes some things easier regarding management and such.

EDIT: As brought out the in comments I am using a common home directory NFS mounted across various platforms.

Community
  • 1
  • 1
  • What are you trying to do? Install the solaris-sparc version on linux-x86_64? How would that help you? – matthias krull Jul 25 '12 at 13:41
  • I have a common home dir mounted via NFS. When I login to a Solaris host I get `perl: Cannot find /lib64/ld-linux-x86-64.so.2`. As hobbs suggested I can use `--as` to create a name for that and have my shell config switch to the proper Perl when I ssh into a host. – gizmo mathboy Jul 25 '12 at 13:58

1 Answers1

4

You can use the --as option to perlbrew install to give an install a different name (to avoid clashes with the same version), and you can pass any Configure -D, -U, or -A options to perlbrew and it will pass them through. But I also fail to see how a perl for a different arch is useful in the context of perlbrew.

Here is an example of installing 32bit perl on an actual 64bit machine using perlbrew:

perlbrew install perl-5.8.8 --as perl-5.8.8-i386-linux-thread-multi -Dcc='cc -m32' -Dplibpth='/lib64 /usr/lib64 /usr/lib/ /usr/lib/x86_64-linux-gnu/' -Darchname=i386-linux-thread-multi -Dusethreads

Flags passed to Configure through -D will vary based on environment and specific needs.

akhan
  • 2,952
  • 2
  • 22
  • 13
hobbs
  • 223,387
  • 19
  • 210
  • 288
  • My main machine is Linux x86_64 bit. However, I also work with Solaris hosts. When I ssh into them I get: `perl: Cannot find /lib64/ld-linux-x86-64.so.2`. As near as I can tell that is because my default Perl install was compiled on Linux. Thanks for the info, I'll give it a spin. – gizmo mathboy Jul 25 '12 at 13:52
  • Install the Solaris-Version from Solaris and the Linux-Version from Linux. This will likely be less painful than cross compiling. And you will have to make sure to switch to the version of perl your platform supports. – matthias krull Jul 25 '12 at 14:29
  • One more thing: modules will not be shared on different platforms as the different versions use different lib directories. Pure Perl modules may be sharable but anything that need compilings (XS, Swig, Inline::C*) will not work across platforms. – matthias krull Jul 25 '12 at 14:33
  • @mugen since the modules will be installed inside of the perlbrews, that's not a problem. I think I see what's happening here now (shared home directory), and it will probably work fine as long as you only try to 'perlbrew use' perls from the appropriate arch on each machine :) – hobbs Jul 25 '12 at 19:55
  • I know. I just wanted to point that out to prevent clever workarounds that lead to another question :) – matthias krull Jul 26 '12 at 08:24