Re: [Rcpp-devel] cmake

2012-12-14 Thread Richard Downe
I'll do that. I may use JJ's stuff as a starting point as well, but I'll look at the RInside stuff and drop Peter a line as appropriate. It may also be worthwhile to talk to the cmake project, and see if they'd be interested in including whatever we to put together, so that cmake would by de

Re: [Rcpp-devel] cmake

2012-12-14 Thread Dirk Eddelbuettel
On 14 December 2012 at 13:51, Richard Downe wrote: | I use cmake for all my makefile generation. I realize there are other | good tools out there; cmake meets my needs rather well, and I'm happy | with it. | | Most libraries I use in my development (cgal, python, perl, swig, | vtk/itk, etc) a

Re: [Rcpp-devel] cmake

2012-12-14 Thread Richard Downe
That actually looks rather perfect. Thanks! -rd On 12/14/2012 01:54 PM, JJ Allaire wrote: We wrote one for RStudio, not sure if it will fully meet your needs but it's at least a starting point: https://github.com/rstudio/rstudio/blob/master/cmake/modules/FindLibR.cmake On Fri, Dec 14, 2012 at

Re: [Rcpp-devel] cmake

2012-12-14 Thread JJ Allaire
We wrote one for RStudio, not sure if it will fully meet your needs but it's at least a starting point: https://github.com/rstudio/rstudio/blob/master/cmake/modules/FindLibR.cmake On Fri, Dec 14, 2012 at 11:51 AM, Richard Downe wrote: > I use cmake for all my makefile generation. I realize ther

[Rcpp-devel] cmake

2012-12-14 Thread Richard Downe
I use cmake for all my makefile generation. I realize there are other good tools out there; cmake meets my needs rather well, and I'm happy with it. Most libraries I use in my development (cgal, python, perl, swig, vtk/itk, etc) are supported by FindXXX.cmake files that make dependency locat

Re: [Rcpp-devel] Wrapping a C struct in C++ for constructor/destructor

2012-12-14 Thread Richard Downe
Since cholmod has specific functions for all the allocation/free tasks involved in the different data structs, if you're really ambitious, you could probably create a templated mgr c++ class, where the template args are the specific memory management functions for the wrapped struct. Then you

Re: [Rcpp-devel] Wrapping a C struct in C++ for constructor/destructor

2012-12-14 Thread Romain Francois
I would create a class that contains a pointer to the c struct. This obviously leaves the problem of freeing the memory, i.e does the c++ object own the pointer. Maybe a strategy using some reference counting smart pointer. In RcppEigen we have not resolved this, we simply exposed a free met

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-14 Thread Honglang Wang
Thanks, Romain. Best wishes! Honglang Wang Office C402 Wells Hall Department of Statistics and Probability Michigan State University 1579 I Spartan Village, East Lansing, MI 48823 wangh...@msu.edu On Fri, Dec 14, 2012 at 11:04 AM, Romain Francois wrote: > I dont know. This looks like a deeply

[Rcpp-devel] Wrapping a C struct in C++ for constructor/destructor

2012-12-14 Thread Douglas Bates
This is more a C++ question than an Rcpp question although, of course, the application will be through Rcpp. I want to use C functions defined in the CHOLMOD package using Rcpp. The arguments to these functions and the returned values are usually pointers to C structs. There are several such stru

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-14 Thread Romain Francois
I dont know. This looks like a deeply hidden problem. Maybe you can enable some rcpp debugging by adding #define RCPP_DEBUG_LEVEL 1 Before you include Rcpp.h, this will give you verbose output, maybe this will help locating the issue. Romain Envoyé de mon iPhone Le 14 déc. 2012 à 16:31,

Re: [Rcpp-devel] How to free memory in Rcpp

2012-12-14 Thread Honglang Wang
Hi Romain, Thanks very much. I tried your method. And now the old error has gone, which is really good for me. But a new error is : Error in betahat(ker, x, X, y, t, h, m) : (list) object cannot be coerced to type 'double' Calls: system.time ... apply -> FUN -> betahat -> .External -> cpp_excepti

[Rcpp-devel] Wrapping a C struct in a C++ class/struct

2012-12-14 Thread Douglas Bates
This is more of a C++ question than an Rcpp question ___ 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

Re: [Rcpp-devel] iak problem -- dyn.load unable to load shared object

2012-12-14 Thread Glenn Lawyer
Thanks, Dirk, Romain, for your insights. The problem was the following line in my .bashrc export PKG_CPPFLAGS='-I/TL/opt/R-2.13.2/library/Rcpp/include' which included Rcpp 0.9.0 in the compilation, creating the undefined symbol (since Rcpp 0.10.1 has a different signature for r_vector_start).