Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Error trying to install Image::Magick on Strawberry Perl

by jdporter (Chancellor)
on Aug 06, 2012 at 02:45 UTC ( [id://985591]=perlquestion: print w/replies, xml ) Need Help??

jdporter has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to install Image::Magick on Strawberry Perl, and getting an error.

% path PATH=C:\Program Files\ImageMagick-6.7.8-Q16;c:\strawberry\c\bin;C:\str +awberry\perl\bin; . . .
% perl -v This is perl 5, version 16, subversion 0 (v5.16.0) built for MSWin32-x +64-multi-thread
% convert -version Version: ImageMagick 6.7.8-7 2012-07-29 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenMP

So here we go:

% cpan install Image::Magick . . . Note (probably harmless): No library found for -lMagickCore Writing Makefile for Image::Magick Writing MYMETA.yml and MYMETA.json CPAN: Module::CoreList loaded ok (v2.66) cp Magick.pm blib\lib\Image\Magick.pm AutoSplitting blib\lib\Image\Magick.pm (blib\lib\auto\Image\Magick) C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp + -typemap C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap +Magick.xs > Magick.xsc && C:\strawberry\perl\bin\perl.exe -ME xtUtils::Command -e mv -- Magick.xsc Magick.c gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE +_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-alia +sing -mms-bitfields -s -O2 -DVERSION=\"6.77\" -DXS_VER SION=\"6.77\" "-IC:\strawberry\perl\lib\CORE" -D_LARGE_FILES=1 -DHAV +E_CONFIG_H Magick.c Magick.xs:60:31: fatal error: magick/MagickCore.h: No such file or dir +ectory compilation terminated. dmake.exe: Error code 129, while making 'Magick.o' JCRISTY/PerlMagick-6.77.tar.gz C:\strawberry\c\bin\dmake.exe -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Stopping: 'install' failed for 'Image::Magick'.
% dir /s /b "c:\Program Files\ImageMagick-6.7.8-Q16\MagickCore.h" c:\Program Files\ImageMagick-6.7.8-Q16\include\magick\MagickCore.h

So my first thought is, How do I pass the hint to gcc about where to find MagickCore.h?
But I suspect there's something more fundamentally wrong with my setup.

In case it helps:

% gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/strawberry/c/bin/../libexec/gcc/x86_64-w64-ming +w32/4.6.3/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-4.6.3/configure --build=x86_64-w64-m +ingw32 --target=x86_64-w64-mingw32 --enable-languages=c,c++,fortran,o +bjc,obj-c++ --enable-libgomp --enable-lto --enable-bootstrap --enable-checking=release --enable-version-specific-runtime-libs --dis +able-multilib --disable-nls --disable-win32-registry --disable-werror + --with-pkgversion='gcc-4.6.3 release with patches [build 201 20411 by perlmingw.sf.net]' --with-sysroot=/gccbuild/prefix/mingw64 -- +with-gmp=/gccbuild/prefix/mingw64 --with-mpfr=/gccbuild/prefix/mingw6 +4 --with-mpc=/gccbuild/prefix/mingw64 --with-ppl=/gccbuild/pr efix/mingw64 --with-cloog=/gccbuild/prefix/mingw64 --with-bugurl=http: +//mingwfp.znix.com --with-gnu-ld --prefix=/gccbuild/prefix/mingw64 -- +with-local-prefix=/gccbuild/prefix/mingw64 --with-libiconv-pr efix=/gccbuild/prefix/mingw64 Thread model: win32 gcc version 4.6.3 (gcc-4.6.3 release with patches [build 20120411 by p +erlmingw.sf.net])
I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Replies are listed 'Best First'.
Re: Error trying to install Image::Magick on Strawberry Perl
by Anonymous Monk on Aug 06, 2012 at 03:08 UTC

    How do I pass the hint to gcc about where to find MagickCore.h?

    Add to %PATH% so the .dll's can be found

    cpanp -z Image::Magick

    perl Makefile.PL LIBS="-Lpath\to\directory -llibname -libname... " INC="-Ipath/to/includes -Ipath/to/other/includes"

    If your Makefile.PL is being too clever, you should edit Makefile.PL and prefix :nosearch

    For microsoft you could set (like PATH) env vars INCLUDE= for .h-headers and LIB= for .lib's -- I can't remember if mingw/gcc also respects this, so if it doesn't, you'd set C_INCLUDE_PATH/LIBRARY_PATH, see http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

      Recent versions of Makefile.PL automatically locate the ImageMagick installation using IM's "identify" command. That will only work if IM is in your path (which is an installation option). Check like this:
      C:\>path PATH=C:\Program Files\ImageMagick;C:\bin;...
      You will also need to replace "-lMagickCore-6.Q16" with "-lMagickCore" in Makefile.PL and comment out the RadialBlur case in Magick.xs, as described in http://www.imagemagick.org/discourse-server/viewtopic.php?f=7&t=25746&p=113771#p113771.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://985591]
Approved by marto
Front-paged by bulk88
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-03-19 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found