Building R Packages using Alternate GCC

后端 未结 4 1827
半阙折子戏
半阙折子戏 2020-12-01 02:57

The systems I work with have GCC 4.5 (experimental) in /usr/local/bin/gcc which has proven to be problematic for some R packages. I would like to instead use system GCC in /

4条回答
  •  感情败类
    2020-12-01 03:52

    This is not that well documented (e.g. I failed to locate it in either 'R Extension' or 'R Admin' right now) but Brian Ripley mentioned it a few times on the lists.

    Basically, at R compile time, settings are registered and the stored in $R_HOME/etc/Makeconf. One possibility is to edit that file directly, but you may not have root privileges or may not want to affect all other users. So the better may be to create

    ~/.R/Makevars
    

    with entries

    CC=gcc-4.4
    CXX=g++-4.4
    

    plus whichever optmisation flags etc you want to set. That will the affect all subsequent uses of R CMD INSTALL or R CMD check or ... that you run.

    Other files in $R_HOME/etc/ can similarly be overridden locally from ~/.R/.

提交回复
热议问题