Ticket #27685 (closed enhancement: fixed)
enable 'aqua' graphics for R
|Reported by:||adfernandes@…||Owned by:||kjell.konis@…|
R needs a Fortran compiler, and hence the macports-gcc-* compilers are used by default to build it. However, none of these compilers can handle the apple-compiler specific files required by the aqua build.
The attached patches fix that, allowing the Quartz graphics device on 32-bit and 64-bit builds of R. It is a little bit of a hack so I'm not sure if it should be a default variant.
The only caveat is that I have only tested on 10.6 and, due to the way the headers work, I don't think it will work on 10.5.
This is important as the quartz graphics subsystem is 2-3 orders of magnitude faster than the x11 backend - literally. When you are plotting thousands of points, lines, and symbols, this is really important.
What the patch does is two-fold. First, it patches src/include/R_ext/QuartzDevice.h to add a definition of __INTEL_COMPILER around
#define __INTEL_COMPILER #include <ApplicationServices/ApplicationServices.h> #undef __INTEL_COMPILER
so that the apple-specific CF_FORMAT_FUNCTION CF_FORMAT_ARGUMENT macros in CFString.h are defined to nulls. The FSF gccs cannot handle the actual definition of these macros. It looks like gcc-4.6 will be patched to accept them, but until then... I searched all the apple SDK files, and the 10.6 CFString.h file is the only place where the __INTEL_COMPILER macro is used. Of course, this is not guaranteed for the future, but since Intel's compiler is mostly gcc-compatible, I think this is safe.
Second, the patch forces the objective-c compiler to be apple's own. It is the only one that can compile the qdCocoa.m file for the quartz device. This is the only objective-c file in the entire R distribution.
I've run a lot of plotting through this, mixing x11 and quartz devices, with many font, symbol, and drawing tests, and it all looks fine to me (10.6.4, gcc-4.5) with no hangs, problems, or crashes.
- Status changed from new to closed
- Resolution set to fixed