[Pythonmac-SIG] RPy and libR.dylib
Jeff Whitaker
jsw@cdc.noaa.gov
Fri, 8 Mar 2002 06:49:37 -0700 (MST)
Jack: All I can say is what worked for me. When I first tried importing
rpy with the unmodified R installation, python couldn't find libR.dylib. I
fixed that by adding the "install_name". But then, I got undefined symbol
errors in R_X11.so - because of the "-bundle_loader" argument, dyld was
expecting them to be defined by R. Simply removing the "bundle_loader"
produced undefined symbol errors in the R compile, so I added the
"flat_namespace" stuff and everything worked.
So, to summarize, libR.dylib and R_X11.so were initially compiled with
two-level namespaces - for me, this was the source of the problem rather
than the solution.
Gerry (or anyone else) - please let me know whether this works for you.
-Jeff
On Fri, 8 Mar 2002, Jack Jansen wrote:
> Jeff,
> are you sure this isn't the revrse patch? Gerry's problam was that he
> had a multiple-defined "_main", and that could be solved by *removing*
> -flat_namespace (if it was in there in the first place), not by adding
> it...
>
> On Friday, March 8, 2002, at 01:47 , Jeff Whitaker wrote:
>
> >
> > Gerry: Here's a patch for R that did the trick for me.
> >
> > --- R-1.4.1/configure.orig Thu Mar 7 17:37:52 2002
> > +++ R-1.4.1/configure Thu Mar 7 17:40:59 2002
> > @@ -11636,7 +11636,7 @@
> > darwin1.3)
> > shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;;
> > *)
> > - shlib_ldflags="-bundle -bundle_loader \$(R_HOME)/bin/R.bin" ;;
> > + shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;;
> > esac
> > shlib_cxxldflags="${shlib_ldflags}"
> > ;;
> > @@ -11823,7 +11823,7 @@
> > case "${host_os}" in
> > darwin*)
> > LIBR_EXT=".dylib"
> > - LIBR_LDFLAGS="-dynamiclib"
> > + LIBR_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress
> > -install_name
> > ${prefix}/lib/R/bin/libR.dylib"
> > ;;
> > esac
> >
> > If you install R with fink, just wait for a new revision to show up in
> > unstable CVS (I'll upload it later today).
> >
> >
> > After rebuilding R with this patch, rpy works fine for me.
> >
> > -Jeff
> >
> > --
> > Jeffrey S. Whitaker Phone : (303)497-6313
> > Meteorologist FAX : (303)497-6449
> > NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov
> > 325 Broadway Web : www.cdc.noaa.gov/~jsw
> > Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124
> >
> >
> > _______________________________________________
> > Pythonmac-SIG maillist - Pythonmac-SIG@python.org
> > http://mail.python.org/mailman/listinfo/pythonmac-sig
> >
> --
> - Jack Jansen <Jack.Jansen@oratrix.com>
> http://www.cwi.nl/~jack -
> - If I can't dance I don't want to be part of your revolution -- Emma
> Goldman -
>
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov
325 Broadway Web : www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124