Re: [Rcpp-devel] RCpp issue (SIGTRAP)

2014-12-10 Thread Amit Gupta
Hi all, Can anyone please help me in this. Thanks Amit On Tue, Dec 9, 2014 at 9:05 PM, Amit Gupta wrote: > Hi All, > > I am trying to integrate R in my C++ code . I was going through some test > examples in /RInside/inst/examples/standard/. I am able to reproduce the > results of example 7 on

Re: [Rcpp-devel] problems using libc++ on ubuntu

2014-12-10 Thread Dirk Eddelbuettel
On 10 December 2014 at 15:28, Mark Lilback wrote: | I’m trying to intall Rcpp using clang and libc++ instead of gcc and | libstdc++. However, something is adding =lstdc++ to the call to ld and I | can’t figure out what it is. Ubuntu happens to be my default setup -- but it managed to fsck up clan

[Rcpp-devel] problems using libc++ on ubuntu

2014-12-10 Thread Mark Lilback
I’m trying to intall Rcpp using clang and libc++ instead of gcc and libstdc++. However, something is adding =lstdc++ to the call to ld and I can’t figure out what it is. Here is the link command that is happening: vagrant@vagrant-ubuntu-trusty-64:/vagrant/Rcpp$ R CMD INSTALL --no-test-load -d

Re: [Rcpp-devel] Rcpp Parallel and Rcpp Armadillo

2014-12-10 Thread Dirk Eddelbuettel
On 10 December 2014 at 14:54, Maxime To wrote: | Ok, thanks, I'll try to build on it. In the example I tried to isolate the problem, but in my real program I have lot of other matrix step using armadillo, that's why I put it in that way... I'd like to avoid armadillo, but it makes matrix calcul

Re: [Rcpp-devel] Rcpp Parallel and Rcpp Armadillo

2014-12-10 Thread Maxime To
Ok, thanks, I'll try to build on it. In the example I tried to isolate the problem, but in my real program I have lot of other matrix step using armadillo, that's why I put it in that way... I'd like to avoid armadillo, but it makes matrix calculus messier... About the memory, it does not seem

Re: [Rcpp-devel] Rcpp Parallel and Rcpp Armadillo

2014-12-10 Thread Romain François
Some pointers. When you use an arma::mat passed by value in an Rcpp::export, this means copying all of the data of the underlying R object into armadillo. I’d suggest you use a reference to const to avoid that, i.e. mat contrib1(const mat& X1) { … } Then in pQnorm, you do: NumericMatrix x_

Re: [Rcpp-devel] Rcpp Parallel and Rcpp Armadillo

2014-12-10 Thread Maxime To
Hi, I changed the function as indicated by Dirk and I modify the functions and the program does work now. However, I am still puzzled by the memory use of the program. when I run a loop of my function in R as in the code below, it seems that the program does not free the memory used in the pre