Thank you for clarify all this for me. 

If I understand correctly. I can build R from scratch with any compilers 
support  required language features (like F95 or partial C99). And use those 
compilers to install packages from source. In this way I can take any 
advantaged may provid by those compilers or library like MKL. 

However, if I want to use the distributed binary version of R, I have to use 
the same compiler configuration to build package or use the binary version 
package distributed from CRAN.

Hope I get the right idea.


On 28 Apr 2010, at 22:39, Simon Urbanek wrote:

> 
> On Apr 28, 2010, at 4:26 PM, Yan Zhou wrote:
> 
>> I have a some sort silly question. Which fortran compiler is usable with R, 
>> e.g., building package from source.
>> 
>> I intended to install the gfortran from CRAN. But noticed that it will 
>> install cc1 and the text in installer stated that it is not recommended to 
>> install it with Xcode later than 3.2. I have 3.2.2 installed right now.
>> 
> 
> Apple has not released Xcode 3.2.2 sources yet so we cannot build the 
> corresponding version. What you can do (if you want) is to save the cc1 from 
> Xcode and install the Fortran anyway.
> 
> That said, you don't have to. You can equally well use the separate Fortran 
> from CRAN
> http://cran.us.r-project.org/bin/macosx/tools/
> if you want. (It's not how we build R anymore but it also works - at least 
> with R 2.11.0)
> 
> 
>> Besides I find on the website that gfortran from HPC will not work.
>> 
>> So my question is that, what is the problem with the HPC version of 
>> gfortran. What is the criteria for a fortran compiler to be usable with R.
> 
> It must support Apple driver's driver (for things like -arch ppc -arch i386 
> etc.) and have the corresponding cross-compilers included so you can build 
> universal binaries. The HPC fortran is typically a single-host same-target 
> compiler so it won't be able to do that (and has no Apple driver). In 
> addition HPC compilers used to be a mess - they mostly didn't work at all due 
> to library issues and cross-OS pollution, but I didn't test them lately, so 
> may be things have improved in the meantime.
> 
> 
>> I have intel fortran compiler installed. I managed to use it to compile a 
>> usable R-devel build from source. However, successful compiling doesn't 
>> imply that the generated code has no problem.
>> 
> 
> If you build R from scratch from sources, there is no issue - you can use 
> almost anything. What we are talking about is CRAN R binary - and by 
> definition you can only use compilers that are compatible to the compilers 
> used to compile that binary. That's what the recommended compilers are about. 
> If you build your own R, you can use whatever flags you wish, so you can get 
> different compilers to work -- but you won't be able to install package 
> binaries from CRAN (in general).

> I hope it helps.
> 
> Cheers,
> Simon
> 

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to