On Feb 2, 2010, at 7:20 PM, M. Yurko wrote:
The small example that I posted used pyximport. The extension module
that made me originally see the issue was built with a setup.py
distutils script. I have the same issue with both of them. They work
on a normal python distribution, but fail if there is not a system-
wide install of numpy. The issue happens if the setup.py script uses
either the original .pyx files or the generated .c files.
Can you post a setup.py for your simple example along with the
commands you used to compile it? It sounds like it's not getting
numpy_include_dirs correctly.
- Robert
On Feb 2, 9:33 pm, Robert Bradshaw <[email protected]>
wrote:
On Feb 2, 2010, at 4:11 PM, M. Yurko wrote:
On Feb 2, 6:44 pm, "Georg S. Weber" <[email protected]>
wrote:
On 2 Feb., 21:26, Michael Yurko <[email protected]> wrote:
Hello All,
I've recently been building an extension module using both cython
and numpy.
It works fine with my system-wide install of python with numpy and
cython as
well as my install of sage. However, when I try to run it from
sage on a
system that doesn't have a system wide install of cython and
numpy, it fails
with:
/home/myurko/.pyxbld/temp.linux-x86_64-2.6/pyrex/numpy_test.c:
144:31: error:
numpy/arrayobject.h: No such file or
directory
/home/myurko/.pyxbld/temp.linux-x86_64-2.6/pyrex/numpy_test.c:
145:31: error:
numpy/ufuncobject.h: No such file or directory
and then pages of issues relating to the failure to include
arrayobject.h
and ufuncobect.h . This issue is simply illustrated by the two
short
files:http://modular.math.washington.edu/home/myurko/misc/npt_wrapper.pyand
.... Before
I open a ticket, I just wanted to make sure that there already
isn't one
open, or there is not some other issue at play.
Thanks,
Mike Yurko
Try adding the line (yes, it's a *comment*)
#cinclude $SAGE_ROOT/local/lib/python/site-packages/numpy/core/
include
to your *.pyx file. I don't remember right now where this stuff
(#cinclude, #clib, ...) for .pyx modules in conjunction with Sage
is
documented. But it's not a bug, it's a feature ...
Cheers,
Georg
Hmm. That doesn't seem to work either in my trivial example, or my
original extension module. I did find mention on #cinclude in the
documentation (http://www.sagemath.org/doc/developer/
coding_in_other.html).
That's only for using %cython in the notebook.
However, I probably should have been more
specific. For now, I'm just trying to use sage as a python install
that has both cython and numpy. I've been running the script with
"sage -python ..." It seems odd to me that the behavior of the
included python would be modified.
How did you build your .pyx modules? Did you make a setup.py and run
"sage -python setup.py"?
- Robert
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org