[Rcpp-devel] Rstudio package build and Rcpp::compileAttributes()

Smith, Dale Dale.Smith at Fiserv.com
Thu Feb 7 16:59:39 CET 2013


Hello all,

 

I'm using Rstudio 0.97.306, R 2.15-2, and Rcpp 0.10.2 with Windows 7
Professional x64. I recently switched to using the build tool in
Rstudio, however, my generated file RcppExports.cpp and RcppExports.R
are checked into version control, so they are read-only. The build fails
with

 

***************

==> Rcpp::compileAttributes()

 

Error in eval(expr, envir, enclos) : 

  file io error:
'C:/Foundation/Common/RiskFinancialLibrary/Prototypes/FiservPrototypes/s
rc/RcppExports.cpp'

Calls: source ... withVisible -> eval -> eval -> <Anonymous> -> .Call

Execution halted

***************

 

I have them checked in as I need to modify RcppExports.cpp manually,
after running compileAttributes(), to avoid compiling in Visual Studio
(see below for explanation, if you are interested):

 

#ifndef _MSC_VER

 

#include <Rcpp.h>

 

using namespace Rcpp;

 

...

 

#endif

 

I tried removing the generated key at the top of RcppExports.cpp since
this is mentioned in the Rcpp Attributes Vignette. However, I still have
the error. Perhaps I've misinterpreted section 3.5.2 "Generated Code"?

 

In order to avoid generating traffic on the list let me comment on why
I'm wrapping RcppExports.cpp with _MSC_VER. My employer produces all
applications and libraries in Visual Studio. I wrap my ANSI C++ classes
with .NET managed C++ classes and build a .NET assembly. This allows me
to use Rcpp to test my C++ implementations of models against a clean
implementation in R and fulfill company requirements that I use Visual
Studio unit tests for quality assurance. I can then deliver the assembly
build to developers for use in their own projects. 

 

I may turn the previous paragraph into a presentation for the Atlanta R
User's Group.

 

Dale Smith, Ph.D.

Senior Financial Quantitative Analyst

Risk & Compliance

Fiserv

Office: 678-375-5315

www.fiserv.com <http://www.fiserv.com/> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130207/61218cdf/attachment.html>


More information about the Rcpp-devel mailing list