PerlMagick make on Fedora 9

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

PerlMagick make on Fedora 9

Post by Craig-IM »

Hello All,

I have tried installing PerlMagick and I get warnings but make test seems okay. After it's installed
use Image::Magick;
can not be used in a perl program.

I included the output from perl Makefile.PL, make, make test, make install and demo make. What am I missing?

Thanks in advance,
Craig


[root@ns2 ImageMagick-6.4.2]# cd PerlMagick

[root@ns2 PerlMagick]# perl Makefile.PL
Warning: -L../magick/.libs changed to
-L/usr/local/ImageMagick-6.4.2/PerlMagick/../magick/.libs
Warning: -L../wand/.libs changed to
-L/usr/local/ImageMagick-6.4.2/PerlMagick/../wand/.libs
Writing Makefile for Image::Magick
[root@ns2 PerlMagick]# make
gcc -c -I../ -I.. -I/usr/include/freetype2 -I/usr/include/libxml2
-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/include/gdbm -fopenmp -g -O2 -Wall -W -pthread -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -DPERL_USE_SAFE_PUTENV -DVERSION=\"6.4.2
\" -DXS_VERSION=\"6.4.2\" -fPIC
"-I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE"
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
Magick.xs:212: warning: missing initializer
Magick.xs:212: warning: (near initialization for Methods[8].arguments)
Magick.xs:216: warning: missing initializer
Magick.xs:216: warning: (near initialization for
Methods[11].arguments)
Magick.xs:217: warning: missing initializer
Magick.xs:217: warning: (near initialization for
Methods[12].arguments)
Magick.xs:218: warning: missing initializer
Magick.xs:218: warning: (near initialization for
Methods[13].arguments)
Magick.xs:225: warning: missing initializer
Magick.xs:225: warning: (near initialization for
Methods[16].arguments)
Magick.xs:227: warning: missing initializer
Magick.xs:227: warning: (near initialization for
Methods[18].arguments)
Magick.xs:316: warning: missing initializer
Magick.xs:316: warning: (near initialization for
Methods[45].arguments)
Magick.xs:332: warning: missing initializer
Magick.xs:332: warning: (near initialization for
Methods[50].arguments)
Magick.xs:335: warning: missing initializer
Magick.xs:335: warning: (near initialization for
Methods[52].arguments)
Magick.xs:351: warning: missing initializer
Magick.xs:351: warning: (near initialization for
Methods[61].arguments)
Magick.xs:354: warning: missing initializer
Magick.xs:354: warning: (near initialization for
Methods[64].arguments)
Magick.xs:397: warning: missing initializer
Magick.xs:397: warning: (near initialization for
Methods[83].arguments)
Magick.xs:424: warning: missing initializer
Magick.xs:424: warning: (near initialization for
Methods[95].arguments)
Magick.xs:425: warning: missing initializer
Magick.xs:425: warning: (near initialization for
Methods[96].arguments)
Magick.xs:429: warning: missing initializer
Magick.xs:429: warning: (near initialization for
Methods[98].arguments)
Magick.xs:430: warning: missing initializer
Magick.xs:430: warning: (near initialization for
Methods[99].arguments)
Magick.xs:431: warning: missing initializer
Magick.xs:431: warning: (near initialization for
Methods[100].arguments)
Magick.xs:438: warning: missing initializer
Magick.xs:438: warning: (near initialization for
Methods[103].arguments)
Magick.xs: In function constant:
Magick.xs:556: warning: unused parameter sans
Magick.c: In function XS_Image__Magick_AcquireImagePixels:
Magick.c:2322: warning: unused variable ref
Magick.c:2317: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Animate:
Magick.c:2478: warning: unused variable ref
Magick.c:2471: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Append:
Magick.c:2559: warning: unused variable ref
Magick.c:2552: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Average:
Magick.c:2697: warning: unused variable ref
Magick.c:2690: warning: unused variable ix
Magick.c: In function XS_Image__Magick_BlobToImage:
Magick.c:2795: warning: unused variable ref
Magick.c:2788: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Copy:
Magick.c:2951: warning: unused variable ref
Magick.c:2944: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Coalesce:
Magick.c:3043: warning: unused variable ref
Magick.c:3036: warning: unused variable ix
Magick.c: In function XS_Image__Magick_CompareLayers:
Magick.c:3133: warning: unused variable ref
Magick.c:3126: warning: unused variable ix
Magick.xs: In function XS_Image__Magick_DESTROY:
Magick.xs:3250: warning: value computed is not used
Magick.c:3268: warning: unused variable ref
Magick.c: In function XS_Image__Magick_Display:
Magick.c:3358: warning: unused variable ref
Magick.c:3351: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Flatten:
Magick.c:3439: warning: unused variable ref
Magick.c:3432: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Fx:
Magick.c:3576: warning: unused variable ref
Magick.c:3569: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Get:
Magick.c:3735: warning: unused variable ref
Magick.c:3728: warning: unused variable ix
Magick.c: In function XS_Image__Magick_GetImagePixels:
Magick.c:4979: warning: unused variable ref
Magick.c:4974: warning: unused variable ix
Magick.c: In function XS_Image__Magick_GetIndexes:
Magick.c:5133: warning: unused variable ref
Magick.c:5128: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Histogram:
Magick.c:5206: warning: unused variable ref
Magick.c:5199: warning: unused variable ix
Magick.c: In function XS_Image__Magick_GetPixel:
Magick.c:5328: warning: unused variable ref
Magick.c:5321: warning: unused variable ix
Magick.c: In function XS_Image__Magick_GetPixels:
Magick.c:5535: warning: unused variable ref
Magick.c:5528: warning: unused variable ix
Magick.c: In function XS_Image__Magick_ImageToBlob:
Magick.c:5783: warning: unused variable ref
Magick.c:5776: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Layers:
Magick.c:5888: warning: unused variable ref
Magick.c:5881: warning: unused variable ix
Magick.c: In function XS_Image__Magick_MagickToMime:
Magick.c:6206: warning: unused variable ref
Magick.c:6201: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Mogrify:
Magick.c:6241: warning: unused variable ref
Magick.c: In function XS_Image__Magick_Montage:
Magick.c:9188: warning: unused variable ref
Magick.c:9181: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Morph:
Magick.c:9598: warning: unused variable ref
Magick.c:9591: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Mosaic:
Magick.c:9729: warning: unused variable ref
Magick.c:9722: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Ping:
Magick.c:9819: warning: unused variable ref
Magick.c:9812: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Preview:
Magick.c:10031: warning: unused variable ref
Magick.c:10024: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryColor:
Magick.c:10131: warning: unused variable ref
Magick.c:10124: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryColorname:
Magick.c:10214: warning: unused variable ref
Magick.c:10207: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryFont:
Magick.c:10291: warning: unused variable ref
Magick.c:10284: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryFontMetrics:
Magick.c:10413: warning: unused variable ref
Magick.c:10406: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryMultilineFontMetrics:
Magick.c:10789: warning: unused variable ref
Magick.c:10782: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryFormat:
Magick.c:11165: warning: unused variable ref
Magick.c:11158: warning: unused variable ix
Magick.c: In function XS_Image__Magick_QueryOption:
Magick.c:11260: warning: unused variable ref
Magick.xs:11378: warning: label PerlException defined but not used
Magick.c:11253: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Read:
Magick.c:11324: warning: unused variable ref
Magick.c:11317: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Remote:
Magick.c:11536: warning: unused variable ref
Magick.c:11529: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Set:
Magick.c:11590: warning: unused variable ref
Magick.c:11583: warning: unused variable ix
Magick.c: In function XS_Image__Magick_SetPixel:
Magick.c:11655: warning: unused variable ref
Magick.c:11648: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Statistics:
Magick.c:11899: warning: unused variable ref
Magick.c:11892: warning: unused variable ix
Magick.c: In function XS_Image__Magick_SyncImagePixels:
Magick.c:12076: warning: unused variable ref
Magick.c:12071: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Transform:
Magick.c:12145: warning: unused variable ref
Magick.c:12138: warning: unused variable ix
Magick.c: In function XS_Image__Magick_Write:
Magick.c:12313: warning: unused variable ref
Magick.c:12306: warning: unused variable ix
Running Mkbootstrap for Image::Magick ()
chmod 644 Magick.bs
rm -f blib/arch/auto/Image/Magick/Magick.so
gcc -L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -shared
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -DPERL_USE_SAFE_PUTENV
-L/usr/local/lib -lfreetype Magick.o -o
blib/arch/auto/Image/Magick/Magick.so \
-L/usr/local/lib
-L/usr/local/ImageMagick-6.4.2/PerlMagick/../magick/.libs -lMagickCore
-L/usr/local/ImageMagick-6.4.2/PerlMagick/../wand/.libs -lMagickWand \

chmod 755 blib/arch/auto/Image/Magick/Magick.so
cp Magick.bs blib/arch/auto/Image/Magick/Magick.bs
chmod 644 blib/arch/auto/Image/Magick/Magick.bs
Manifying blib/man3/Image::Magick.3pm

[root@ns2 PerlMagick]# make test
/bin/sh ../magick.sh PERL_DL_NONLAZY=1 /usr/bin/perl
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib',
'blib/arch')" t/*.t t/bzlib/*.t t/jpeg/*.t t/png/*.t t/tiff/*.t
t/x11/*.t t/zlib/*.t
t/blob............ok
t/bzlib/read......ok
t/bzlib/write.....ok
t/composite.......ok
t/filter..........ok
t/getattribute....ok
t/jpeg/read.......ok
t/jpeg/write......ok
t/montage.........ok
t/png/read-16.....ok
t/png/read........ok
t/png/write-16....ok
t/png/write.......ok
t/read............ok
t/setattribute....ok
t/tiff/read.......ok
t/tiff/write......ok
t/write...........ok
t/x11/read........ok
t/x11/write.......ok
t/zlib/read.......ok
t/zlib/write......ok
All tests successful.
Files=22, Tests=331, 80 wallclock secs (44.73 cusr 7.38 csys = 52.11
CPU)
[root@ns2 PerlMagick]#

[root@ns2 PerlMagick]# make install
Files found in blib/arch: installing files in blib/lib into architecture
dependent library tree
Writing /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Image/Magick/.packlist
Appending installation info
to /usr/lib/perl5/5.10.0/i386-linux-thread-multi/perllocal.pod

[root@ns2 PerlMagick]# cd demo

[root@ns2 demo]# make
perl demo.pl
Can't load
'/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for
module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory
at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/DynaLoader.pm line 203.
at demo.pl line 5
Compilation failed in require at demo.pl line 5.
BEGIN failed--compilation aborted at demo.pl line 5.
^Cmake: *** [all] Interrupt

[root@ns2 demo]#
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick make on Fedora 9

Post by magick »

Where is libMagickCore located? If its in /usr/local/lib you probably need to add that path to your ldconfig path.
Craig-IM

Re: PerlMagick make on Fedora 9

Post by Craig-IM »

Hello Magick,

Thanks for the reply. After reading some posts on this server, I went ahead and changed the ldconfig settings. I believe that I set ldconfig correctly, but it does not work.
Here is how it is set up:

[root@ns2 etc]# locate libMagickCore
(removed unnecessary lines)
/usr/local/lib/libMagickCore.a
/usr/local/lib/libMagickCore.la
/usr/local/lib/libMagickCore.so
/usr/local/lib/libMagickCore.so.1
/usr/local/lib/libMagickCore.so.1.0.0

[root@ns2 etc]# more ld.so.conf
include ld.so.conf.d/*.conf

[root@ns2 etc]# cd ld.so.conf.d

[root@ns2 ld.so.conf.d]# ls
mysql-i386.conf PerlMagick.conf qt-i386.conf xulrunner-32.conf

[root@ns2 ld.so.conf.d]# more PerlMagick.conf
/usr/lib
/usr/local/lib
[root@ns2 ld.so.conf.d]#

I created the PerlMagick.conf file that has two locations. I don't know if that is okay or not. I'll get rid of the /usr/lib and then configure ImageMagick, make, make install and see if that makes any difference.

Thanks for your help,
Craig
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick make on Fedora 9

Post by magick »

Did you actually issue the 'ldconfig' command to update the paths after you modified the configure files? Try
  • ldd Magick.so
and it will tell you whether it finds MagickCore.so or not.
Craig-IM

Re: PerlMagick make on Fedora 9

Post by Craig-IM »

Hello Magick,

That was it, I never issued the ldconfig command.

It now "Works like magick!".

Thanks for your help,
Craig
silentone

Re: PerlMagick make on Fedora 9

Post by silentone »

Hi there,
I am having the same/great difficulty too, i cannot find the ldconfig file, and when i ran the command mentioned above, it did not work also!
the error i get is:---


[root@localhost demo]# make
perl demo.pl
Can't load '/usr/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/DynaLoader.pm line 203.
at demo.pl line 5
Compilation failed in require at demo.pl line 5.
BEGIN failed--compilation aborted at demo.pl line 5.
Out of memory!
Callback called exit at /usr/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/Image/Magick.pm line 42.
END failed--call queue aborted at demo.pl line 5.
make: *** [all] Error 12




thanks
Andrew

www.arobcorp.com
Last edited by silentone on 2008-10-29T23:58:29-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick make on Fedora 9

Post by magick »

ldconfig is a command, not a file. By default, ImageMagick builds as a dynamic library. You need to determine how to notify your system to add the installed location of the MagickCore library to your dynamic library path. Under linux, for example, you can add /usr/local/lib to your ld.so.conf system file. On some systems you can set the LD_LIBRARY_PATH environment variable.
silentone

Re: PerlMagick make on Fedora 9

Post by silentone »

I am going to re-install fedora core 9, so, when i do this, i have found in the past that perlmagick fails to install, thus, i have found it better to try to install a downloaded version. so, where, and how do install imagemagick/perlmagick???

www.arobcorp.com
Last edited by silentone on 2008-10-29T23:58:12-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PerlMagick make on Fedora 9

Post by magick »

To adapt ImageMagick to your environment, be sure to first install any delegate libraries you are interested such as JPEG or PNG. Make sure you also install the development RPMs so that the respective header files are available (e.g. jpeg.h). Now download the ImageMagick source from ftp://ftp.imagemagick.org/pub/ImageMagick and build:
  • tar xvfz ImageMagick-6.4.4-2.tar.gz
    cd ImageMagick-6.4.4
    ./configure
    make
    make install
PerlMagick is built and installed along with MagickCore, MagickWand, and Magick++.
silentone

Re: PerlMagick make on Fedora 9

Post by silentone »

I tried unpacking, and still got the same problem, I am using Fedora Core 9.
any other suggestions?

www.arobcorp.com
Last edited by silentone on 2008-10-29T23:58:00-07:00, edited 1 time in total.
silentone

Re: PerlMagick make on Fedora 9

Post by silentone »

hello there,
i installed Fedora core 9 again, and installed imagemagick 6.4.5, no problems, installed perlmagick, no problems, ran the test(results below), tried to run the demo script, got errors(below) the .Magick.so file is in the correct place(although i cannot locate the "dynaloader" file, isn't it a system file?), so cannot understand why it cannot load it!!!???
(it might be because the imagemagick librarys aren't working properly, how do i check this?)



All tests successful.
Files=22, Tests=331, 14 wallclock secs ( 5.65 cusr + 0.48 csys = 6.13 CPU)
[root@localhost PerlMagick]# cd demo
[root@localhost demo]# make
perl demo.pl
Can't load '/usr/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/DynaLoader.pm line 203.
at demo.pl line 5
Compilation failed in require at demo.pl line 5.
BEGIN failed--compilation aborted at demo.pl line 5.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted at demo.pl line 5.
make: *** [all] Error 2
[root@localhost demo]#


I also get the errors below ##############################


Can't load '/usr/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/DynaLoader.pm line 203.
at ./PerlMagicktest.pl line 6
Compilation failed in require at ./PerlMagicktest.pl line 6.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted at ./PerlMagicktest.pl line 8.


www.arobcorp.com
silentone

Re: PerlMagick make on Fedora 9

Post by silentone »

I created a file PerlMagick.conf in /etc/ld.so.conf.d and put /usr/lib and /usr/local/lib in the file then ran ldconfig, and it works!
(as in a post previously, this thread should be stickied!)
Post Reply