[Rcpp-devel] problem compiling package using Rcpp

Dirk Eddelbuettel edd at debian.org
Thu Jan 3 04:38:56 CET 2013


On 2 January 2013 at 18:09, Nick Matzke wrote:
| Thanks very much for the reply.  Apologies for the 
| non-reproducibility, normally I attempt to do that, but in 
| this case I had no idea what piece of thousands of lines of 
| code was causing the problem due to the vague compiler error 
| message.  So I was just looking for hints.
| 
| And, you provided a good one -- it was indeed my build 
| setup.  In case anyone on the interwebs ever has something 
| similar, the full explanation:
| 
| To automate compiling packages with different compile flags 
| (e.g. sometimes I have to use g++4.6 instead of g++4.2), I 
| have a hack that copies a custom Makevars text file to the 
| directory where R can see it:
| 
| /Users/nickm/.R/Makevars
| 
| The compile flags for this package had lines like:
| 
| CPPFLAGS = -I/usr/local/include 
| -I/Library/Frameworks/R.framework/Resources/include 
| -I/Library/Frameworks/R.framework/Resources/include/x86_64 
| -I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include 
| -I/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RcppArmadillo/include 
| -lf2c -lm

With all due respect, that is 

     a) wrong as you can (should!!) use the LinkingTo: field 
        in the package's DESCRIPTION and 

     b) confused as you are mixing library arguments and include
        arguments  (hint: "-lf2c -lm" are useless in CPPFLAGS)

| ...but of course these no longer worked once I installed 
| 2.15 and new Rcpp and RcppArmadillo inside 2.15!!
| 
| 
| While playing with this, I encountered additional problems 
| due to permissions, it turns out when I re-installed R, 
| /usr/bin/R was recreated with owner root, making copied 
| files have owner root, resulting in problems later.  chown 
| fixed that.

What are talking about?  That makes no sense.

| So that's it - yes I probably would have gotten there 
| eventually but the hint helped.
| 
| Sorry also for the long sig, it's mostly so I can find all 
| my own dang information like my departmental fax number. And 

Last I heard Google even worked in Berkeley.

| it's a running joke at this point here, I'd hate to 
| disappoint people. :)

Like so many jokes, it will get old by the Nth repetition.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list