Search code examples
c++crmakefile

Compile R package with clang in ubuntu


Currently I am using ubuntu.

By default R uses g++ to compile c/c++ code in a R package.

How can I force R to use clang++/clang?


Solution

  • http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2012-August/004208.html

    i) clang -- and I do from time to time test with clang which works just fine "as is", ie on my Linux box I simply say this in ~/.R/Makevars

    CXX=clang++
    CC=clang
    

    Thanks Dirk!