>> image.c: In function ‘imagemagick_load_image’:
>> image.c:7786: warning: implicit declaration of function ‘MagickMergeImageLayers’
>> image.c:7786: error: ‘MergeLayer’ undeclared (first use in this function)
> I would suspect that the above functions are not declared in the version
> of ImageMagick shipping with RHEL5. I don't have a RHEL5 handy for
> testing at the moment.
Indeed, this was the problem. Older ImageMagick versions should use
MagickFlattenImages. Fixed in trunk.