Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 155804 - media-gfx/imagemagick-6.3.0.5 fails - ld: cannot find -lMagick
Summary: media-gfx/imagemagick-6.3.0.5 fails - ld: cannot find -lMagick
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Karol Wojtaszek (RETIRED)
URL:
Whiteboard:
Keywords:
: 156477 157039 157747 158761 160655 168030 168164 168544 (view as bug list)
Depends on:
Blocks: 156814
  Show dependency tree
 
Reported: 2006-11-20 13:28 UTC by Tiger!P
Modified: 2020-05-01 15:22 UTC (History)
21 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info-20061120.txt,2.76 KB, text/plain)
2006-11-20 13:30 UTC, Tiger!P
Details
Other warnings before fail message (warnings.txt,7.47 KB, text/plain)
2006-11-20 13:31 UTC, Tiger!P
Details
imagemagick-6.3.0.5.ebuild.patch (imagemagick-6.3.0.5.ebuild.patch,358 bytes, patch)
2006-11-21 14:48 UTC, Jeroen Roovers (RETIRED)
Details | Diff
imagemagick-6.3.0.5-nolMagick.patch (imagemagick-6.3.0.5-nolMagick.patch,685 bytes, patch)
2007-02-15 14:43 UTC, michael@smith-li.com
Details | Diff
imagemagick-6.3.0.5-parallel-build.patch (imagemagick-6.3.0.5-parallel-build.patch,382 bytes, patch)
2007-02-22 21:29 UTC, Sven
Details | Diff
ebuild.patch (ebuild.patch,604 bytes, patch)
2007-02-22 22:07 UTC, Sven
Details | Diff
imagemagick-6.3.0.5-parallel-build.patch (imagemagick-6.3.0.5-parallel-build.patch,436 bytes, patch)
2007-02-28 00:12 UTC, Sven
Details | Diff
imagemagick-6.3.0.5-parallel-build.patch (no need for autoreconf) (imagemagick-6.3.0.5-parallel-build.patch,1.01 KB, patch)
2007-03-09 01:40 UTC, Sven
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiger!P 2006-11-20 13:28:30 UTC
cp Magick.bs blib/arch/auto/Image/Magick/Magick.bs
chmod 644 blib/arch/auto/Image/Magick/Magick.bs
rm -f blib/arch/auto/Image/Magick/Magick.so
x86_64-pc-linux-gnu-gcc  -L../magick/.libs -lMagick -shared -L/usr/local/lib64 Magick.o  -o blib/arch/auto/Image/Magick/Magick.so       \
           -L/usr/lib64 -L/usr/lib64 -lfreetype -lz -L/usr/lib -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lpthread -lm -lpthread     \
          
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lMagick
collect2: ld returned 1 exit status
make[1]: *** [blib/arch/auto/Image/Magick/Magick.so] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-gfx/imagemagick-6.3.0.5/work/ImageMagick-6.3.0/PerlMagick'
make: *** [all-perl] Error 2
make: *** Waiting for unfinished jobs....

!!! ERROR: media-gfx/imagemagick-6.3.0.5 failed.
Call stack:
  ebuild.sh, line 1568:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  imagemagick-6.3.0.5.ebuild, line 86:   Called die

!!! compile problem
!!! If you need support, post the topmost build error, and the call stack if relevant.
Comment 1 Tiger!P 2006-11-20 13:30:03 UTC
Created attachment 102428 [details]
emerge --info

The emerge --info output
Comment 2 Tiger!P 2006-11-20 13:31:08 UTC
Created attachment 102429 [details]
Other warnings before fail message

This are addiditonal warnings I see before the ld error is displayed.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2006-11-21 11:59:51 UTC
The same thing happens on hppa. Can't seem to reproduce it on an x86. The PerlMagick build does not fail if imagemagick is already installed on the system. Also, it does not fail when I build it on an x86 system with no imagemagick installed.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2006-11-21 14:48:11 UTC
Created attachment 102493 [details, diff]
imagemagick-6.3.0.5.ebuild.patch

This should remove the offending -lMagick.
Comment 5 Eddy Mulyono 2006-11-21 20:51:04 UTC
I experience the same problem. I think it's because of my MAKEOPTS="-j5", because imagemagick-6.3.0.5 emerged fine when I set MAKEOPTS="-j1".
Comment 6 Walter Goossens 2006-11-22 13:41:03 UTC
(In reply to comment #5)
> I experience the same problem. I think it's because of my MAKEOPTS="-j5",
> because imagemagick-6.3.0.5 emerged fine when I set MAKEOPTS="-j1".
> 

I also experienced this bug on PPC and when the ebuild failed (multiple times) I did a manual make in the /var/tmp/portage/imagemagick...../ touched the .compiled file and did a 
#ebuild /usr/portage/media-gfx/imagemagick/imagemagick-6.3.0.5.ebuild install

and from then on everything worked OK...
So I guess the -j1 "hack" works.
Comment 7 Tiger!P 2006-11-23 10:20:33 UTC
The patch from comment #4 works.
And also using MAKEOPTS="-j1" works (for me).

Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2006-11-23 13:31:33 UTC
(In reply to comment #7)
> The patch from comment #4 works.
> And also using MAKEOPTS="-j1" works (for me).

The patch works because that causes the build to fail if -lMagick is not found. That library would only be available on the live system to link against, which would usually be a stale library you do not want to use anyway because you are installing a new library, hence the patch.

I don't know about the other problem mentioned here: imagemagick builds fine for me on several systems with MAKEOPTS=-j2 (but with the patch, or else it will fail on a fresh install, or it will build against the old lib).
Comment 9 Tiger!P 2006-11-23 13:53:12 UTC
(In reply to comment #8)
> I don't know about the other problem mentioned here: imagemagick builds fine
> for me on several systems with MAKEOPTS=-j2 (but with the patch, or else it
> will fail on a fresh install, or it will build against the old lib).

I have tested to build (without the patch) with MAKEOPTS=-j2, this fails.
I have tested to build (without the patch) with MAKEOPTS=-j1, this succeeds.
I have tested to build (with the patch) with MAKEOPTS=-j2, this succeeds.

So there is still something strange around when using MAKEOPTS=-j2 (or higher).


Comment 10 Jeremy L. Gaddis 2006-11-24 14:20:29 UTC
(In reply to comment #3)
> The same thing happens on hppa. Can't seem to reproduce it on an x86. The
> PerlMagick build does not fail if imagemagick is already installed on the
> system. Also, it does not fail when I build it on an x86 system with no
> imagemagick installed.
> 

It fails on me (exact same error) on x86, so I won't bother pasting the exact same output.  As some of the other commenters have mentioned, running with MAKEOPTS="-j1" works for me (as opposed to the MAKEOPTS="-j5" in make.conf -- this is a 4-way box).
Comment 11 Carter Smithhart 2006-11-27 19:08:02 UTC
I'm also seeing this problem on an amd64 machine. I'm running with MAKEOPTS="-j2".

I'll use the -j1 hack for the moment.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2006-11-28 01:34:29 UTC
*** Bug 156477 has been marked as a duplicate of this bug. ***
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2006-12-04 03:07:30 UTC
*** Bug 157039 has been marked as a duplicate of this bug. ***
Comment 14 Randy Barlow 2006-12-06 22:36:07 UTC
I can confirm that the MAKEOPTS="-j1" solution works for x86.  Thanks for the hint!
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-12-10 11:18:40 UTC
*** Bug 157747 has been marked as a duplicate of this bug. ***
Comment 16 Brenton Huggins 2006-12-15 15:31:12 UTC
x86, 1 processor available, athlon-xp

-j3 fails with same error
-j2 as well
-j1 succeeds
Comment 17 genbug 2006-12-19 16:12:18 UTC
maybe the ebuild should force -j1 until this is resolved.

save everyone wasting time banging into this. 
Comment 18 Raúl Porcel (RETIRED) gentoo-dev 2006-12-21 12:25:18 UTC
*** Bug 158761 has been marked as a duplicate of this bug. ***
Comment 19 Gene Liverman 2006-12-23 20:22:52 UTC
I was having the same problem and did the -j1 fix, which worked.  Here is some background:

SirTux ~ # emerge --info
Portage 2.1.1-r2 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.18-gentoo-r4 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.6
Last Sync: Sat, 23 Dec 2006 06:30:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi aim alsa alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol amd64 apache2 automount avi bash-completion berkdb binary-drivers bitmap-fonts bonjour bootsplash branding bzip2 cdinstall cdr clamav cli cracklib crypt cups curl curlwrappers dbus dbx dio directfb dlloader doc dri dvd dvdr eds elibc_glibc emboss encode esd ethereal fam fbcon firefox font-server fortran ftp gdbm gif gmail gmailtimestamps gnome gpm gstreamer gtalk gtk gtk2 hal hardened hardenedphp hfs howl html iconv imap input_devices_evdev input_devices_keyboard input_devices_mouse java javascript jikes jpeg kernel_linux krb4 ldap libg++ mad madwifi mikmod mime mono mp3 mpeg msn mysql mysqli ncurses nls nocd nptl nptlonly nsplugin ntfs ogg opengl oss pam pcre pda pdf pdflib perl php png posix ppds pppd python qt3 qt4 quicktime rdesktop readline recode reflection samba screen sdl seamonkey session slp snmp spell spl ssl swat symlink tcpd tiff tokenizer truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i810 video_cards_mga video_cards_neomagic video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo videos vorbis wifi winbind wxwindows xine xml xorg xscreensaver xv xvid yahoo zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Comment 20 SGS 2006-12-31 17:49:46 UTC
Changing MAKEOPTS="-j1" worked for me as well
Comment 21 Michael Lee Yohe 2007-01-05 07:29:09 UTC
Also experienced this problem on x86/2006.1.

Turning off parallel building also worked for me.
Comment 22 Gustavo Felisberto (RETIRED) gentoo-dev 2007-01-07 00:16:30 UTC
Managed to duplicate this in a stable ppc system. Did not try the patch, just the -j1. It was fresh instalation.
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2007-01-07 12:22:33 UTC
*** Bug 160655 has been marked as a duplicate of this bug. ***
Comment 24 michael@smith-li.com 2007-01-26 15:27:27 UTC
From #gentoo:

10:25 <Munger> kojiro, Patch [comment #4] worked great. My bugzilla account is in a state of confusion right now. Can you pass that info on to the appropriate channels?
Comment 25 Tim Hosking 2007-01-26 17:20:17 UTC
(In reply to comment #24)
> From #gentoo:
> 
> 10:25 <Munger> kojiro, Patch [comment #4] worked great. My bugzilla account is
> in a state of confusion right now. Can you pass that info on to the appropriate
> channels?
> 

Yep. I have got bugzilla back and can confirm that the patch does the trick.

--
Munger
Comment 26 DEMAINE Benoît-Pierre, aka DoubleHP 2007-02-09 03:39:39 UTC
I also have the bug (-j2 on ~x86); dont think you need a detailed report from me; when will the patch be merged to portage ? already 70d old available fix, and still not merged ? is maint dead ?

I ll test the patch tomorow.
Comment 27 Alexander Skwar 2007-02-13 11:54:07 UTC
Could somebody change hardware to All and Version to 2006.1, to reflect reality? And yes, it would really be nice, if the patch could be applied, as building still fails... :(
Comment 28 michael@smith-li.com 2007-02-15 14:43:47 UTC
Created attachment 110287 [details, diff]
imagemagick-6.3.0.5-nolMagick.patch

reJ's patch from Comment  #4 works fine. Just in case it hasn't been adopted because of qualms with using bare GNU sed in ebuilds, here's a Makefile patch that does the same thing.
Comment 29 michael@smith-li.com 2007-02-15 14:55:12 UTC
Confirmed that this problem still exists on 32-bit PPC and x86 on 2006.1, so I changed the Hardware to All and the Version to unspecified. There are at least two easy workarounds, so I changed the Severity to minor, too.
Comment 30 Jeroen Roovers (RETIRED) gentoo-dev 2007-02-15 18:21:09 UTC
PerlMagick should be linked against whatever is in ../magick/.libs but not to plain -lMagick because:

1) we already know that no Magick library is available in the cwd, but there might be one in /usr/lib which it should *not* link against, ever.
2) there ought to be one in -L../magick/.libs. If not, something is horribly wrong, and if there is, there is no need at all to specify -lMagick as well.

This bugs seems to be linked to bug #121142 in many ways. I hope the issue is now resolved, by applying patch #110287. The fix is in the tree. Please test it and reopen the bug as needed.
Comment 31 Tiger!P 2007-02-16 18:41:10 UTC
I've recompiled imagemagick-6.3.0.5 with the MAKEOPTS="-j2" and this works indeed.
Thank you for fixing it.
Comment 32 Sven 2007-02-22 03:04:27 UTC
At the moment, imagemagick may compile.

But the missing "-lMagick" causes, that the Magick.so (the perl-library) contains a lot of uresolved symbols.

perl -MImage::Magick -e "new Image::Magick();" does not work anymore.
The perl-library is not linked against -lMagick, and therefor libMagick.so is not loaded and therefor there are unresolved symbols.
Comment 33 Jakub Moc (RETIRED) gentoo-dev 2007-02-22 20:27:37 UTC
*** Bug 168030 has been marked as a duplicate of this bug. ***
Comment 34 Jakub Moc (RETIRED) gentoo-dev 2007-02-22 20:43:30 UTC
reopen wrt Comment #32
Comment 35 Sven 2007-02-22 21:29:22 UTC
Created attachment 111005 [details, diff]
imagemagick-6.3.0.5-parallel-build.patch

patch, that adds dependency on $(LIBMAGICK) to perl-all.
Comment 36 Sven 2007-02-22 21:49:54 UTC
I attached a patch.

I still have to modify the ebuild. After the patch, you have to run automake, autoconf, etc. But unfortunatly, eautoreconf from autotool.eclass aborts with an error. If i run things by hand, it works.


Anyway: after you do things by hand, you can run "make all-perl" and the build-process with first build magick/.libs/libMagick.so and will then build the perl-library. So after all i know about make, this should tell make to wait until magick/.libs/libMagick.so is built before building the perl-library in case of parallel build.
Comment 37 Sven 2007-02-22 22:07:17 UTC
Created attachment 111008 [details, diff]
ebuild.patch

patch for the ebuild.

The ebuild simply runs autoreconf, since eautoreconf doesn't work :-(

In addition:
- removed a "einfo $S" command
- added a "-e config.sub"-test, because "chmod +x config.sub" caused a "file not found"-error on my machine
Comment 38 Sven 2007-02-22 22:08:02 UTC
Please my 2 patches! I'm pretty optimistic, that it fixed the parallel-build problem without breaking the perl-module.
Comment 39 Pat Erley 2007-02-22 23:22:48 UTC
I've tested the 2 patches sven provided (as I originally alerted him to the problem) and that they do fix imagemagick's perl module, and it built with -j2 for me.
Comment 40 Jakub Moc (RETIRED) gentoo-dev 2007-02-23 17:39:43 UTC
*** Bug 168164 has been marked as a duplicate of this bug. ***
Comment 41 Jeroen Roovers (RETIRED) gentoo-dev 2007-02-23 22:31:26 UTC
To avoid any further confusion: this never had anything to do with parallel make.
Comment 42 Sven 2007-02-24 00:12:28 UTC
If not parallel make: what else did cause libMagick.so not to exist in ../magick/.libs ?

In former versions of ImageMagick, Makefile.PL has always linked PerlMagick with
  -L/usr/lib -L../magick/.libs -lMagick

The result was, that libMagick.so was searched in /usr/lib first, and then found there, if ImageMagick was already installed. PerlMagick was not linked against the newly compiled libMagick.so, but the old one in /usr/lib.
I worked on a patch for quite some time. I finally resolved the issue by changing the order of the statements to this one:
  -L../magick/.libs -lMagick -L/usr/lib

In other words:

The -lMagick has _always_ been there. Just in case of an already installed ImageMagick, the order of the -L parameters made a difference.


So as far as i can tell, "-L../magick/.libs -lMagick" is correct. It's a MUST HAVE. Without it, unresolved symbols will occur in PerlMagick. And in some comment, i read that "-j1" seems to work fine. Just in case of "-j2" or "-j3" we get this strange error, that libMagick.so cannot be found.

For me, this indicates a parallel make problem.
But instead of fixing this parallel make problem, the -lMagick was simply removed. That results in unresolved symbols.


So please correct me, if i'm wrong.
And if it still occurs with my patches, please provide the full output of the make-process (emerge imagemagick 2>&1 | tee output.txt).
Comment 43 Jakub Moc (RETIRED) gentoo-dev 2007-02-24 09:18:10 UTC
Well, someone revert the patch please and revbump the ebuild, keeping the stable keywords there. 

As noted numerous time here and on other duplicates, this *was* a parallel make problem, because it worked just fine w/ -j1 for *everyone*. Now we have a broken app instead; so either fix it properly or force -j1 there meanwhile, but the current patch is wrong.
Comment 44 Gregg Casillo 2007-02-27 09:09:48 UTC
Sven's patches worked for me. Thanks!
Comment 45 Jakub Moc (RETIRED) gentoo-dev 2007-02-27 10:12:18 UTC
*** Bug 168544 has been marked as a duplicate of this bug. ***
Comment 46 Sven 2007-02-27 17:17:58 UTC
(In reply to comment #44)
> Sven's patches worked for me. Thanks!

I contacted him by mail. He used -j3 to build imagemagick.
Comment 47 Sven 2007-02-28 00:12:05 UTC
Created attachment 111503 [details, diff]
imagemagick-6.3.0.5-parallel-build.patch

New patch. Added $(LIBMAGICK) dependency to another point in PerlMagick/Makefile.PL.am. It actually moved up one level in the dependency hierarchie.

libMagick.so is also required for running "perl Makefile.PL". With the old patch, it was not required. I was not satisfied with that.
Comment 48 Sven 2007-03-03 17:39:01 UTC
Please: can somebody take care of this?

nolMagick-patch is still present in stable ebuild. imagemagick is still broken.
Comment 49 William Sutton 2007-03-06 14:54:10 UTC
I'd like to add to the clamoring voices asking for the patch to be added to the stable codebase.  I've been beating my head on this off and on for a couple months now because I couldn't locate the bug here or a solution on the forums (see http://forums.gentoo.org/viewtopic.php?p=3943402#3943402 for cross-reference).

For reference, I have this problem on a P4 2GHz with -j3 and also on a dual P4 2GHz with -j5, both running latest stable gentoo.
Comment 50 Nahor 2007-03-06 18:33:35 UTC
I had the problem with the perl lib also. I hacked my ebuild to use the parallel-build and ebuild patches from Sven and that fixed it. 

I compiled on a dual core Pentium D with MAKEOPTS=-j3 without error and "perl -e ' use Image::Magick'" doesn't complain about a missing symbol anymore.
Comment 51 Jeroen Roovers (RETIRED) gentoo-dev 2007-03-06 23:53:39 UTC
(In reply to comment #42)
> If not parallel make: what else did cause libMagick.so not to exist in
> ../magick/.libs ?

The fact that imagemagick's developers expect you to

1) unpack, configure, build install imagemagick
2) cd to the perlmagick subdir and build and install there too.

For upstream, this issue simply does not exist. For Gentoo, this problem has existed ever since one or more Gentoo devs thought it would be great to have one ebuild with USE=perl instead of an imagemagick and a perlmagick ebuild. Doing the above two steps in one ebuild is impossible without patching the source.

> In former versions of ImageMagick, Makefile.PL has always linked PerlMagick
> with
>   -L/usr/lib -L../magick/.libs -lMagick
> 
> The result was, that libMagick.so was searched in /usr/lib first, and then
> found there, if ImageMagick was already installed. PerlMagick was not linked
> against the newly compiled libMagick.so, but the old one in /usr/lib.
> I worked on a patch for quite some time. I finally resolved the issue by
> changing the order of the statements to this one:
>   -L../magick/.libs -lMagick -L/usr/lib

-L/usr/lib should not be in there. By the time perlmagick is built, the fresh libMagick is not installed yet and you would be linking against the stale libMagick that happens to be installed.

> In other words:
> 
> The -lMagick has _always_ been there. Just in case of an already installed
> ImageMagick, the order of the -L parameters made a difference.

Indeed. For upstream this makes sense, but not for Gentoo's recent imagemagick ebuilds. I vote to split up imagemagick and perlmagick into two separate packages again with RDEPEND="perl? ( ~media-gfx/perlmagick-${PV} )" or something even better.

> 
> So as far as i can tell, "-L../magick/.libs -lMagick" is correct. It's a MUST
> HAVE. Without it, unresolved symbols will occur in PerlMagick. And in some
> comment, i read that "-j1" seems to work fine. Just in case of "-j2" or "-j3"
> we get this strange error, that libMagick.so cannot be found.

Very good of you to notice.

> For me, this indicates a parallel make problem.

For Gentoo, you might conclude that is the problem.

> But instead of fixing this parallel make problem, the -lMagick was simply
> removed. That results in unresolved symbols.

Sorry.

> So please correct me, if i'm wrong.

Part wrong, part right. I think you are right about the correct fix to this bug.

I am going to commit your changes as they don't seem to kill puppies and I am going to follow jakub's suggestion to revbump the current ebuild to force the upgrade.

And then I am going to refrain from touching imagemagick and step back to just wait until the graphics herd regains control. I hope they soon find some active developers out there to help out with this bug and other media-gfx bugs.
Comment 52 Sven 2007-03-07 00:07:59 UTC
(In reply to comment #51)
> (In reply to comment #42)
> > If not parallel make: what else did cause libMagick.so not to exist in
> > ../magick/.libs ?
> 
> The fact that imagemagick's developers expect you to
> 
> 1) unpack, configure, build install imagemagick
> 2) cd to the perlmagick subdir and build and install there too.
> 
> For upstream, this issue simply does not exist. For Gentoo, this problem has
> existed ever since one or more Gentoo devs thought it would be great to have
> one ebuild with USE=perl instead of an imagemagick and a perlmagick ebuild.
> Doing the above two steps in one ebuild is impossible without patching the
> source.

Some versions ago, i sent a patch upstream, that fixed the issue.
Before my patch, it was the way you said. Now it's different.
Here's an overview:

Old situation:
  make all => compiles imagemagick
  make install => installs imagemagick + compiles/installs perlmagick
  (linked against libMagick.so in /usr/lib)
Current situation:
  make all => compiles imagemagick + perlmagick
  make install => install imagemagick + perlmagick
  (linked against freshly compiled libMagick.so)


> > In former versions of ImageMagick, Makefile.PL has always linked PerlMagick
> > with
> >   -L/usr/lib -L../magick/.libs -lMagick
> > 
> > The result was, that libMagick.so was searched in /usr/lib first, and then
> > found there, if ImageMagick was already installed. PerlMagick was not linked
> > against the newly compiled libMagick.so, but the old one in /usr/lib.
> > I worked on a patch for quite some time. I finally resolved the issue by
> > changing the order of the statements to this one:
> >   -L../magick/.libs -lMagick -L/usr/lib
> 
> -L/usr/lib should not be in there. By the time perlmagick is built, the fresh
> libMagick is not installed yet and you would be linking against the stale
> libMagick that happens to be installed.

I never tried to remove -L/usr/lib. I assume, that the linker would complain about other missing libraries. AFAIK, the linker searches the -L options from left to right. So searching ../magick/.libs before /usr/lib is sufficient.
Comment 53 Sven 2007-03-07 01:13:26 UTC
My parallel-build.patch has been applied upstream. It will be in version 6.3.3-1 released tomorrow.
Comment 54 William Sutton 2007-03-07 17:54:08 UTC
I've verified the fix after compiling with -j3 on my single P4 system.
Comment 55 Chris Gianelloni (RETIRED) gentoo-dev 2007-03-08 17:29:30 UTC
So what version do I need here, exactly (for the release) ?
Comment 56 Sven 2007-03-08 17:39:31 UTC
(In reply to comment #55)
> So what version do I need here, exactly (for the release) ?

What do you mean?
Comment 57 Jakub Moc (RETIRED) gentoo-dev 2007-03-08 20:46:40 UTC
(In reply to comment #55)
> So what version do I need here, exactly (for the release) ?

6.3.0.5-r1 is unbroken again...
Comment 58 Sven 2007-03-09 01:40:11 UTC
Created attachment 112657 [details, diff]
imagemagick-6.3.0.5-parallel-build.patch (no need for autoreconf)

I've uploaded another version of the patch. It simply also patches Makefile.in, so that we don't need to run autoreconf.

Well, the current ebuild is fine. Just in case that autoreconf causes problems ...
Comment 59 Bryan Østergaard (RETIRED) gentoo-dev 2007-04-17 18:11:44 UTC
parallel-build.patch have been upstreamed and there's no longer any need for autoreconf in 6.3.3. Please reopen this bug if it still applies to 6.3.3.