[R-SIG-Mac] r_arch

Simon Urbanek simon.urbanek at r-project.org
Thu Jun 14 20:13:29 CEST 2007


On Jun 14, 2007, at 1:29 PM, Kasper Daniel Hansen wrote:

> I am using the CRAN binary of R-2.5.0 together with the supplied
> gfortran and the latest Xcode on a PPC mac running OS X 10.4.9. In my
> ~/.profile I have
>    export R_ARCH=/ppc
>

FWIW it's superfluous and has no effect on ppc machines, see below.


> It seems as if the default of R nowadays is to build universal
> binaries of packages. At least when I try to install a source package
> on my PPC system, it starts by stating
> ** arch - i386
> and then calls g++-4.0 with "-arch i386" (this is for a package
> containing C++ code). Later on it says
> ** arch - ppc
> and then calls g++-4.0 with "-arch ppc".
>
> I now have a couple of questions:
>
> 1) How do I make R only compile the ppc binaries - there is not much
> use for doing the i386 compilation when I install it on my powerbook
> and since it is slow at compiling, I would like to avoid this
> (especially in package development). I have (as stated above) set
> R_ARCH (perhaps wrongly) and have also tried with a
>    R --arch=ppc CMD INSTALL
> as per R-admin. And can I get that setting "stored" somewhere - it
> seems as if the default build for the CRAN binary is for the i386
> achitecture.
>

There is no "default build". The CRAN version of R is modified in  
that respect that the R start script has
: ${R_ARCH=/`arch`}
so the default r_arch is ppc in your case (this is why typing R  
actually works).

As of builds, the archs are built in an alphabetical order (and i  
comes before p).

If you don't mind having single-arch R, you can just remove $R_HOME/ 
bin/exec/i386, that should cause INSTALL to forget about i386.  
Previous CRAN binaries used a modified INSTALL script that didn't  
build i386 on ppc, because ppc systems lack i386 libraries. R 2.5.0  
binary now uses 10.4u SDK so you can build i386 binaries and hence we  
use the regular INSTALL script from R.


> 2) I am also the maintainer of the Bioconductor package affxparser.
> That package has subdirectory of the /src directory containing an
> entire SDK. In the /src directory we have a Makevars file containing
> additional targets so that the SDK files (in /src/fusion_sdk and
> subdirectories) gets compiled. This used to work. But these days, if
> I compile the package under PPC, it only compiles everything in /src/
> fusion_sdk with -arch i386. The additional PPC run only compiles the
> files in /src.


R cleans up only src. If you have object files in other places, you  
have to clean them yourself or use R_ARCH for the build or a dependency.

FWIW: this behavior is in place for several releases now, so I'm  
wondering you didn't notice it earlier ... ;)

Cheers,
Simon



More information about the R-SIG-Mac mailing list