R and rpy on OS X

1 view
Skip to first unread message

Hamptonio

unread,
May 3, 2007, 12:26:04 PM5/3/07
to sage-devel
Hi,

Although I don't use it myself, I think that incorporating R will be a
huge boost to SAGE, and so I have been trying to get R and rpy working
on OS X. I just managed to do it on an intel OS X machine, and since
it wasn't very easy I thought I would share my experience:

In building R from source, I ran configure with the option:

./configure --enable-R-shlib

I then set the environmental variable LD_LIBRARY_PATH to the bin
folder in the R installation.

I had more problems with rpy. Besides having gfortran installed, the
crucial step seemed to be fixing a path problem: when first running
"sudo python setup.py install" I had an error:

/usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/
MacOSX10.4u.sdk/usr/local/lib/libgcc_s.1.dylib referenced from: /
Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/R.framework/
Resources/lib/libR.dylib (checking for undefined symbols may be
affected) (No such file or directory, errno = 2)

So I created the folder(s) /Developer/SDKs/MacOSX10.4u.sdk/usr/local/
lib/ and copied the library in question over from /Developer/SDKs/
MacOSX10.4u.sdk/usr//lib/, where it did exist.

I still get a warning:

/usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/
MacOSX10.4u.sdk/usr/local/lib/libgfortran.2.dylib referenced from: /
Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/R.framework/
Resources/lib/libR.dylib (checking for undefined symbols may be
affected) (No such file or directory, errno = 2)

but at least most things seem to work.

-Marshall Hampton

Nick Alexander

unread,
May 3, 2007, 1:51:10 PM5/3/07
to sage-...@googlegroups.com
Hamptonio <hamp...@gmail.com> writes:

> Hi,
>
> Although I don't use it myself, I think that incorporating R will be a
> huge boost to SAGE, and so I have been trying to get R and rpy working
> on OS X.

I don't doubt that incorporating R would be nice, but AFAICT the
advantage to using R is its very nice slicing syntax. Providing such
flexible operators in Python is probably possible, so I'd like to
suggest that first efforts be focused on slicing.

Nick

boo...@u.washington.edu

unread,
May 3, 2007, 2:20:17 PM5/3/07
to sage-...@googlegroups.com
My favorite feature of R is that it has very robust data-fitting routines.

Hamptonio

unread,
May 3, 2007, 3:55:55 PM5/3/07
to sage-devel
If you are starting from scratch, that may be true. But there are
many, many stats folks out there with code, lectures, textbooks, etc.
written for R. The vast majority will not switch to something else
unless there is some back-compatability.

-Marshall Hampton

On May 3, 12:51 pm, Nick Alexander <ncale...@math.uci.edu> wrote:

Reply all
Reply to author
Forward
0 new messages