Skip to content
Prev 2776 / 15075 Next

rpy on macbook

On Jun 5, 2006, at 4:33 PM, Ruedi Fries wrote:

            
This is not really Mac specific - the version string changed in R  
2.3.0 so rpy_tools needs to be adjusted:

--- rpy_tools.py        2006-06-08 23:47:09.000000000 +0200
+++ rpy-0.99.2/rpy_tools.py     2006-06-08 23:47:55.000000000 +0200
@@ -99,6 +99,8 @@
                           " `%s'.\n" % rexec )
      version = re.search("R +([0-9]\.[0-9]\.[0-9])", output)
      if not version:
+      version = re.search("R version +([0-9]\.[0-9]\.[0-9])", output)
+    if not version:
        raise RuntimeError("Couldn't obtain version number from output 
\n"
                                 "of `R --version'.\n")
      rver = version.group(1)
^^ - although irrelevant (gcc ignores it) Rpy includes Windows linker  
paths here - a bad idea :)
For some reason you (or Rpy or python) is using the MacOSX10.4u SDK.  
If you want to do so, you have to make sure that R is included in the  
SDK. Probably the easiest solution is something like

sudo ln -s /Library /Developer/SDKs/MacOSX10.4u.sdk/Library
Another problem - you must use the gcc 4.0.3 compiler to compile Rpy,  
otherwise wrong libraries will be pulled. Make sure it's first on the  
PATH, like

export PATH=/usr/local/gcc4.0/bin:$PATH

before compiling Rpy. To make things even more complicated, Rpy/ 
python uses flags that are Apple-only and thus incompatible with that  
compiler (at least on my PPC Mac). If that is the case for you,  
you'll need a filter that strips those parameters. You can install it  
as follows:

curl -O http://www.rosuda.org/gccf.c
gcc -s -o gcc gccf.c
sudo rm -f /usr/local/gcc4.0/bin/gcc
sudo cp gcc /usr/local/gcc4.0/bin/gcc

I'm currently on the road without access to an Intel Mac so I can do  
the forensics on my PowerMac only - let me know if you encounter  
other problems (and the above works for me).

Cheers,
Simon