Hi Dale,

In order to ensure that the RcppExports.cpp file is correct it needs
to be deterministically generated, so in all cases we need write
access to it. One possible workaround is this:

- Use a custom SOURCES variable in Makevars to explicitly list the
source files to compile as part of the package

- Don't include RcppExports.cpp in that list

- Add another source file that in turn includes RcppExports.cpp but
wraps it in the required preprocessor directives.

J.J.

On Thu, Feb 7, 2013 at 10:59 AM, Smith, Dale <[email protected]> wrote:
> 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/src/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
>
>
>
>
> _______________________________________________
> Rcpp-devel mailing list
> [email protected]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to