-
Notifications
You must be signed in to change notification settings - Fork 184
Description
I'll be closing this issue as soon as opening it, because it's not an issue, per se. It's just to give others something to search for in the issue tracker, and so I have something to link to from our internal documentation.
I've been using Perl for quite a while, but when I cpanm Something::Something and it fails, I'm usually as mystified as anyone. So I'm also hoping this can help someone else who's in the same situation.
Steps required to get Bio::Graphics installed on Rocky Linux 9
These steps will probably work with other RHEL 9-like distros, and other related Bio::Whatever packages, too.
Note
Debian and Ubuntu already include bioperl in their default repositories, so if you're using one of those, or a derivative, installing that package from the distro repositories will save a lot of time.
Install Perl and other required development packages, to preclude build failures in the cpanm command below:
yum update
yum install perl gd-devel libxml2-devel expat-devel perl-App-cpanminusNote
The installation of cpanminus (cpanm) from the distro repositories is actually not required, but it's helpful because it isn't obvious from cpan's output that some modules failed to build.
It's hard to even tell that cpan failed, except if you scroll up, or inspect the return code.
Next, install Bio::Graphics and look for any failed builds:
cpanm Bio::GraphicsNote
If you run cpanm as root (e.g., in a Docker container), the above actually breaks cpanm! This is why you don't normally do this stuff as root.
Since I'm installing this in a Docker container for testing, I'll just power through it by installing a necessary package from the distro repositories, so we're able to proceed:
yum install -y perl-LWP-Protocol-httpsSorting through the build logs for cpanm Bio::Graphics from above, you'll find mention that Bio::DB::SeqFeature::Store wasn't installed1, so install that manually:
cpanm Bio::DB::SeqFeature::Store
# finally, try again
cpanm Bio::Graphics
Test to make sure the desired package actually got installed:
# perl -MBio::Graphics -e'print $INC{"Bio/Graphics.pm"} . "\n"'
/usr/local/share/perl5/5.32/Bio/Graphics.pmNotes
- There are probably at least a handful more distro packages you could install to speed up the process relative to getting them from CPAN and running all the tests (DBI, Test::*, Capture::Tiny, XML::LibXML). The ones I chose from the distro repositories had extra dev dependencies which I wanted to avoid installing.
References
- Fix test suite with libxml2 2.13.0 shlomif/perl-XML-LibXML#87 - the patch here can be used to patch XML::LibXML to pass all its tests when using the distro-supplied libxml or libxml2, if not using a distro-supplied package and not skipping tests
- https://stackoverflow.com/a/78965715 - included the helpful suggestion of installing the distro's libxml library plus development headers preemptively
Footnotes
-
…even though it seems like cpanm should've been able to figure this out that this was a dependency on its own ¯\_(ツ)_/¯ ↩