[R] cairo and rapache [was: Weird errors on MAC OS X Leopard when using Cairo/GDD through Rserve]

Simon Urbanek urbanek at research.att.com
Fri Jan 11 02:04:53 CET 2008


Charles, Greg,

the problem is that Apple's  FreeType on Leopard uses CF calls (albeit  
just to get files), so it breaks on fork. (The message is moot,  
because the whole point of using fork is to *not* use exec).

In any case the solution is to compile your own version of freetype,  
fontconfig and cairo without any CF or Carbon API. Fortunately most  
recent versions of FreeType will do so automatically on Leopard.  
Compiling Cairo can be a bit tricky, because you must make sure that  
you newly compiled FT/FC will have higher precedence than Apple's and  
yet it relies on X11. In my experience it will make the typesetting  
results worse, but unless Apple fixes their CF there is no other way  
around that (other than using serial access like on Windows).

Cheers,
Simon

PS: As a side note, I opted for static ft/fc/cairo builds and I had to  
add -lexpat to the flags and override ft/fc with the full path to the  
static library, so my CAIRO_LIBS were
-L/opt/lib -L/usr/X11/lib /opt/lib/libfreetype.a /opt/lib/ 
libfontconfig.a /opt/lib/libpng12.a -lz -lXrender -lSM -lICE -lX11 / 
opt/lib/libcairo.a -lexpat


Greg Dingle gregdingle at yahoo.com wrote on Sun Dec 9 23:46:58 CET 2007

> I'm trying to get Cairo and RApache to work together on OS X leopard.
>
> Initializing Cairo stops the whole HTTP response. Apache logs show
> this message:
>
> Break on
> __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__
> () to debug.
> The process has forked and you cannot use this CoreFoundation
> functionality safely. You MUST exec().
>


On Jan 10, 2008, at 6:10 AM, Charles Girardot wrote:

> [...]
> I just upgraded my mac computer to the new OS X Leopard. And all my  
> code that uses Rserve to produce pictures doesn t work anymore. I am  
> using the latest version of Rserve (0.5), I have tried the old and  
> the new java client. My R is 2.6.1. All libs (GDD, Cairo are the  
> latest as well)
>
> For example a simple :
> connection.voidEval("library(GDD)");
>
> produces a bunch of :
> The process has forked and you cannot use this CoreFoundation  
> functionality safely. You MUST exec().
> Break on  
> __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__ 
> () to debug.
>
> in the console.




More information about the R-help mailing list