From bellis at hsph.harvard.edu  Thu Aug 21 18:50:16 2003
From: bellis at hsph.harvard.edu (Byron Ellis)
Date: Thu Aug 21 23:50:14 2003
Subject: [Rd] [Mac] R as a Framework
Message-ID: <7356CC40-D421-11D7-8BB2-000393BDE1EC@hsph.harvard.edu>

In case anyone cares, I more or less have R building as a framework 
under 10.2---it turned out to be not-so-difficult. Basically the 
install_name had to be changed (-install_name 
R.framework/Versions/1.8.0/R). Note that the install_name isn't a fully 
qualified path, which threw me off for a while. Then the library 
modules relinked with -framework R, which I built in main for, uh, 
convenience, (-F$(topdir)/src/main -framework R) instead of against 
libR.dylib.

I think it would also be possible to build R as a private framework, 
though the linking for libraries becomes, I think, a bit trickier. I 
also haven't worked on R CMD at all so it still builds the old way. 
Things seem to work so far, R.framework/Resources/bin/R comes up just 
fine from Terminal and finds the library dylibs OK--- in this case R 
CMD install still works since libR.dylib is still put in the bin 
directory so modules linked against it can still load.

So far it was all done by hand, but I hope to automate the process. My 
next trick will be to have Cocoa and the R event loop live together in 
peace and harmony (which _should_ work, since Carbon and Cocoa both 
ultimately employ CFRunLoop, so I'm hoping to just punt the setup into 
the appropriate locations within the Cocoa app).  :-)


[Rd] [Mac] R as a Framework
Byron Ellis