[R-SIG-Mac] gfortran error: unrecognized command line option "-arch"

Markus Baden mbaden at student.ethz.ch
Sun Jun 15 15:11:00 CEST 2008


Hi again,

I want to apologize for posting my question prematurely to the list. I  
have been able to find the problem. R tried to compile using the  
gfortran of my fink distribution which came with gcc 4.3. Linking  
gfortran instead to the compiler provided by the R-2.7.0.dmg (/usr/ 
local/bin/gfortran-4.2) which is version 4.2 solved the problem.

Now the packages install correctly.

Sorry again,

Markus

On Jun 15, 2008, at 1:55 PM, Markus Baden wrote:

> Hi,
>
> I'm using R version 2.7.0 (2008-04-22) on my MacBook Pro running Mac  
> OS X.5.2. I installed R using the universal binary from CRAN, so I  
> guess my R uses the gfortran compiler provided in the binary  
> although I have also have a gfortran coming with my fink installation.
>
> When installing packages from source I often get the error message  
> "unrecognized command line option "-arch". Like in:
>
> gfortran -arch ppc  -isysroot /Developer/SDKs/MacOSX10.4u.sdk   - 
> fPIC  -g -O2 -c rf-common.f -o rf-common.o
> f951: error: unrecognized command line option "-arch"
> make: *** [rf-common.o] Error 1
>
> Does anyone now how to fix this?
>
> Below is an example with the package "robustbase" (of course you can  
> install the mac.binary from CRAN, and I have successfully done so,  
> this just illustrates the error I get also from different packages  
> like fAsset which are not available as mac.binary)
>
> Best regards,
>
> Markus
>
> Example session:
>
> > install.packages("robustbase", type="source")
> Warning in install.packages("robustbase", type = "source") :
>  argument 'lib' is missing: using '/Users/mbaden/Library/Rmetrics- 
> devel'
> --- Please select a CRAN mirror for use in this session ---
> trying URL 'http://cran.ch.r-project.org/src/contrib/robustbase_0.2-8.tar.gz'
> Content type 'application/x-gzip' length 372375 bytes (363 Kb)
> opened URL
> ==================================================
> downloaded 363 Kb
>
> * Installing *source* package 'robustbase' ...
> ** libs
> ** arch - i386
> gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/i386  -msse3    -fPIC  -g -O2 -march=nocona -c R-rng4ftn.c - 
> o R-rng4ftn.o
> gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/i386  -msse3    -fPIC  -g -O2 -march=nocona -c init.c -o  
> init.o
> gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/i386  -msse3    -fPIC  -g -O2 -march=nocona -c lmrob.c -o  
> lmrob.o
> gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/i386  -msse3    -fPIC  -g -O2 -march=nocona -c qn_sn.c -o  
> qn_sn.o
> gfortran -arch i386  -isysroot /Developer/SDKs/MacOSX10.4u.sdk   - 
> fPIC  -g -O2 -march=nocona -c rf-common.f -o rf-common.o
> f951: error: unrecognized command line option "-arch"
> make: *** [rf-common.o] Error 1
> chmod: /Users/mbaden/Library/Rmetrics-devel/robustbase/libs/i386/*:  
> No such file or directory
> ** arch - ppc
> gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/ppc  -I/usr/local/include    -fPIC  -g -O2 -c R-rng4ftn.c -o  
> R-rng4ftn.o
> gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/ppc  -I/usr/local/include    -fPIC  -g -O2 -c init.c -o init.o
> gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/ppc  -I/usr/local/include    -fPIC  -g -O2 -c lmrob.c -o  
> lmrob.o
> gcc -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx- 
> version-min=10.4 -std=gnu99 -I/Library/Frameworks/R.framework/ 
> Resources/include -I/Library/Frameworks/R.framework/Resources/ 
> include/ppc  -I/usr/local/include    -fPIC  -g -O2 -c qn_sn.c -o  
> qn_sn.o
> gfortran -arch ppc  -isysroot /Developer/SDKs/MacOSX10.4u.sdk   - 
> fPIC  -g -O2 -c rf-common.f -o rf-common.o
> f951: error: unrecognized command line option "-arch"
> make: *** [rf-common.o] Error 1
> chmod: /Users/mbaden/Library/Rmetrics-devel/robustbase/libs/ppc/*:  
> No such file or directory
> ERROR: compilation failed for package 'robustbase'
> ** Removing '/Users/mbaden/Library/Rmetrics-devel/robustbase'
> ** Restoring previous '/Users/mbaden/Library/Rmetrics-devel/ 
> robustbase'
>
> The downloaded packages are in
> 	/private/var/folders/dZ/dZrLO5okHT4aCUifqJnpVk+++TI/-Tmp-/ 
> Rtmp2TObol/downloaded_packages
> Warning message:
> In install.packages("robustbase", type = "source") :
>  installation of package 'robustbase' had non-zero exit status
>
> _______________________________________________
> 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