From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1O2X4g-0008QN-2W for garchives@archives.gentoo.org; Thu, 15 Apr 2010 21:58:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6AE86E08C9; Thu, 15 Apr 2010 21:58:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0CA3FE08C9 for ; Thu, 15 Apr 2010 21:58:12 +0000 (UTC) Received: from corvid.gentoo.org (corvid.gentoo.org [208.92.234.79]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 873321B402E for ; Thu, 15 Apr 2010 21:58:11 +0000 (UTC) Received: by corvid.gentoo.org (Postfix, from userid 2162) id BF8D62C041; Thu, 15 Apr 2010 21:58:10 +0000 (UTC) From: "Sebastien Fabbro (bicatali)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, bicatali@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in dev-python/rpy/files: rpy-1.0.2-R210.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: rpy-1.0.2-R210.patch X-VCS-Directories: dev-python/rpy/files X-VCS-Committer: bicatali X-VCS-Committer-Name: Sebastien Fabbro Content-Type: text/plain; charset=utf8 Message-Id: <20100415215810.BF8D62C041@corvid.gentoo.org> Date: Thu, 15 Apr 2010 21:58:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 63b003ce-6351-4342-941e-0daa389b1576 X-Archives-Hash: 5d71a9d072f5a3cf43fda52f51ffb3db bicatali 10/04/15 21:58:10 Added: rpy-1.0.2-R210.patch Log: Added a fix for larger R versions (Portage version: 2.2_rc67/cvs/Linux x86_64) Revision Changes Path 1.1 dev-python/rpy/files/rpy-1.0.2-R210.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/rpy/fil= es/rpy-1.0.2-R210.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/rpy/fil= es/rpy-1.0.2-R210.patch?rev=3D1.1&content-type=3Dtext/plain Index: rpy-1.0.2-R210.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- rpy-1.0.2.orig/examples/faithful.dat 1970-01-01 01:00:00.000000000 +0= 100 +++ rpy-1.0.2/examples/faithful.dat 2010-04-15 17:44:06.000000000 +0100 @@ -0,0 +1,273 @@ +"eruptions" "waiting" +3.6 79 +1.8 54 +3.333 74 +2.283 62 +4.533 85 +2.883 55 +4.7 88 +3.6 85 +1.95 51 +4.35 85 +1.833 54 +3.917 84 +4.2 78 +1.75 47 +4.7 83 +2.167 52 +1.75 62 +4.8 84 +1.6 52 +4.25 79 +1.8 51 +1.75 47 +3.45 78 +3.067 69 +4.533 74 +3.6 83 +1.967 55 +4.083 76 +3.85 78 +4.433 79 +4.3 73 +4.467 77 +3.367 66 +4.033 80 +3.833 74 +2.017 52 +1.867 48 +4.833 80 +1.833 59 +4.783 90 +4.35 80 +1.883 58 +4.567 84 +1.75 58 +4.533 73 +3.317 83 +3.833 64 +2.1 53 +4.633 82 +2 59 +4.8 75 +4.716 90 +1.833 54 +4.833 80 +1.733 54 +4.883 83 +3.717 71 +1.667 64 +4.567 77 +4.317 81 +2.233 59 +4.5 84 +1.75 48 +4.8 82 +1.817 60 +4.4 92 +4.167 78 +4.7 78 +2.067 65 +4.7 73 +4.033 82 +1.967 56 +4.5 79 +4 71 +1.983 62 +5.067 76 +2.017 60 +4.567 78 +3.883 76 +3.6 83 +4.133 75 +4.333 82 +4.1 70 +2.633 65 +4.067 73 +4.933 88 +3.95 76 +4.517 80 +2.167 48 +4 86 +2.2 60 +4.333 90 +1.867 50 +4.817 78 +1.833 63 +4.3 72 +4.667 84 +3.75 75 +1.867 51 +4.9 82 +2.483 62 +4.367 88 +2.1 49 +4.5 83 +4.05 81 +1.867 47 +4.7 84 +1.783 52 +4.85 86 +3.683 81 +4.733 75 +2.3 59 +4.9 89 +4.417 79 +1.7 59 +4.633 81 +2.317 50 +4.6 85 +1.817 59 +4.417 87 +2.617 53 +4.067 69 +4.25 77 +1.967 56 +4.6 88 +3.767 81 +1.917 45 +4.5 82 +2.267 55 +4.65 90 +1.867 45 +4.167 83 +2.8 56 +4.333 89 +1.833 46 +4.383 82 +1.883 51 +4.933 86 +2.033 53 +3.733 79 +4.233 81 +2.233 60 +4.533 82 +4.817 77 +4.333 76 +1.983 59 +4.633 80 +2.017 49 +5.1 96 +1.8 53 +5.033 77 +4 77 +2.4 65 +4.6 81 +3.567 71 +4 70 +4.5 81 +4.083 93 +1.8 53 +3.967 89 +2.2 45 +4.15 86 +2 58 +3.833 78 +3.5 66 +4.583 76 +2.367 63 +5 88 +1.933 52 +4.617 93 +1.917 49 +2.083 57 +4.583 77 +3.333 68 +4.167 81 +4.333 81 +4.5 73 +2.417 50 +4 85 +4.167 74 +1.883 55 +4.583 77 +4.25 83 +3.767 83 +2.033 51 +4.433 78 +4.083 84 +1.833 46 +4.417 83 +2.183 55 +4.8 81 +1.833 57 +4.8 76 +4.1 84 +3.966 77 +4.233 81 +3.5 87 +4.366 77 +2.25 51 +4.667 78 +2.1 60 +4.35 82 +4.133 91 +1.867 53 +4.6 78 +1.783 46 +4.367 77 +3.85 84 +1.933 49 +4.5 83 +2.383 71 +4.7 80 +1.867 49 +3.833 75 +3.417 64 +4.233 76 +2.4 53 +4.8 94 +2 55 +4.15 76 +1.867 50 +4.267 82 +1.75 54 +4.483 75 +4 78 +4.117 79 +4.083 78 +4.267 78 +3.917 70 +4.55 79 +4.083 70 +2.417 54 +4.183 86 +2.217 50 +4.45 90 +1.883 54 +1.85 54 +4.283 77 +3.95 79 +2.333 64 +4.15 75 +2.35 47 +4.933 86 +2.9 63 +4.583 85 +3.833 82 +2.083 57 +4.367 82 +2.133 67 +4.35 74 +2.2 54 +4.45 83 +3.567 73 +4.5 73 +4.15 88 +3.817 80 +3.917 71 +4.45 83 +2 56 +4.283 79 +4.767 78 +4.533 84 +1.85 58 +4.25 83 +1.983 43 +2.25 60 +4.75 75 +4.117 81 +2.15 46 +4.417 90 +1.817 46 +4.467 74 --- rpy-1.0.2.orig/examples/nnet.py 1970-01-01 01:00:00.000000000 +0100 +++ rpy-1.0.4/examples/nnet.py 2010-04-15 17:44:06.000000000 +0100 @@ -0,0 +1,29 @@ +from rpy import * + +# avoid automatic conversion +set_default_mode(NO_CONVERSION) + + +r.library("nnet") +model =3D r("Fxy~x+y") + +df =3D r.data_frame(x =3D r.c(0,2,5,10,15) + ,y =3D r.c(0,2,5,8,10) + ,Fxy =3D r.c(0,2,5,8,10)) + +NNModel =3D r.nnet(model, data =3D df + , size =3D10, decay =3D1e-3 + , lineout=3DTrue, skip=3DTrue + , maxit=3D1000, Hess =3DTrue) + +XG =3D r.expand_grid(x =3D r.seq(0,7,1), y =3D r.seq(0,7,1)) +x =3D r.seq(0,7,1) +y =3D r.seq(0,7,1) + + +# turn automatic conversion back on +set_default_mode(BASIC_CONVERSION) + +fit =3D r.predict(NNModel,XG) +print fit + --- rpy-1.0.2/PKG-INFO 2008-04-10 17:54:36.000000000 +0100 +++ rpy-1.0.4.orig/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -Metadata-Version: 1.0 -Name: rpy -Version: 1.0.2 -Summary: Python interface to the R language -Home-page: http://rpy.sourceforge.net -Author: Gregory R. Warnes -Author-email: warnes@bst.rochester.edu -License: GPL -Description: RPy provides a robust Python interface to the R - programming language. It can manage all kinds of R objects and = can - execute arbitrary R functions. All the errors from the R languag= e are - converted to Python exceptions. -Platform: UNKNOWN --- rpy-1.0.2.orig/rpy.py 2008-01-02 17:57:09.000000000 +0000 +++ rpy-1.0.2/rpy.py 2010-04-15 17:44:06.000000000 +0100 @@ -16,7 +16,7 @@ # # High level module for managing the lookup of R objects. # -# $Id: rpy-1.0.2-R210.patch,v 1.1 2010/04/15 21:58:10 bicatali Exp $ +# $Id: rpy-1.0.2-R210.patch,v 1.1 2010/04/15 21:58:10 bicatali Exp $ # # from __future__ import nested_scopes @@ -139,6 +139,7 @@ =20 # Version from rpy_version import rpy_version +__version__ =3D rpy_version =20 # Symbolic names for conversion modes TOP_CONVERSION =3D 4 @@ -332,7 +333,7 @@ self.print_(helpobj) =20 def __repr__(self): - Rver =3D self.__getitem__('R_version_string') + Rver =3D self.__getitem__('R.version.string') return "RPy version %s [%s]" % (rpy_version, Rver) =20 def __str__(self): --- rpy-1.0.2.orig/rpy_tools.py 2010-04-15 17:53:14.000000000 +0100 +++ rpy-1.0.2/rpy_tools.py 2010-04-15 17:44:06.000000000 +0100 @@ -97,8 +97,7 @@ if stat or len(output)<=3D0: raise RuntimeError("Couldn't execute the R interpreter" + " `%s'.\n" % rexec ) - # edd 05 Apr 2006 version =3D re.search("R +([0-9]\.[0-9]\.[0-9])",= output) - version =3D re.search(" version ([0-9]\.[0-9]\.[0-9])", output) + version =3D re.search(" +([0-9]+\.[0-9]+\.[0-9]+)", output) if not version: raise RuntimeError("Couldn't obtain version number from output\n" "of `R --version'.\n") @@ -143,3 +142,20 @@ % PYTHON_DIR ) =20 return PYTHON_DIR + +def get_R_LAPACK_LIB_FLAGS(RHOME=3Dget_R_HOME()): + """ + Determine the necessary link arguments for lapack=20 + """ + rexec =3D os.path.join(RHOME, 'bin', 'R') + stat, output =3D getstatusoutput('"%s" CMD config LAPACK_LIBS' % rexec= ) + if stat or len(output)<=3D0: + raise RuntimeError("Couldn't execute the R interpreter" + + " `%s'.\n" % rexec ) + =20 + LAPACK_LIB_FLAGS =3D output.strip() + if not LAPACK_LIB_FLAGS: + raise RuntimeError("Couldn't obtain LAPACK_LIBS information from out= put\n" + "of `R CMD config LAPACK_LIBS'.\n") + =20 + return LAPACK_LIB_FLAGS --- rpy-1.0.2.orig/rpy_version.py 2008-04-03 14:51:23.000000000 +0100 +++ rpy-1.0.2/rpy_version.py 2010-04-15 17:44:06.000000000 +0100 @@ -1 +1 @@ -rpy_version =3D "1.0.2" +rpy_version =3D "1.0.3" --- rpy-1.0.2.orig/setup.py 2007-11-27 02:06:32.000000000 +0000 +++ rpy-1.0.2/setup.py 2010-04-15 17:44:06.000000000 +0100 @@ -30,13 +30,14 @@ See the files INSTALL.UNIX and INSTALL.WINDOWS for more details. """ =20 -DEBUG=3DTrue +DEBUG=3DFalse =20 -import os, os.path, sys, shutil +import os, os.path, sys, shutil, re from distutils.core import setup, Extension from distutils.sysconfig import * from distutils.errors import * import rpy_tools + if sys.platform=3D=3D"win32": import rpy_wintools =20 @@ -66,6 +67,15 @@ #if sys.platform=3D=3D"win32": # rpy_wintools.CreatePythonWinLib() =20 +# On Mac OS X ("darwin") it is necessary to change the symlink +# /Library/Frameworks/R.framework/Versions/Current +# to point to the current version of R in +# /Library/Frameworks/R.framework/Versions/X.Y +# for that version of R to execute. So, we need to store the original +# symlink here so we can restore it when we are done +if sys.platform=3D=3D"darwin": + darwin_original_version =3D os.readlink("/Library/Frameworks/R.framewo= rk/Versions/Current") + modules =3D [] for RHOME in RHOMES: =20 @@ -76,7 +86,7 @@ get_config_vars()['OPT'] =3D '-g -Wall' else: # to avoid strict prototypes errors from R includes - get_config_vars()['OPT'] =3D '-DNDEBUG -g -O3 -Wall' + get_config_vars()['OPT'] =3D '-DNDEBUG -O3 -Wall' =20 # get the Python version if sys.version[:3] >=3D '2.2': @@ -87,6 +97,16 @@ UNDEF =3D [] =20 # configure the R paths + #if sys.platform=3D=3D"darwin": + # version =3D=20 + # if os.symlink("/Library/Frameworks/R.framework/Versions/Current") + # if RHOME.endswith('/'): + # RHOME =3D RHOME[:-1] + # print "RHOME=3D",os.path.join(os.path.dirname(RHOME), + # os.readlink(RHOME) ) + # sys.exit() + =20 + =20 RVERSION =3D rpy_tools.get_R_VERSION(RHOME, force_exec=3DTrue) RVER =3D rpy_tools.get_R_VERSION_CODE(RVERSION) =20 @@ -130,22 +150,21 @@ library_dirs=3D r_libs runtime_libs =3D r_libs extra_compile_args=3D[] - elif sys.platform=3D=3D'osf1V5': - include_dirs =3D [ os.path.join(RHOME.strip(), 'include'),=20 - 'src' ] - libraries=3D['R','Rlapack'] - library_dirs =3D r_libs - runtime_libs =3D r_libs - extra_compile_args=3D["-shared"] - source_files =3D source_files + ["src/setenv.c"] + =20 else: # unix-like systems, this is known to work for Linux and Solar= is include_dirs =3D [ os.path.join(RHOME.strip(), 'include'),=20 'src', '/usr/share/R/include' ] - libraries=3D['R','Rlapack'] + library_dirs =3D r_libs runtime_libs =3D r_libs extra_compile_args=3D["-shared"] source_files =3D source_files + ["src/setenv.c"] + =20 + libraries=3D['R'] + =20 + # Ask R to tell us how to properly link against lapack + extra_compile_args +=3D [ rpy_tools.get_R_LAPACK_LIB_FLAGS( RHOM= E ) ] + =20 # Discover which array packages are present try:=20 --- rpy-1.0.2.orig/src/io.c 2008-01-02 17:34:22.000000000 +0000 +++ rpy-1.0.2/src/io.c 2010-04-15 17:44:06.000000000 +0100 @@ -130,7 +130,7 @@ PyErr_Clear(); return 0; } - snprintf(buf, len, "%s", PyString_AsString(input_data)); + snprintf( (char*) buf, len, "%s", PyString_AsString(input_data)); Py_DECREF(input_data); return 1; } --- rpy-1.0.2.orig/src/RPy.h 2010-04-15 17:52:52.000000000 +0100 +++ rpy-1.0.4/src/RPy.h 2010-04-15 17:44:06.000000000 +0100 @@ -52,6 +52,13 @@ #include #include #include + +#if (R_VERSION >=3D R_Version(2,4,0))=20 +#include +#endif + + + #undef _POSIX_C_SOURCE #include #include @@ -74,9 +81,8 @@ # endif #endif /* _WIN32 */ =20 -#if R_VERSION < 133120 -#include /* must follow Graphics.h */ -#endif +#include /* must follow Graphics.h */ + =20 /* Missing definitions from Rinterface.h or RStartup.h */ # define CleanEd Rf_CleanEd --- rpy-1.0.2.orig/src/rpymodule.c 2010-04-15 17:52:33.000000000 +0100 +++ rpy-1.0.4/src/rpymodule.c 2010-04-15 17:44:06.000000000 +0100 @@ -1772,13 +1772,15 @@ =20 void r_finalize(void) { +#if (R_VERSION < R_Version(2,4,0))=20 unsigned char buf[1024]; char * tmpdir; +#endif =20 R_dot_Last(); =20 R_RunExitFinalizers(); =20 CleanEd(); =20 -#if (R_VERSION >=3D R_Version(2,7,0))=20 +#if (R_VERSION >=3D R_Version(2,7,0)) Rf_KillAllDevices(); #else KillAllDevices();