custom include and library paths when building PerlMagick?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
qwerty
Posts: 5
Joined: 2011-02-24T08:33:58-07:00
Authentication code: 8675308

custom include and library paths when building PerlMagick?

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: custom include and library paths when building PerlMagic

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
qwerty
Posts: 5
Joined: 2011-02-24T08:33:58-07:00
Authentication code: 8675308

Re: custom include and library paths when building PerlMagic

Post 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.
Post Reply