R语言更换新的C++编译器

2020-06-16 00:00:00 语言 专区 编译 安装 编译器

先前推介的Rcpp for everyone书中介绍了更换编译器的方法。

2.1.4 Using other compilers installed by yourself
If you installed other compiler (g++, clang++) different from above, create the following file under the user’s home directory. Then set environment variables in the file.
Linux, Mac
.R/Makevars
Windows
.R/Makevars.win
Example settings of environmental variables
CC=/opt/local/bin/gcc-mp-4.7
CXX=/opt/local/bin/g++-mp-4.7
CPLUS_INCLUDE_PATH=/opt/local/include:$CPLUS_INCLUDE_PATH
LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH
CXXFLAGS= -g0 -O2 -Wall
MAKE=make -j4

Building R for Windows上面的Rtools有一段时间没有更新,里面的GCC还是4.9.3版。一直想让Rcpp用上新的GCC? ? ? ,但是没有真正动手???

PS C:\Users\cheng> gcc --version
gcc.exe (x86_64-posix-seh, Built by MinGW-W64 project) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

相关文章