Monday, May 9, 2011

Ubuntu 11.04 and perlbrew


I tried to install today a new perl 5.12.3 using perlbrew on a new Ubuntu 11.04 virtual machine. To my surprise, it failed with a lot of compiler errors. Luckily, I found a blog post about it by Kim Jin. The problem turned out to be that perl's configuration script was not able to properly detect the new system libraries location to compile Perl (i.e. libc.so, libm.so, ...etc).

In previous Ubuntu versions, the default system libraries were under the /usr/lib directory. In version 11.04, this location is now architecture dependent /usr/lib/{architecture-name}. So on 64-bit x86 systems, it is /usr/lib/x86_64-linux-gnu and on 32-bit x86 systems, it is /usr/lib/i386-linux-gnu.

So if you need to install a threaded perl on Ubuntu 11.04 32-bit via perlbrew:
perlbrew install perl-5.12.3 -Dusethreads -Dplibpth=/usr/lib/i386-linux-gnu

And on 64-bit systems:
perlbrew install perl-5.12.3 -Dusethreads -Dplibpth=/usr/lib/x86_64-linux-gnu

Hopefully this will be fixed in perl 5.14.
Update (Steffen Müller): This has already been fixed in Perl 5.14.0 release candidate 1.
Update (Dave Rolsky): Perlbrew will automatically apply relevant patches if you install the latest Devel::PatchPerl (0.32) as part of its build process.

5 comments:

tsee said...

Indeed, this was a last minute addition to perl 5.14, so 5.14 will build just fine when it is released REAL SOON NOW.

Ahmad M. Zawawi said...

@tsee

Great! Thanks for the update. Any idea in which 5.14 release this was added?

Ahmad M. Zawawi said...

@tsee

Great. It is fixed in perl 5.14.0 RC1. Thanks for the update.

Dave Rolsky said...

If you install the latest Devel::PatchPerl (0.32), it includes a patch for this issue. Perlbrew automatically applies relevant patches as part of its build process.

Ahmad M. Zawawi said...

@{Dave Rolsky}

Thanks. I updated my blog post with your valuable information.