[Bioperl-l] BioPerl, CPAN Modules, and Linux Packages

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Mon Feb 22 12:32:31 UTC 2010


Dave Clements wrote:
>> One question that came up at last month's GMOD meeting was "What are the
>> best practices for mixing and matching CPAN modules and Linux packages?"

I think there are a number of issues that may resolve differently for
different people, or even for the same person on different machines. So
there may be different best practices in different cases. For example:

- a developer setting up a personal machine or a test machine
- an admin setting up a server for use by a group of bioperl users
- a dedicated webhost
- a shared webhost

So I think it may be useful to set out the background before diving into
specific recommendations of techniques for people to use.

There are several options when installing packages:

- many packages are available from the distro packaging repositories
- almost all packages are available from CPAN
- CPAN, or other, packages can be converted to use the distro packaging
system (deb or rpm)
- packages can be installed system-wide by root
- packages can be installed privately by any user, using cpan or local::lib

There are a few main technical issues that affect how to set up machines:

- If packages are installed by root, they affect all users (unless a
user actively overrides the packages). If they're installed by a user,
they affect just that user.
- Some system applications are written in Perl and depend on finding the
version of the packages that they were built with (i.e. from the distro
package repositories).
- Some packages change frequently and tend to depend on recent versions
of other packages. More recent versions than are found in the distro
repositories may be necessary either to obtain specific new
functionality or critical bug fixes. Specific releases, neither the
newest nor that supplied by the distro, may be required in a few awkward
cases.

There's a useful feature of Perl that is exploited by distros to provide
some flexibility in this regard - the @INC path array. I'm most familiar
with openSUSE so I'll use that as an example. I expect that other
distros have similar mechanisms. So the default environment for a normal
user looks something like:

@INC:
    /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi
    /usr/lib/perl5/5.8.8
    /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi
    /usr/lib/perl5/site_perl/5.8.8
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi
    /usr/lib/perl5/vendor_perl/5.8.8
    /usr/lib/perl5/vendor_perl

Packages in directories at the top are preferred to those at the bottom.
Core perl packages go in the /usr/lib/perl5/5.8.8 directories. When
extra packages are installed from the openSUSE repositories, they are
placed in the vendor_perl directories. Packages installed from CPAN are
installed into the site_perl directories.

So a normal user will see packages installed from CPAN in preference to
those installed from the system repositories.

Applications installed from the system repositories are built without
the site_perl directories so they link to the compatible system
libraries regardless of whether newer CPAN versions have been installed
for other applications. This keeps the system stable.

Cheers, Dave

PS feel free to extract any of this if it's useful.



More information about the Bioperl-l mailing list