[Rcpp-devel] Attribute does not compile with 'compileAttributes' but with 'sourceCpp'

Simon Zehnder szehnder at uni-bonn.de
Fri Nov 1 17:12:04 CET 2013


Hi Dominick,

I did install files from brew but instead used the gcc from http://hpc.sourceforge.net


On 01 Nov 2013, at 16:55, Dominick Samperi <djsamperi at gmail.com> wrote:

> If you depend on tools installed using brew, you might want to try
> removing those that were installed before the Mavericks update,
> using:
> rm -rf /usr/local/Cellar
> brew prune
> brew doctor
> brew install <what-you-need>
> 
> 
> On Fri, Nov 1, 2013 at 11:19 AM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
> Point landing J.J.!
> 
> I already compiled a new R when Mavericks came out with a newly installed a gcc-4.8.2, that I can load via environment modules. I also installed the Xcode Command Line Tools for Mavericks.
> 
> I now reinstalled Rcpp with the gcc-4.8.2 and threw away all object and shared-object files in my /src/ folder of my package. The problem remains. Is there something special I can look for in my Makeconf file? What is so different about ‘compileAttributes’ in contrast to ‘sourceCpp’ or a usual package compilation via R CMD INSTALL? Does compileAttributes uses some additional flags and/or libraries?
> 
> Best
> Simon
> 
> 
> 
> On 01 Nov 2013, at 15:56, JJ Allaire <jj.allaire at gmail.com> wrote:
> 
> > Are you by any chance on OS X Mavericks? I had one other user report this specific error on Mavericks and it seemed to be related to the use of different compilers (and thus different heaps) within the same compilation (there is exposure to this with the changes made by Apple to the toolchain in Mavericks).
> >
> > J.J.
> >
> >
> > On Fri, Nov 1, 2013 at 10:01 AM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
> > Dear Rcpp::Users and Rcpp::Devels,
> >
> > I get a weird exception when I try to compile an attribute in one of my packages:
> >
> > compileAttributes("/Users/simonzehnder/git/mmstruct/mmstruct/")
> > R(6256,0x7fff79ad9310) malloc: *** error for object 0x7fff7ac48330: pointer being freed was not allocated
> > *** set a breakpoint in malloc_error_break to debug
> > Abort trap: 6
> >
> > If I instead use the sourceCpp function all works fine:
> >
> > sourceCpp("/Users/simonzehnder/git/mmstruct/mmstruct/src/testing.cpp”)
> > testfunction_cc(c(0,0,0), list(trades = rnorm(10), T = 360))
> > [1] 0.000000e+00 3.509927e-05 1.169976e-05
> >
> > The function in my file is actually pretty simple (and its the only one):
> >
> > #include<Rcpp.h>
> >
> > // [[Rcpp::export]]
> >
> > Rcpp::NumericVector testfunction_cc(Rcpp::NumericVector par,
> >         Rcpp::List list)
> > {
> >     const unsigned int K        = par.size();
> >     Rcpp::NumericVector trades  = list["trades"];
> >     const unsigned int T        = list["T"];
> >     double tmp = mean(trades)/T;
> >     std::vector<double> startp(K);
> >     startp[0] = 0.0;
> >     startp[1] = tmp * 0.75/2;
> >     startp[2] = tmp * 0.25/2;
> >
> >     return Rcpp::wrap(startp);
> > }
> >
> > At this moment I am a little perplexed. Where should I search for a possible error? What are things to try out?
> >
> > Best
> >
> > Simon
> >
> > _______________________________________________
> > 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
> >
> 
> _______________________________________________
> 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