in reply to [RESOLVED] building PerlMagick with perlbrew provided perl on Debian

I found a personal note regarding troubleshooting something similar a while back (and a patch against ImageMagick-6.9.1-1) which replaces -lperl with -L' . $Config{'archlib'} . '/CORE'; in the $LIBS_magick scalar variable declaration in the following files:

For example the diff for PerlMagick/Makefile.PL.in should look like:

-my $LIBS_magick = '-L../magick/.libs -lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ -lperl @MATH_LIBS@';
+my $LIBS_magick = '-L../magick/.libs -lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ @MATH_LIBS@ -L' . $Config{'archlib'} . '/CORE';

Hope this works for ImageMagick 7 too.

I believe the main issue is that the default behaviour is influenced by the LD_LIBRARY_PATH environment variable which wouldn't include the path to your perlbrew built perl library so the system libperl is used.

You can also try (untested solution) to set LIBRARY_PATH to point to your perlbrew built libperl path before compiling.

Replies are listed 'Best First'.
Re^2: building PerlMagick with perlbrew provided perl on Debian
by perlfan (Parson) on Mar 31, 2021 at 03:47 UTC
Re^2: building PerlMagick with perlbrew provided perl on Debian
by perlfan (Parson) on Mar 29, 2021 at 04:05 UTC
    This absolutely work! Thank you so much. I will see if I can get a patch submitted upstream to pay your goodwill forward.