in reply to Re: Cannot compile Image::Magick
in thread Cannot compile Image::Magick

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.

Replies are listed 'Best First'.
Re^3: Cannot compile Image::Magick
by bliako (Abbot) on Jan 04, 2019 at 11:22 UTC

    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.