gulliver.smith has asked for the wisdom of the Perl Monks concerning the following question:
Imagemagick seems to have changed its directory structure, include file names, and internal APIs in moving from 6.9 to 7.x.x.
Strawberry Perl on Windows 10 is not compiling. I hacked Magick.xs and Makefile.PL but still get a large number of compile errors.
Is there a solution or a maintainer for Image::ImageMagick?
Thanks
Gulliver
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cannot compile Image::Magick
by Discipulus (Canon) on Jan 03, 2019 at 20:40 UTC | |
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 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. | [reply] [d/l] [select] |
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:
Installing Image::Magick now succeeds. If I get time later I'll investigate a better fix. | [reply] [d/l] [select] |
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: 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! | [reply] [d/l] [select] |
by marto (Cardinal) on Jan 04, 2019 at 11:28 UTC | |
|
Re: Cannot compile Image::Magick
by vr (Curate) on Jan 04, 2019 at 12:39 UTC | |
W.r.t. Windows 10 & Strawberry Perl, I just checked: the latest IM comes with pre-compiled PerlMagick and PPD file to install it. You have to mark checkbox in installer GUI for these files to be unpacked. Unfortunately, it was compiled for 5.20, but if your project runs OK with this Perl version, then you get "latest official 7.0.8-23" IM, and the demo.pl runs all tests flawlessly. Unfortunately, there was a glitch while unpacking and installing with PPM command ((*) - see below), so I had to extract and copy 3 files (*.pm, *.xs.dll, *.ix) manually. Alternatively, if fresher than 5.20 Perl is required (I tested with 5.26, don't have 5.28 installed here), you may have luck running ppm install http://www.sisyphusion.tk/ppm/Image-Magick.ppdto install a little bit older (6.89) PerlMagick, but, sadly, I had to comment-out, IIRC, "RadialBlur" call in demo.pl, and yet JPG file failed to save -- though PNG was written OK. Other things may also be broken. BTW, same as Discipulus, I tend to avoid PerlMagick because of its state of sad eternal neglect -- either run external IM commands or prefer Imager and/or PDL::IO::Image for "pure Perl" image manipulation. ------ (*) I don't know what PPM comes with Strawberry Perl, they say it's ... 320. PPM 11.11_03 ... can't find it on CPAN, but, anyway, it seems to be broken:
starting from line 384. But then the $1 is undefined because matching is localized to scope, isn't it? How it was supposed to work... | [reply] [d/l] [select] |