Rcpp and default C++ compiler

后端 未结 2 432
一向
一向 2021-01-02 01:26

I have some strange troubles with Rcpp - it uses unpredictable C++ compiler. This question is somewhat similar to this question.
I\'m on OSX, I have 2 complilers - defau

相关标签:
2条回答
  • 2021-01-02 01:35

    I only read one line of your question and stopped there:

    I have some strange troubles with Rcpp - it uses unpredictable C++ compiler

    That is both wrong and also inflammatory. Please read the R documentation included with your version of R and learn how R sets these things.

    Rcpp does nothing extra. All this is default R behaviour:

    • As a user you can set this in ~/.R/Makevars

    • As a package author aiming for portable and CRAN-compatible packages you cannot but have to use, say, configure at package built-time.

    This is all documented and has been discussed before.

    0 讨论(0)
  • 2021-01-02 01:47

    Thanks, to @Dirk hint, I finaly got an answer. Hope, this will save a little bit of time for somebody. Following two lines in ~/.R/Makevars solved my problem:

    CXX1X=clang-omp++
    

    See details in this Writing R Extensions section.

    0 讨论(0)
提交回复
热议问题