[Rcpp-devel] How to tell sourceCpp where to store the created shared library and linking R-code?
Sorry, ?loaded? was the right term to use here. I?m not an expert in R- or Rcpp-packaging. I guess that this is something frequently done, so is there a way to do what I want, namely, create a shared library from my C++ file, wrap it into an R-package and install it in my current R-installation with a short R-script? Thanks both of you for answering. Best, Venelin
On 24 Apr 2014, at 17:52, Dirk Eddelbuettel <edd at debian.org> wrote:
On 24 April 2014 at 17:47, Mitov Venelin wrote: | Hello, | | I?m using sourceCpp to build a shared library from a C++ file on a linux server. This shared library has to be linked by many R-processes, so it would be a serious waste if one would rebuild/relink the library from source in each of these processes. On a Windows machine I can find the library in a temporary directory, copy it together with its corresponding R-linking file in the R-project directory and change the directory-path in the R-linking file to the project-directory. On the linux server I?m using, however, the temporary directory seems to be deleted after the build has finished. | It would be nice, if one could specify an output directory during the call to sourceCpp, but I didn?t find an argument about that in the sourceCpp documentation. Is there a way to do it? When you say "has to be linked by many R proceses" you probably mean "needs to be loaded by many R processes" R offers the package system for this, and Rcpp has always encouraged you to created packages. This is no different and not a job for sourceCpp(). Dirk -- Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com