Installeing PerlMagick on Snow Leopard 10.6.4

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
waltz777

Installeing PerlMagick on Snow Leopard 10.6.4

Post by waltz777 »

Hello:

I get the following errors when I run perl Makefile.PL:

Note (probably harmless): No library found for -lMagickCore
Note (probably harmless): No library found for -lperl

When I try to later run make I get the following errors:

Magick.xs:64:31: error: magick/MagickCore.h: No such file or directory
Magick.xs:171: error: expected specifier-qualifier-list before 'MagickRealType'
Magick.xs:192: error: expected specifier-qualifier-list before 'ImageInfo'
Magick.xs:214: error: 'MagickNoiseOptions' undeclared here (not in a function)
Magick.xs:214: warning: missing initializer
Magick.xs:214: warning: (near initialization for 'Methods[2].arguments[0].type')
Magick.xs:215: error: 'MagickChannelOptions' undeclared here (not in a function)
Magick.xs:215: warning: missing initializer
Magick.xs:215: warning: (near initialization for 'Methods[2].arguments[1].type')
Magick.xs:215: warning: missing initializer
Magick.xs:215: warning: (near initialization for 'Methods[2].arguments')
Magick.xs:216: warning: missing initializer
Magick.xs:216: warning: (near initialization for 'Methods[3].arguments')
Magick.xs:220: error: 'MagickComposeOptions' undeclared here (not in a function)
Magick.xs:220: warning: missing initializer
Magick.xs:220: warning: (near initialization for 'Methods[4].arguments[6].type')
Magick.xs:220: warning: missing initializer
Magick.xs:220: warning: (near initialization for 'Methods[4].arguments')
Magick.xs:222: warning: missing initializer
Magick.xs:222: warning: (near initialization for 'Methods[5].arguments[3].type')
Magick.xs:222: warning: missing initializer
Magick.xs:222: warning: (near initialization for 'Methods[5].arguments')


....
....
....


And so forth ...

I think the first errors -lPerl and -lmagickcore are causing the subsequent problems... how do i fix this?

Thanks!
jjn1056

Re: Installeing PerlMagick on Snow Leopard 10.6.4

Post by jjn1056 »

Hi,

What I did was install imagemagick from src into $HOME using the configure prefix option. something like ./configure prefix=$HOME/opt/local I think ,but you can do ./configure --help and get all the configure options.

Once the libs are installing into a user level directory, I downloaded Perlmagick with wget, unpackage the tarball and then I tweaked a few lines in the Makefile.PL to find lib and include from my local source. I also install all my cpan modules with local::lib; in other words I have all my CPAN dependencies installed into my user directory, not into the shared system perl lib area. I try to pretend the Perl OS install doesn't even exist since its typically borked and impossible to use with the standard Perl CPAN toolchain.

I'll try to dig up the Makefile.PL tweak, it's not a lot of changes.

BTW, I didn't use the most recent imagemagick src, I used 5.69, which seemed to match the version number of the PerlMagick on CPAN. Not sure if that is necessary but ti worked for me.

I'm considering making an Alien::ImageMagick package for CPAN to ease all the above. Let me know if you interested in pitching it (even helping with docs and testing would be helpful)

john
c.jones586

Re: Installeing PerlMagick on Snow Leopard 10.6.4

Post by c.jones586 »

I too have had issues installing PerlMagick on 10.6.4 - thought it sensible to follow this thread, even though its not exactly the same problem. I've had no problems installing ImageMagick or ZBar from source.

I made these changes to the Makefile, as suggested;

Code: Select all

my $INC_magick = '-I../ -I.. -I/usr/X11/include/cairo -I/usr/X11/include/pixman-1 -I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12 -I/usr/X11/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"';
my $LIBS_magick = '-L/usr/local/lib -lMagickCore -lperl -lm';
my $LDFLAGS_magick   = "-L/usr/local/lib -lMagickCore $Config{'ldflags'} ";
my $LDDLFLAGS_magick = "-L/usr/local/lib -lMagickCore $Config{'lddlflags'} ";
Makefile.pl does find the MagickCore library - but still returns;

Code: Select all

Note (probably harmless): No library found for -lperl
After a lot of errors and warnings, make terminates with this error;

Code: Select all

lipo: can't open input file: /var/folders/EN/ENoEDFrH2P8yFk+BYmhN5++++TI/-Tmp-//ccqHPWqs.out (No such file or directory)
make: *** [Magick.o] Error 1
A check of the directory structure shown in the error shows that under `..../-Tmp-/` I have;

Code: Select all

PreviewTemp-AYlL72
PreviewTemp-up5mkC
PreviewTemp-wUo1rh
Rtmpq7muzl
All these directories are themselves empty. Does anyone have any clue where this error originates, and how I can fix it?
rispalt

Re: Installeing PerlMagick on Snow Leopard 10.6.4

Post by rispalt »

Hi,
I have similar problem running QNAP 439 pro

I have Imagemagic installed by ipkg:

/share/MD0_DATA/lalu/bin/PerlMagick-6.59] # ipkg list_installed |grep ima
imagemagick - 6.6.4.0-1 - A set of image processing utilities.

But PerlMagic is missing:(

When i install PerlMagic it fails to find the libs in ImageMagick as I understand.

/share/MD0_DATA/lalu/bin/PerlMagick-6.59] # perl Makefile.PL PREFIX=/opt/
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lperl
Writing Makefile for Image::Magick
[/share/MD0_DATA/lalu/bin/PerlMagick-6.59] #
[/share/MD0_DATA/lalu/bin/PerlMagick-6.59] # make
cp Magick.pm blib/lib/Image/Magick.pm
AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick)
/opt/bin/perl /opt/lib/perl5/5.10.0/ExtUtils/xsubpp -typemap /opt/lib/perl5/5.10.0/ExtUtils/typemap Magick.xs > Magick.xsc && mv Magick.xsc Magick.c
i686-unknown-linux-gnu-gcc -c -I../ -I.. -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -I/usr/include/librsvg-2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/libxml2 -I"/usr/include/ImageMagick" -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fopenmp -g -O2 -Wall -W -pthread -O2 -DVERSION=\"6.5.9\" -DXS_VERSION=\"6.5.9\" -fPIC "-I/opt/lib/perl5/5.10.0/i686-linux/CORE" -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs:64:31: error: magick/MagickCore.h: No such file or directory
Magick.xs:171: error: expected specifier-qualifier-list before 'MagickRealType'
Magick.xs:192: error: expected specifier-qualifier-list before 'ImageInfo'



But it does exist:
[/share/MD0_DATA/lalu/bin/PerlMagick-6.59] # ipkg files imagemagick |grep MagickCore.h$
/opt/include/ImageMagick/magick/MagickCore.h
[/share/MD0_DATA/lalu/bin/PerlMagick-6.59] #

I tried to update the Makefile.PL but still failed. Seems like an rather easy problem to get around?
I also tried to install ImageMagick from source but that was hell of a pain with similar problem finding libs.


Seems like an rather easy problem but I have failed:(

Please advice.
Cheers
lalu
jtromans
Posts: 2
Joined: 2011-01-16T04:54:39-07:00
Authentication code: 8675308

Re: Installeing PerlMagick on Snow Leopard 10.6.4

Post by jtromans »

It seems like this is a massive pain in the backside to get Perlmagick working on MAC OS X +

I have tried using Macports to install ImageMagick + perl , which is does so successfully but when I try and actually use Image::Magick it says it "Can't locate Image/Magick.pm in @INC "

I have also tried manually configuring everything similar to those above, and recieve similar errors. I have tried this thread:
http://globalmoxie.com/blog/imagemagick ... -osx.shtml

and I even resorted to this thread too:
http://p5-perlmagick.darwinports.com/

Either Perl cannot find the module, or it won't compile properly, or both. Either way, I'm running MAC OS X Leopard and nothing I do seems to help. Does anyone know how to successfully install ImageMagick specifically with PerlMagick on a Mac ?! A sensible how to would be awesome.
jtromans
Posts: 2
Joined: 2011-01-16T04:54:39-07:00
Authentication code: 8675308

Re: Installeing PerlMagick on Snow Leopard 10.6.4

Post by jtromans »

I found a solution to my problem. For those interested:

http://makevoid.com/posts/2010/6/29/Ins ... h_macports

Do this. For some reason perl still wanted to execute /usr/bin/perl and not /opt/local/bin/perl despite updating my PATH variable in my .profile

So, I took a backup of /usr/bin/perl (sudo cp /usr/bin/perl /usr/bin/perl-backup) and replaced with with a symlink to the macports install of perl
ln -s /opt/local/bin/perl perl

Now its using the newer version of Perl installed via Macports, which seems to find Image::Magick just fine now, so everything works on that front.

Now, I'm stuck with a different problem. Imagemagick doesn't want to play nice with Cron. For example the 'convert' command in my basic script doesn't execute when put in a cron job, but will when the script is executed by hand.
I'm off to post this separate problem to a new thread, but any thoughts are welcome.
Post Reply