On 12/7/12 3:13 PM, Daniel Macks wrote:
> On Fri, 07 Dec 2012 18:09:40 +0100, Martin Costabel
> <[email protected]> wrote:
> On 7/12/12 15:49, Alexander Hansen wrote:
>> > On 12/7/12 4:18 AM, Greg Minshall wrote:
>> >> hi.  i wonder, is anyone running r-base (i'm running r-base215) under
>> >> the new macosx (10.8) and using x11 graphics?  (this is under fink
>> >> 0.34.4.)
>> >>
>> >> for me, the following causes R to crash:
>> >> ----
>> >> x11()
>> >> plot(x=3)
>> >> ----
>> >>
>> >> and i'm trying to figure out if this is something specific to me, or
>> >> more generic. >>
>> >> cheers, Greg Minshall
>> >>
>> >
>> > I see the same thing that you do.
>> My suspicion is (and I confirmed it now) that this is caused by two
>> versions of libcairo.2.dylib being loaded, namely the one from Fink in
>> /sw/lib and the one from X11 in /opt/X11/lib (there are also two
>> versions of libpng15.15.dylib). The culprit is
>> /sw/Library/Frameworks/R.framework/Versions/2.15/Resources/modules/R_X11.dylib,
>> which links with libcairo from X11, and this despite the flagsort
>> effort on the linker line:
>>
>> flag-sort -r gcc -dynamiclib -Wl,-headerpad_max_install_names
>> -undefined dynamic_lookup -single_module -multiply_defined suppress
>> -L/sw/lib -o R_X11.dylib dataentry.o devX11.o rotated.o rbitmap.o -lSM
>> -lICE -L/sw/lib -L/opt/X11/lib -lpangocairo-1.0 -lpango-1.0
>> -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -lz -lcairo -lX11
>> -L/usr/X11R6/lib -lX11 -lXt -lXmu  -ltiff -ljpeg -lpng -lz
>> -L../../../lib -lR   -lintl -Wl,-framework -Wl,CoreFoundation
>>
>> There is -L/sw/lib before -L/opt/X11/lib, but as it happens, this
>> isn't enough. The linker appears to have a strong bias in favor of
>> /opt/X11: If one replaces on this linker line /opt/X11 by /usr/X11,
>> which is the same thing via a symlink, then the cairo and png libs are
>> correctly linked from /sw/lib, and the crash goes away. If one puts
>> -L/opt/X11/lib anywhere on the linker line, even at the very end, then
>> the wrong cairo and png libs are linked in. 
> 
> Nope, it's flag-sort that has this bias. It doesn't know that /opt/X11
> is part of the standard system, so it assumes "unrecognized absolute
> path" is intended to override the normal paths and therefore gets sorted
> ahead of /sw/lib. Could you test if placing entries for /opt/X11/include
> and /opt/X11/lib ahead of the entry for /usr/X11 in @prefix_order
> (defined near the beginning of /sw/bin/flagsort) solves it?
> 
> To help debug flag-sort, call it with a "-v" flag.
> dan
> 
>  --
> Daniel Macks
> [email protected]
> 
> 

Yeah, that avoids the problem:  R_X11.dylib links to Fink's libpng15 and
cairo libraries, and plotting works.

It's probably also worth adding items to fink-package-precedence to
catch the use of inappropriate headers/libs from /opt/X11 so that we can
move from pesky runtime problems to annoying (but tagged) build-time
problems. :-)

-- 
Alexander Hansen, Ph.D.
Fink User Liaison
My package updates: http://finkakh.wordpress.com/

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Fink-users mailing list
[email protected]
List archive:
http://news.gmane.org/gmane.os.macosx.fink.user
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-users

Reply via email to