[Rd] More Embedding REngine in Cocoa

Simon Urbanek simon.urbanek at r-project.org
Wed Mar 25 15:16:08 CET 2009


DAvid,

On Mar 25, 2009, at 2:44 , David Zwerdling wrote:

> Hello once again,
> After locating the standalone REngine object set, I am having  
> difficulty integrating them into the XCode project I intend to use  
> them in.
>
> Suppose one started with the REngine standalone source and a blank  
> XCode file, what special modifications need to be made to allow the  
> source files to see inside R.framework?  Importing the framework  
> into the project, setting the header and framework search paths  
> hasn't done anything for me yet.

You only need to set the header path to include Headers and  
PrivateHeaders of the R.framework - everything else follows  
automatically from adding the R.framework to the project.

 From R.xcodeproj:
HEADER_SEARCH_PATHS = (
	/Library/Frameworks/R.framework/Headers,
         /Library/Frameworks/R.framework/PrivateHeaders,
);

That's all.


>  The files are complaining about the R.h file not existing.  Using  
> the R.app as a reference, I was unable to find specifically how it  
> adds the R/ directory visibility to the application headers at link  
> or compile time.
>

See above.


> I was able to compile and run the test file inside the REngine  
> standalone.  However, I don't know how to initiate my application in  
> XCode using the R CMD command.  What impacts will this have to the  
> existing program?

Essentially R CMD sets up the environment for R automatically. If you  
have a stand-alone application and you cannot (or don't want to) use R  
CMD then have a look at the R.app GUI - it creates the environment  
itself in RController.m l.306-373 (current SVN r5376). The following  
code (l.375-420) then sets up the locale - it may be a bit more  
complicated than what you need, but you just have to ensure you're  
running in a UTF-8 locale. [Note:


>  Finally, I was also unable to find any sort of implementation of  
> this in RGui.  Is this even necessary from XCode?
>

See above.

Cheers,
Simon



> I hope this is enough detail.  Thanks in advance.
> David Zwerdling
> zwerdlds at gmail.com
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



More information about the R-devel mailing list