[R-SIG-Mac] Compiling packages with specific gcc

Kasper Daniel Hansen khansen at stat.berkeley.edu
Tue May 5 20:08:46 CEST 2009


You will want to recompile R with the new compiler. Then, whenever you  
compile a package, it will use the same compiler as R was compiled with.

Mixing compilers might be possible using the hints from Duncan, but I  
am pretty sure it is discouraged.

In the past Simon has discouraged use of the HPC compilers. I don't  
remember the reasons, but I respect the source of the information :)  
He knows way more about mac compilers than I do. Of course, this was a  
while back and things might have changed.

Kasper

On May 5, 2009, at 10:05 , Steve Lianoglou wrote:

> Hi all,
>
> I'm wondering if/where I can go to tell R to use a specific version  
> of my gcc compiler when installing packages from source, via  
> `install.packages("...", type='source')` or when running `R CMD  
> INSTALL some_source_packge.tar.gz` from the command line.
>
> The reason I ask is because I've downloaded gcc-4.4 from HPC/OSX[1],  
> and it unfortunately puts the compilers in /usr/local/bin/gcc, w/o  
> version info (it would be nice if it were /usr/local/bin/gcc-4.4). R  
> tries to use this when compiling, but these compilers do not support  
> the "-arch=..." flags, so it bombs.
>
> I've been hunting around in the tools:::.install_packges code and  
> also the "R Installation and Adminstration"[2] document, but can't  
> find what I'm looking for. I have a feeling that perhaps I can put  
> something into my ~/.R/Makevars, or ~/.R/Makevars-i386-apple- 
> darwin8.11.1 file, but I'm just taking stabs at the dark, so not  
> having much luck.
>
> I can work around this by temporarily removing /usr/local/bin from  
> my path when trying to `R CMD INSTALL` packages by source, but I was  
> hoping there might be a more elegant solution. The fact that  
> installing by source gets the `make` command from the system  
> environment makes me a bit hopeful, but I'm not really sure.
>
> Thanks for any help,
>
> -steve
>
> [1] HPC/OSX: http://hpc.sourceforge.net/
> [2] R Install/admin: http://cran.r-project.org/doc/manuals/R-admin.html#Linear-algebra
>
> --
> Steve Lianoglou
> Graduate Student: Physiology, Biophysics and Systems Biology
> Weill Medical College of Cornell University
>
> http://cbio.mskcc.org/~lianos
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list