Welcome to End Point’s blog

Ongoing observations by End Point people

Building ImageMagick on RHEL/CentOS 6 with Perl 5.18.1

This is a quick tip for anyone in the exact same situation I was recently, and everyone else can probably just skip it!

RHEL 6 and CentOS 6 and other derivatives come with ImageMagick-, which is a bit dated but still reasonable. They also come with Perl 5.10.1, which has grown very old. We wanted to use the latest version of Perl (5.18.1) with plenv, but the latest version of the Perl libraries for ImageMagick (PerlMagick) does not work with the older ImageMagick

The first task, then, was to locate the matching older version of PerlMagick from BackPAN, the archive of historical CPAN modules:, and try to build that.

However, that fails to build without applying a patch to make it compatible with newer versions of Perl. The patch is available from, or you can just create a file called typemap in the root of the unpacked directory, with one line:

Image::Magick T_PTROBJ

Then build, test, and install as usual. That's it.


targ said...

The perl interface for ImageMagick sucks because the maintainer completely ignores any bugreport on RT and fails to account for the fact that other package managers install to different prefixes. Very few people can install from cpan without manual intervention.

Dmitry Karasik said...

After numerous attempts and cursing, I found the only way to install PerlMagick properly is to match its and Imagemagick versions exactly, which excludes CPAN interface. When I need it installed I download the source from, and compile it from there. I believe the current state of affairs is that PerlImagick is found on CPAN is misleading at best. I wish Makefile.PL would've provided a courtesy and failed gracefully if versions don't match.

Jon Jensen said...

Yes, PerlMagick must be matched exactly to the ImageMagick version, so installing with the cpan/cpanm clients usually won't work. I linked the BackPAN in the article, which is where you can find the correct older matching PerlMagick version.