[R-SIG-Mac] Rscript on OSX

Don MacQueen macq at llnl.gov
Thu Jan 10 20:59:13 CET 2008


I'm a bit puzzled also. Rscript has been on my personal list of 
things to try out "some time soon" but I hadn't done so. Given Ido's 
question I decided to try it.

Is it somehow possible that the Rscript binary included with the CRAN 
binary installer is an intel binary, even though I installed on a ppc 
machine? See below for why I raise the possibility.


After installing R 2.6.1 from the CRAN binary installer, selecting 
default installation options, I get this:

[49]% Rscript --version
tcsh: /usr/local/bin/Rscript: Exec format error. Binary file not executable.

Command line R does work, and I get this:

>  sessionInfo()
R version 2.6.1 (2007-11-26)
powerpc-apple-darwin8.10.1

locale:
C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] rmacq_1.0-1


I believe my R and Rscript are from the same binary install of R 2.6.1:

[51]% which Rscript
/usr/local/bin/Rscript

[52]% ls -l /usr/local/bin/Rscript
lrwxr-xr-x   1 root  wheel  53B Oct 18 07:25 /usr/local/bin/Rscript@ 
-> /Library/Frameworks/R.framework/Resources/bin/Rscript

[53]% which R
/usr/local/bin/R

[54]% ls -l /usr/local/bin/R
lrwxr-xr-x   1 root  wheel  47B May  3  2007 /usr/local/bin/R@ -> 
/Library/Frameworks/R.framework/Resources/bin/R



On the other hand, when I build R from source, Rscript does work:

[100]% ./Rscript --version
R scripting front-end version 42724



Thanks
-Don

At 10:09 AM +0100 1/10/08, Ido M. Tamir wrote:
>Hi,
>
>I directed somebody to install R (2.6.1) on his OSX computer,
>following instructions from http://cran.r-project.org/bin/macosx.
>She used the provided binary image.
>She can run R from the console.
>
>The problem is that Rscript is not in the path (only minor, because ln -s is
>hopefully doable).
>But the script failed when I tried to put a hardcoded path to Rscript into the
>shebang line. And when I try to invoke it directly:
>
>>-bash: ./Rscript: cannot execute binary file
>
>On linux this works:
>>Rscript
>Usage: /path/to/Rscript [--options] [-e expr] file [args]
>
>--options accepted are
>....
>
>
>I would like to send her some Rscripts, but how can we make them
>run on her system?
>
>
>thank you very much,
>ido
>
>
>
>imaclab3:/Library/Frameworks/R.framework/Resources/bin ru$ ls -l
>
>total 1008
>-rwxrwxr-x   1 root  admin    1654 Nov 26 17:36 BATCH
>-rwxrwxr-x   1 root  admin    2188 Nov 26 17:36 COMPILE
>-rwxrwxr-x   1 root  admin   34391 Nov 26 17:36 INSTALL
>-rwxrwxr-x   1 root  admin    1593 Nov 26 17:36 LINK
>-rwxrwxr-x   1 root  admin    7210 Nov 26 17:37 R
>-rwxrwxr-x   1 root  admin    7210 Nov 26 17:37 R.orig
>-rw-rw-r--   1 root  admin     655 Nov 26 17:37 R.rej
>-rwxrwxr-x   1 root  admin    2244 Nov 26 17:36 REMOVE
>-rwxrwxr-x   1 root  admin     928 Nov 26 17:36 Rcmd
>-rwxrwxr-x   1 root  admin    9523 Nov 26 17:36 Rd2dvi
>-rwxrwxr-x   1 root  admin     842 Nov 26 17:36 Rd2txt
>-rwxrwxr-x   1 root  admin    3237 Nov 26 17:36 Rdconv
>-rwxrwxr-x   1 root  admin    1320 Nov 26 17:36 Rdiff
>-rwxrwxr-x   1 root  admin    2854 Nov 26 17:36 Rprof
>-rwxrwxr-x   1 root  admin   18084 Nov 26 17:36 Rscript
>-rwxrwxr-x   1 root  admin    4656 Nov 26 17:36 SHLIB
>-rwxrwxr-x   1 root  admin   16129 Nov 26 17:36 Sd2Rd
>-rwxrwxr-x   1 root  admin     730 Nov 26 17:36 Stangle
>-rwxrwxr-x   1 root  admin     726 Nov 26 17:36 Sweave
>-rwxrwxr-x   1 root  admin   21715 Nov 26 17:36 build
>-rwxrwxr-x   1 root  admin   78570 Nov 26 17:36 check
>-rwxrwxr-x   1 root  admin    6927 Nov 26 17:36 config
>drwxrwxr-x   4 root  admin     136 Nov 26 17:36 exec
>-rwxrwxr-x   1 root  admin    3613 Nov 26 17:36 f77_f2c
>-rwxrwxr-x   1 root  admin   10720 Nov 26 17:36 javareconf
>-rwxrwxr-x   1 root  admin  215101 Nov 26 17:36 libtool
>-rwxrwxr-x   1 root  admin    3495 Nov 26 17:36 mkinstalldirs
>-rwxrwxr-x   1 root  admin     413 Nov 26 17:36 pager
>
>_______________________________________________
>R-SIG-Mac mailing list
>R-SIG-Mac at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/r-sig-mac


-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062



More information about the R-SIG-Mac mailing list