[Rcpp-devel] Is there an easy way to convert Rcpp code to pure cpp code to build a command line tool

Dale Smith dtsmith at mindspring.com
Thu May 4 16:30:13 CEST 2017


Wrap the Rcpp headers in an #if/#endif. That way, when you our outside of R, the Rcpp code is skipped.

I used this idea in 2013-2014 to build in R using Rcpp, and the same code in Visual Studio.

Dale Smith

-----Original Message-----
>From: Yue Li <gorillayue at gmail.com>
>Sent: May 4, 2017 10:16 AM
>To: rcpp-devel at lists.r-forge.r-project.org
>Subject: [Rcpp-devel] Is there an easy way to convert Rcpp code to pure cpp code to build a command line tool
>
>Dear List,
>
>This is probably a dumb question:
>
>Is there an easy way to convert Rcpp code to pure cpp code to build a command line tool?
>
>I was thinking about something similar to the 'python setup.py install’ thing. Once the software is built, the binary executable can be added to /usr/bin/ and invoked directly on command line without the R environment.
>
>I apologize as the question seems to be spoiled in that i could write everything in cpp in the first place ...
>
>many thanks!
>Yue
>
>
>_______________________________________________
>Rcpp-devel mailing list
>Rcpp-devel at lists.r-forge.r-project.org
>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list