From: "Sebastien Fabbro (bicatali)" <bicatali@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/rpy/files: rpy-1.0.2-R210.patch
Date: Thu, 15 Apr 2010 21:58:10 +0000 (UTC) [thread overview]
Message-ID: <20100415215810.BF8D62C041@corvid.gentoo.org> (raw)
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/files/rpy-1.0.2-R210.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-python/rpy/files/rpy-1.0.2-R210.patch?rev=1.1&content-type=text/plain
Index: rpy-1.0.2-R210.patch
===================================================================
--- rpy-1.0.2.orig/examples/faithful.dat 1970-01-01 01:00:00.000000000 +0100
+++ 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 = r("Fxy~x+y")
+
+df = r.data_frame(x = r.c(0,2,5,10,15)
+ ,y = r.c(0,2,5,8,10)
+ ,Fxy = r.c(0,2,5,8,10))
+
+NNModel = r.nnet(model, data = df
+ , size =10, decay =1e-3
+ , lineout=True, skip=True
+ , maxit=1000, Hess =True)
+
+XG = r.expand_grid(x = r.seq(0,7,1), y = r.seq(0,7,1))
+x = r.seq(0,7,1)
+y = r.seq(0,7,1)
+
+
+# turn automatic conversion back on
+set_default_mode(BASIC_CONVERSION)
+
+fit = 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 language 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 @@
# Version
from rpy_version import rpy_version
+__version__ = rpy_version
# Symbolic names for conversion modes
TOP_CONVERSION = 4
@@ -332,7 +333,7 @@
self.print_(helpobj)
def __repr__(self):
- Rver = self.__getitem__('R_version_string')
+ Rver = self.__getitem__('R.version.string')
return "RPy version %s [%s]" % (rpy_version, Rver)
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)<=0:
raise RuntimeError("Couldn't execute the R interpreter" +
" `%s'.\n" % rexec )
- # edd 05 Apr 2006 version = re.search("R +([0-9]\.[0-9]\.[0-9])", output)
- version = re.search(" version ([0-9]\.[0-9]\.[0-9])", output)
+ version = 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 )
return PYTHON_DIR
+
+def get_R_LAPACK_LIB_FLAGS(RHOME=get_R_HOME()):
+ """
+ Determine the necessary link arguments for lapack
+ """
+ rexec = os.path.join(RHOME, 'bin', 'R')
+ stat, output = getstatusoutput('"%s" CMD config LAPACK_LIBS' % rexec )
+ if stat or len(output)<=0:
+ raise RuntimeError("Couldn't execute the R interpreter" +
+ " `%s'.\n" % rexec )
+
+ LAPACK_LIB_FLAGS = output.strip()
+ if not LAPACK_LIB_FLAGS:
+ raise RuntimeError("Couldn't obtain LAPACK_LIBS information from output\n"
+ "of `R CMD config LAPACK_LIBS'.\n")
+
+ 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 = "1.0.2"
+rpy_version = "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.
"""
-DEBUG=True
+DEBUG=False
-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=="win32":
import rpy_wintools
@@ -66,6 +67,15 @@
#if sys.platform=="win32":
# rpy_wintools.CreatePythonWinLib()
+# 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=="darwin":
+ darwin_original_version = os.readlink("/Library/Frameworks/R.framework/Versions/Current")
+
modules = []
for RHOME in RHOMES:
@@ -76,7 +86,7 @@
get_config_vars()['OPT'] = '-g -Wall'
else:
# to avoid strict prototypes errors from R includes
- get_config_vars()['OPT'] = '-DNDEBUG -g -O3 -Wall'
+ get_config_vars()['OPT'] = '-DNDEBUG -O3 -Wall'
# get the Python version
if sys.version[:3] >= '2.2':
@@ -87,6 +97,16 @@
UNDEF = []
# configure the R paths
+ #if sys.platform=="darwin":
+ # version =
+ # if os.symlink("/Library/Frameworks/R.framework/Versions/Current")
+ # if RHOME.endswith('/'):
+ # RHOME = RHOME[:-1]
+ # print "RHOME=",os.path.join(os.path.dirname(RHOME),
+ # os.readlink(RHOME) )
+ # sys.exit()
+
+
RVERSION = rpy_tools.get_R_VERSION(RHOME, force_exec=True)
RVER = rpy_tools.get_R_VERSION_CODE(RVERSION)
@@ -130,22 +150,21 @@
library_dirs= r_libs
runtime_libs = r_libs
extra_compile_args=[]
- elif sys.platform=='osf1V5':
- include_dirs = [ os.path.join(RHOME.strip(), 'include'),
- 'src' ]
- libraries=['R','Rlapack']
- library_dirs = r_libs
- runtime_libs = r_libs
- extra_compile_args=["-shared"]
- source_files = source_files + ["src/setenv.c"]
+
else: # unix-like systems, this is known to work for Linux and Solaris
include_dirs = [ os.path.join(RHOME.strip(), 'include'),
'src', '/usr/share/R/include' ]
- libraries=['R','Rlapack']
+
library_dirs = r_libs
runtime_libs = r_libs
extra_compile_args=["-shared"]
source_files = source_files + ["src/setenv.c"]
+
+ libraries=['R']
+
+ # Ask R to tell us how to properly link against lapack
+ extra_compile_args += [ rpy_tools.get_R_LAPACK_LIB_FLAGS( RHOME ) ]
+
# Discover which array packages are present
try:
--- 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 <Rdefines.h>
#include <Rinternals.h>
#include <Rversion.h>
+
+#if (R_VERSION >= R_Version(2,4,0))
+#include <Rembedded.h>
+#endif
+
+
+
#undef _POSIX_C_SOURCE
#include <Python.h>
#include <R_ext/Rdynload.h>
@@ -74,9 +81,8 @@
# endif
#endif /* _WIN32 */
-#if R_VERSION < 133120
-#include <Rdevices.h> /* must follow Graphics.h */
-#endif
+#include <Rembedded.h> /* must follow Graphics.h */
+
/* 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 @@
void r_finalize(void)
{
+#if (R_VERSION < R_Version(2,4,0))
unsigned char buf[1024];
char * tmpdir;
+#endif
R_dot_Last();
R_RunExitFinalizers();
CleanEd();
-#if (R_VERSION >= R_Version(2,7,0))
+#if (R_VERSION >= R_Version(2,7,0))
Rf_KillAllDevices();
#else
KillAllDevices();
next reply other threads:[~2010-04-15 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 21:58 Sebastien Fabbro (bicatali) [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-04-26 16:24 [gentoo-commits] gentoo-x86 commit in dev-python/rpy/files: rpy-1.0.2-R210.patch Sebastien Fabbro (bicatali)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100415215810.BF8D62C041@corvid.gentoo.org \
--to=bicatali@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox