On 12 January 2015 at 20:03, Maxime To wrote: | Hi all, | | I have a problem using simultaneously RCPP and Snow with Rstudio. The problem | only appears when I use Rstudio, and the code runs well when using RGUI. | I wrote a cpp function that I want to run in parallel. So I use Snow and | compile the function on each node as follow: | | library(parallel) | library(Rcpp) | library(RcppArmadillo) | cl = makeCluster(nnodes, type = "SOCK") | clusterEvalQ(cl, library(Rcpp)) | clusterEvalQ(cl, library(RcppArmadillo)) | clusterEvalQ(cl, setwd(my_path)) | clusterEvalQ(cl[i], sourceCpp("Rcpp/function.cpp")) | | The produced error is the following: | | Error in checkForRemoteErrors(lapply(cl, recvResult)) : | one node produced an error: Error 1 occurred building shared library. | | Have you ever had this problem? Is it necessary to configure Rstudio in a | particular way in order to make it work?
That is a "using snow (or package parallel) from within RStudio" question which has nothing to do with Rcpp. Please do not abuse this list. Wrap your code in a package, including the c++ sources, and install the package on each node. Then load that package on each node from snow or parallel. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel