On 10/9/07, Gregory Warnes <[EMAIL PROTECTED]> wrote:
>
> It sounds like your version of RPy may have been compiled without
> NumPy support.  Did you compile it yourself, or are you using a pre-
> build version.
>

I have what appears to be a related issue.
rpy 1.0RC3
using numpy 1.0.3

I compiled rpy on my system. I believe the setup.py should find numpy

$ python
Python 2.5.1 (r251:54863, Apr 19 2007, 11:03:39)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.get_numpy_include()
/usr/lib/python2.5/site-packages/numpy/lib/utils.py:89:
DeprecationWarning: get_numpy_include is deprecated, use get_include
  DeprecationWarning)
'/usr/lib/python2.5/site-packages/numpy/core/include'
>>>

$ ls -R /usr/lib/python2.5/site-packages/numpy/core/include
/usr/lib/python2.5/site-packages/numpy/core/include:
numpy

/usr/lib/python2.5/site-packages/numpy/core/include/numpy:
__multiarray_api.h  config.h            npy_interrupt.h  ufuncobject.h
__ufunc_api.h       multiarray_api.txt  old_defines.h
arrayobject.h       ndarrayobject.h     oldnumeric.h
arrayscalars.h      noprefix.h          ufunc_api.txt


When using rpy to calculate the mean of an array, R segfaults unless the array
has a dtype of int32 or float64. The dtypes int8, int16, int64, float32,
and float96 all produce the same error messages.


$ python
Python 2.5.1 (r251:54863, Apr 19 2007, 11:03:39)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy, rpy
RHOME= /usr/lib/R
RVERSION= 2.5.1
RVER= 2051
RUSER= /home/dscholl
Loading Rpy version 2051 .. Done.
Creating the R object 'r' ..  Done
>>> x = numpy.array([1,2,3,4], dtype=numpy.float64)
>>> rpy.r.mean(x)
2.5
>>> x = numpy.array([1,2,3,4], dtype=numpy.float32)
>>> rpy.r.mean(x)

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 3
Exception thread.error: 'release unlocked lock' in <class
'thread.error'> ignored

It appears that I can convert manually to float64 as a workaround, but this
strikes me as unexpected behavior. I studied the docs, but didn't recognize this
issue. Am I using rpy correctly?

Regards, Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to