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.


In reply to Re: building PerlMagick with perlbrew provided perl on Debian by arpad.szasz
in thread [RESOLVED] building PerlMagick with perlbrew provided perl on Debian by perlfan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.