in reply to Cannot compile Image::Magick

Hello gulliver.smith and welcome to the monastery,

The tester matrix is not promising at all..

Also seems you are not the only experiencing problems

The module documentation points to a forum where similar probelms are discussed.

iirc it was always a problematic, but wonderful, module to install..

I assume you followed the steps suggested in the installation output:

# Please check the following prerequisites: # # 1) You need to have installed ImageMagick Windows binaries from # http://www.imagemagick.org/script/binary-releases.php#windows # # 2) We only support dynamic (DLL) ImageMagick binaries # note: it is not possible to mix 32/64-bit binaries of perl and Im +ageMagick # # 3) During installation select that you want to install ImageMagick's # development files (libraries+headers) # # 4) You also need to have ImageMagick's directory in your PATH # note: we are checking the presence of convert.exe and/or identify +.exe tools # # 5) You might need Visual C++ Redistributable Package installed on yo +ur system # see instructions on ImageMagick's Binary Release webpage #

Please note that the first link given is broken and you should browse this one and download the appropriate binary release (selecting the right options)

The Author section of the module has an email address: as last hope..

L*

PS infact, being a strawberry user, last time I checked the module I decided to use GD

PPS as vr suggested below ppm install http://www.sisyphusion.tk/ppm/Image-Magick.ppd works! I confirm it in strawberry 5.26 64 bit on windows10 (even if it cannot remove a temporary folder: cannot remove directory for X:\PATH\perl5.26.64bit\data\.ppm/Image-Magick-9092: Permission denied at X:/PATH/perl5.26.64bit/perl/vendor/lib/PPM.pm line 490.)

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Cannot compile Image::Magick
by marto (Cardinal) on Jan 04, 2019 at 10:59 UTC

    So a lot of those reports suffer from fatal error: magick/MagickCore.h: No such file or directory. A quick work around is to find the file and put it in the correct place:

    marto@Shemp:~/PerlMagick-6.89$ locate magick-baseconfig.h /usr/include/i386-linux-gnu/ImageMagick-6/magick/magick-baseconfig.h marto@Shemp:~/PerlMagick-6.89$ sudo cp /usr/include/i386-linux-gnu/Ima +geMagick-6/magick/magick-baseconfig.h /usr/include/ImageMagick-6/magi +ck/

    Installing Image::Magick now succeeds. If I get time later I'll investigate a better fix.

      I was not sure whether this new version of Magick suffered from the same "problem" I encountered in the past but marto confirmed it. That is, installation of the development package of ImageMagick via package-manager is a prerequisitive. For example, in my system this is ImageMagick-devel.x86_64 Notice the devel

      Once this is done and in an ideal world, the header files (e.g. magick/MagickCore.h) and libraries will be found automatically because the system knows where header files and libraries are likely to be installed and conveys that to Magick's Makefile. But sometimes, they are not found, although they are there. This is fixed by what marto suggested (Re^2: Cannot compile Image::Magick) making a link of the whole dir could be better) or by running make thusly: CFLAGS="${CFLAGS} -I/usr/include/blah/blah" make in dir of extracted Magick distribution.

      If you only want to use cpan[m] to install Magick and avoid CFLAGS and the like, then:

      • 1) install ImageMagick development module via your package manager (this has nothing to do with Perl),
      • 2) try again to install Perl's Magick,
      • 3) if it fails, then locate the headers like marto does and make a symbolic link from their folder to a standard include dir like /usr/include. e.g. ln -s /usr/include/i386-linux-gnu/ImageMagick-6 /usr/include (as root) and try again (2)

      Of course, if this is the case, then it is not a problem but an external dependency missing / not found.

      Edit: you may find that you have problems also with linking, that is the Magick libraries (for example libMagickWand-6.Q16.so) are located somewhere unknown to Magick's Makefile. To solve this you either have to make a soft link to each of these libraries to a standard library path, like /usr/lib or export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/unconventional-location-to-magick-libs"; and then in the same terminal re-try installing Magick. Ouphhh!

        I hope to get round to making a patch for this over the weekend, the current approach is error prone.