following lgautier's advice on rpy2 installation on Mac OSX, I posted my request on rpy-list and got in touch with Yair Benita who said he could only install rpy2 through his default Mac OS X python and wondered if I had not another version running.
In /usr/bin, I can actually find python, python2.5 and python2.6.
Asking which python, the default one is /usr/bin/python.
Running /usr/bin/python, I get that:
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information
I get the same answer running /usr/bin/python2.6
Is that ok or should I define a specific PYTHONPATH in my ~/.profile file?
Yair also suggested I defined the R variables correctly in my ~/.profile file:
export R_LIBS=/Library/Frameworks/R.framework/Versions/2.14/Resources/library
export R_HOME=/Library/Frameworks/R.framework/Versions/2.14/Resources
That didn't work either.
He finally stated I had a not found error he coudn't see.
Here is the log message I get running python setup.py build :
running build
running build_py
running build_ext
Configuration for R as a library:
include_dirs: ('/Library/Frameworks/R.framework/Resources/include', '/Library/Frameworks/R.framework/Resources/include/x86_64')
libraries: ('Rblas', 'Rlapack')
library_dirs: ('/Library/Frameworks/R.framework/Resources/lib/x86_64',)
extra_link_args: ('-framework R', '-F/Library/Frameworks/R.framework/..')
# OSX-specific (included in extra_link_args)
framework_dirs: ('-F/Library/Frameworks/R.framework/..',)
frameworks: ('-framework R',)
building 'rpy2.rinterface._rinterface' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -I./rpy/rinterface -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -c ./rpy/rinterface/_rinterface.c -o build/temp.macosx-10.6-universal-2.6/./rpy/rinterface/_rinterface.o
In file included from ./rpy/rinterface/_rinterface.c:63:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:79:
/Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:132:
./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:
./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’
./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’
./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’
./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’
./rpy/rinterface/_rinterface.c: At top level:
./rpy/rinterface/sequence.c:2173: warning: ‘ComplexVectorSexp_AsSexp’ defined but not used
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowFiles’:
./rpy/rinterface/_rinterface.c:748: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_FlushConsole’:
./rpy/rinterface/_rinterface.c:602: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ReadConsole’:
./rpy/rinterface/_rinterface.c:470: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_WriteConsole’:
./rpy/rinterface/_rinterface.c:328: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowMessage’:
./rpy/rinterface/_rinterface.c:402: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_CleanUp’:
./rpy/rinterface/_rinterface.c:896: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ChooseFile’:
./rpy/rinterface/_rinterface.c:646: warning: ‘gstate’ may be used uninitialized in this function
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:34,
from ./rpy/rinterface/_rinterface.c:61:
/Library/Frameworks/R.framework/Resources/include/Rconfig.h:5:25: error: ppc/Rconfig.h: No such file or directory
In file included from ./rpy/rinterface/_rinterface.c:62:
/Library/Frameworks/R.framework/Resources/include/Rversion.h:5:26: error: ppc/Rversion.h: No such file or directory
In file included from ./rpy/rinterface/_rinterface.c:63:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:79:
/Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:110:
./rpy/rinterface/r_utils.h:13: error: ‘R_MAJOR’ undeclared here (not in a function)
./rpy/rinterface/r_utils.h:13: error: ‘R_MINOR’ undeclared here (not in a function)
./rpy/rinterface/r_utils.h:13: error: ‘R_STATUS’ undeclared here (not in a function)
./rpy/rinterface/r_utils.h:14: error: ‘R_SVN_REVISION’ undeclared here (not in a function)
In file included from ./rpy/rinterface/_rinterface.c:132:
./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:
./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’
./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’
./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’
./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’
In file included from ./rpy/rinterface/_rinterface.c:63:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:657: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:79:
/Library/Frameworks/R.framework/Resources/include/R_ext/Rdynload.h:26: warning: function declaration isn’t a prototype
In file included from ./rpy/rinterface/_rinterface.c:132:
./rpy/rinterface/sequence.c: In function ‘VectorSexp_ass_slice’:
./rpy/rinterface/sequence.c:542: warning: unused variable ‘sexp_item’
./rpy/rinterface/sequence.c:542: warning: unused variable ‘tmp’
./rpy/rinterface/sequence.c:541: warning: unused variable ‘vs’
./rpy/rinterface/sequence.c:478: warning: unused variable ‘self_typeof’
./rpy/rinterface/_rinterface.c: At top level:
./rpy/rinterface/sequence.c:2173: warning: ‘ComplexVectorSexp_AsSexp’ defined but not used
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowFiles’:
./rpy/rinterface/_rinterface.c:748: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_FlushConsole’:
./rpy/rinterface/_rinterface.c:602: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ReadConsole’:
./rpy/rinterface/_rinterface.c:470: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_WriteConsole’:
./rpy/rinterface/_rinterface.c:328: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ShowMessage’:
./rpy/rinterface/_rinterface.c:402: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_CleanUp’:
./rpy/rinterface/_rinterface.c:896: warning: ‘gstate’ may be used uninitialized in this function
./rpy/rinterface/_rinterface.c: In function ‘EmbeddedR_ChooseFile’:
./rpy/rinterface/_rinterface.c:646: warning: ‘gstate’ may be used uninitialized in this function
lipo: can't open input file: /var/folders/5L/5Li0yCI7EqmkqJ+Ra--M9U+++TI/-Tmp-//cchTMCy0.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
I also tryed to install rpy2 through Macport with sudo port install py26-rpy2and got the following error message:
---> Computing dependencies for py26-rpy2
---> Dependencies to be installed: R cairo glib2 libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit openssl python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto xrender xorg-libX11 xorg-kbproto xorg-renderproto gcc45 cctools cctools-headers llvm-3.0 llvm_select gcc_select gmp ld64 libmpc mpfr ppl glpk icu jpeg pango Xft2 gobject-introspection readline tcl tiff tk xorg-libXScrnSaver xorg-libXext xorg-xextproto xorg-scrnsaverproto xorg-libXmu xorg-libXt xorg-libsm xorg-libice python26
---> Applying patches to glib2
Error: org.macports.patch for port glib2 returned: command execution failed
Error: Failed to install glib2
Please see the log file for port glib2 for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log
Error: The following dependencies were not installed: R cairo glib2 libpixman libpng xorg-xcb-util xorg-libxcb python27 db46 libedit openssl python_select sqlite3 xorg-libXau xorg-xproto xorg-libXdmcp xorg-libpthread-stubs xorg-xcb-proto xrender xorg-libX11 xorg-kbproto xorg-renderproto gcc45 cctools cctools-headers llvm-3.0 llvm_select gcc_select gmp ld64 libmpc mpfr ppl glpk icu jpeg pango Xft2 gobject-introspection readline tcl tiff tk xorg-libXScrnSaver xorg-libXext xorg-xextproto xorg-scrnsaverproto xorg-libXmu xorg-libXt xorg-libsm xorg-libice python26
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port py26-rpy2 failed
And on the log file for glib2 :
version:1
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 502
:debug:main euid changed to: 502
:debug:main Executing org.macports.main (glib2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.archivefetch (glib2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.fetch (glib2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.checksum (glib2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:main Skipping completed org.macports.extract (glib2)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:patch patch phase started at Mon Jul 16 11:43:43 CEST 2012
:debug:patch Executing org.macports.patch (glib2)
:notice:patch ---> Applying patches to glib2
:info:patch ---> Applying patch-configure.diff
:debug:patch Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.6'
:debug:patch Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0'
:debug:patch Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/glib2/files/patch-configure.diff'
:info:patch sh: line 0: cd: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3: No such file or directory
:info:patch Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.32.3" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/glib2/files/patch-configure.diff'
:info:patch Exit code: 1
:error:patch org.macports.patch for port glib2 returned: command execution failed
:debug:patch Error code: CHILDSTATUS 4581 1
:debug:patch Backtrace: command execution failed
while executing
"system $fullcmdstring"
("eval" body line 1)
invoked from within
"eval system $notty $nice \$fullcmdstring"
invoked from within
"command_exec patch "" "< '$patch'""
(procedure "portpatch::patch_main" line 35)
invoked from within
"$procedure $targetname"
:info:patch Warning: targets not executed for glib2: org.macports.activate org.macports.patch org.macports.configure org.macports.build org.macports.destroot org.macports.install
:error:patch Failed to install glib2
:debug:patch couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
while executing
"open [file join $dir tclIndex]"
:notice:patch Please see the log file for port glib2 for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/main.log
Has anybody another idea about what I could try ?
Thanks a lot
stan

