Question
I'm trying to tell my package to use gcc
to compile the C++
code in stead of clang
. Why aren't my CXX
flags in my Makevars
file being used?
(I am expecting/hoping the solution to be something really simple that I've overlooked.)
It's my understanding (see references) that I can specify CXX*
flags in either
src/Makevars
in the package, or~/.R/Makevars
However, I can't get option 1 to work, only option 2.
Example Builds
Here are screenshots showing the build options I'm using. In each case I'm showing both the Makevars
and the /.R/Makevars
files to show which one I'm using in each case.
Option 1: src/Makevars
Here I specify CXX11 = /usr/local/bin/g++-7
inside src/Makevars
. The build messages say it's building with clang
Option 2: ~/.R/Makevars
Here I specify CXX11 = /usr/local/bin/g++-7
inside ~/.R/Makevars
. The build message shows it builds with g++
Example package
I've noticed this on a few packages I've built recently using Rcpp
, but if you want an example to test my googlePolylines
package is here on github.
References
Session Info
devtools::session_info()
Session info ----------------------------------------------------------------------------------------------
setting value
version R version 3.4.3 (2017-11-30)
system x86_64, darwin15.6.0 ## Mac OS
ui RStudio (1.1.414)
language (EN)
collate en_AU.UTF-8
tz Australia/Melbourne
date 2018-03-11