[R] Where is the R configuration file or how to override R compilers

Berend Hasselman bhh at xs4all.nl
Sun Sep 16 21:01:24 CEST 2012


On 16-09-2012, at 20:47, Eberle, Anthony wrote:

> I have a question about how one can modify or override the compilers
> that R uses for package installations?  Or if perhaps this configuration
> is in some editable file somewhere.
> 
> Initially I built the version of R 2.15.1 on Solaris SPARC (virtual T4),
> but found out the build was done as 32 bit.  After some research, I
> found that the pre-compiled GCC version I had only allowed for 32 bit.
> I wanted 64 bit.  Therefore I ended up download the SunStudio compilers
> (12.1 version) and was able to export the compiler commands (per the R
> manual) and get a 64 bit version running.  The problem I have now is
> that I am trying to install the GBM package from CRAN (and from source
> as well.)  What I find is that something keeps trying to run "c++"
> during compilation.  Since I only have the SUN compiler the file is
> named "CC" not "c++".  How do I override this?
> 
> I've tried the following with no success:
> 1. EXPORT CXX to point to my CC compiler (eg export
> CXX='/opt/SUNWspro/bin/CC')
> 2. Create an alias to c++ (eg alias c++='/opt/SUNWspro/bin/CC')
> 3. I even tried to create a symlink for g++: ln -s /opt/SUNWspro/bin/CC
> c++

Assuming you mean the gbm package. I had a look in the src directory of that package.
There are .cpp files, which are C++ source files so it's not surprising that a C++ compiler is required. 
That's why R wants to use c++.

Berend



More information about the R-help mailing list