Re: [R] Embed R code in C++

2010-03-23 Thread mans

No, I didnt install Rcpp but i have R 2.10.1 already installed.
What's the difference with Rinside and Rcpp?

Do i need both to embed R code in C++ file or just one of them ?

Could you tell me where can i get Rcpp pkg?
How can i Install it because i dont know how to compile a source file on the
terminal.

Thanks very much for your help.

-- 
View this message in context: 
http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1678986.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Embed R code in C++

2010-03-22 Thread mans

Hi, 
Can anyone  tell me how to embed R code in a C++ file. 

I am actually using a mac running on the OSX 10.6.2 and the IDE Xcode
Version 3.2 and I would like to embed the basic function like geometric,
binomial, normal and hyper geometric distributions in a sample cpp file.

I heard about the library RInside and i have downloaded the source code for
mac but i do not know how to build it in order to use it with my IDE XCode.

Could anyone help me step by step because I am new in programming to show me
how to get this done? 

Thanks for your help. 

Mans. 
-- 
View this message in context: 
http://n4.nabble.com/Embed-R-code-in-C-tp1677784p1677784.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Embed R code in C++

2010-03-22 Thread mans

Hi thanks for your help but

I tried to install the pakage but i have got a installing error:

nstalling to library ‘/Library/Frameworks/R.framework/Resources/library’
* installing *source* package ‘RInside’ ...
** libs
** arch - x86_64
Error in loadNamespace(name) : there is no package called 'Rcpp'
Calls: ::: ... tryCatch - tryCatchList - tryCatchOne - Anonymous
Execution halted
/Library/Frameworks/R.framework/Resources/bin/R --vanilla --slave 
tools/RInsideEnvVars.r  RInsideEnvVars.h
/Library/Frameworks/R.framework/Resources/bin/R --vanilla --slave 
tools/RInsideAutoloads.r  RInsideAutoloads.h
g++-4.2 -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64  -Wall
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64  -fPIC  -I.
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64 -mtune=core2 -g
-O2 -c MemBuf.cpp -o MemBuf.o
g++-4.2 -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64  -Wall
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64  -fPIC  -I.
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/x86_64 -mtune=core2 -g
-O2 -c RInside.cpp -o RInside.o
In file included from RInside.cpp:23:
RInside.h:27:18: error: Rcpp.h: No such file or directory
In file included from RInside.cpp:23:
RInside.h:41: error: ‘Rcpp’ has not been declared
RInside.h:41: error: ISO C++ forbids declaration of ‘Environment’ with no
type
RInside.h:41: error: expected ‘;’ before ‘global_env’
RInside.h:65: error: ‘Rcpp’ has not been declared
RInside.h:65: error: ISO C++ forbids declaration of ‘Binding’ with no type
RInside.h:65: error: expected ‘;’ before ‘operator’
RInside.h: In member function ‘void RInside::assign(const T, const
std::string)’:
RInside.h:58: error: ‘global_env’ was not declared in this scope
RInside.cpp: In member function ‘void RInside::initialize(int, const char*
const*)’:
RInside.cpp:70: error: ‘runtime_error’ is not a member of ‘std’
RInside.cpp:100: error: ‘global_env’ was not declared in this scope
RInside.cpp:105: error: ‘Rcpp’ has not been declared
RInside.cpp:105: error: expected `;' before ‘s_argv’
RInside.cpp:106: error: ‘s_argv’ was not declared in this scope
RInside.cpp: In member function ‘void RInside::init_tempdir()’:
RInside.cpp:131: error: ‘runtime_error’ is not a member of ‘std’
RInside.cpp: In member function ‘void RInside::autoloads()’:
RInside.cpp:188: error: ‘Rcpp’ has not been declared
RInside.cpp:188: error: expected `;' before ‘delayed_assign_call’
RInside.cpp:194: error: ‘Rcpp’ has not been declared
RInside.cpp:194: error: expected `;' before ‘delayed_assign_name’
RInside.cpp:196: error: ‘Rcpp’ has not been declared
RInside.cpp:196: error: expected `;' before ‘autoloader_call’
RInside.cpp:200: error: ‘Rcpp’ has not been declared
RInside.cpp:200: error: expected `;' before ‘autoloader_name’
RInside.cpp:201: error: ‘Rcpp’ has not been declared
RInside.cpp:201: error: expected `;' before ‘autoloader_pack’
RInside.cpp:202: error: ‘delayed_assign_call’ was not declared in this scope
RInside.cpp:202: error: ‘autoloader_call’ was not declared in this scope
RInside.cpp:208: error: ‘autoloader_pack’ was not declared in this scope
RInside.cpp:214: error: ‘autoloader_name’ was not declared in this scope
RInside.cpp:217: error: ‘delayed_assign_name’ was not declared in this scope
RInside.cpp:228: error: ‘runtime_error’ is not a member of ‘std’
RInside.cpp: In member function ‘int RInside::parseEval(const std::string,
SEXPREC*)’:
RInside.cpp:234: error: ‘ParseStatus’ was not declared in this scope
RInside.cpp:234: error: expected `;' before ‘status’
RInside.cpp:243: error: ‘status’ was not declared in this scope
RInside.cpp:243: error: ‘R_ParseVector’ was not declared in this scope
RInside.cpp:246: error: ‘PARSE_OK’ was not declared in this scope
RInside.cpp:261: error: ‘PARSE_INCOMPLETE’ was not declared in this scope
RInside.cpp:264: error: ‘PARSE_NULL’ was not declared in this scope
RInside.cpp:269: error: ‘PARSE_ERROR’ was not declared in this scope
RInside.cpp:274: error: ‘PARSE_EOF’ was not declared in this scope
RInside.cpp: In member function ‘void RInside::parseEvalQ(const
std::string)’:
RInside.cpp:291: error: ‘runtime_error’ is not a member of ‘std’
RInside.cpp: In member function ‘SEXPREC* RInside::parseEval(const
std::string)’:
RInside.cpp:299: error: ‘runtime_error’ is not a member of ‘std’
RInside.cpp: At global scope:
RInside.cpp:304: error: ‘Rcpp’ has not been declared
RInside.cpp:304: error: expected constructor, destructor, or type conversion
before ‘RInside’
make: *** [RInside.o] Error 1
ERROR: compilation failed for package ‘RInside’
* removing ‘/Library/Frameworks/R.framework/Resources/library/RInside’