Page 1 of 1

custom include and library paths when building PerlMagick?

Posted: 2011-03-02T16:35:22-07:00
by qwerty
I am building Image Magick into a custom directory (with configure --prefix=...), and I also want to build Perl Magick.

With PerlMagick-6.59, I could use the following recipe:

tar zxf PerlMagick-6.59.tar.gz
cd PerlMagick-6.59
export IM_INC="-I$IM_HOME/include/ImageMagick "
export IM_LIB="-L$IM_HOME/lib "
perl Makefile.PL
make
make install

In this case $IM_HOME is where I have installed ImageMagick.

The above recipe doesn't seem to work for PerlMagick-6.67. I get the error:

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

and the make fails with:

Magick.xs:64:31: error: magick/MagickCore.h: No such file or directory

Is there a way I can specify the Image Magick include path and library path on the 'perl Makefile.PL' command?

Re: custom include and library paths when building PerlMagic

Posted: 2011-03-02T20:10:16-07:00
by anthony
Generally to install a custom ImageMagick you also install the Custom PerlMagick at the same time.
It is very important that the two versions match.

The simplist way is to just configure both using

Code: Select all

configure --prefix=$MAGICK_HOME --disable-installed
Then both will be installed into the location of MAGIC_HOME.

Re: custom include and library paths when building PerlMagic

Posted: 2011-03-03T16:23:02-07:00
by qwerty
My apologies... PerlMagick-6.59 does not support the environment variables IM_LIB and IM_INC to tell PerlMagick where to find the ImageMagick libraries and include files. It turns out that this was a hack made to our source to support installing IM in a non-standard location.

it would be very nice if something like these environment variables were supported by ImageMagick/PerlMagick.

In addition, we've found that including -lperl in $LIBS_magick can be problematic, and it is not required, so we've removed it from the link command.