I was excited to notice scikits.sparse this morning. I've been waiting
for something like that to appear for a while now! I'm trying to
install the HG head on a Mac, with EPD 7.0-2 and Numpy 1.5.1. I've
installed SuiteSparse from MacPorts.
First, the following line from cholmod.pyx doesn't work with MacPorts'
SuiteSparse:
cdef extern from "suitesparse/cholmod.h":
It needs to be
cdef extern from "ufsparse/cholmod.h":
Having done that, I get a sequence of errors like the following:
python setup.py build
running build
running build_py
running build_ext
skipping 'scikits/sparse/cholmod.c' Cython extension (up-to-date)
building 'scikits.sparse.cholmod' extension
gcc -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/
MacOSX10.5.sdk -I/Library/Frameworks/EPD64.framework/Versions/7.0/
include -I/opt/local/include -I/Library/Frameworks/EPD64.framework/
Versions/7.0/lib/python2.7/site-packages/numpy/core/include -I/Library/
Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -c scikits/
sparse/cholmod.c -o build/temp.macosx-10.6-x86_64-2.7/scikits/sparse/
cholmod.o
scikits/sparse/cholmod.c: In function
‘__pyx_f_7scikits_6sparse_7cholmod__py_sparse’:
scikits/sparse/cholmod.c:1713: error: storage size of ‘__pyx_t_10’
isn’t known
I've never used Cython and am having a hard time figuring this out.
Thanks in advance for any help,
Anand
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
It should probably be:
cdef extern from "cholmod.h":
and then the build system should figure out in what idiosyncratic way
cholmod has been installed on the system, and set appropriate compiler
flags so it can be found.
I really have no idea how to do this with distutils, though -- does anyone else?
> scikits/sparse/cholmod.c: In function
> ‘__pyx_f_7scikits_6sparse_7cholmod__py_sparse’:
> scikits/sparse/cholmod.c:1713: error: storage size of ‘__pyx_t_10’
> isn’t known
>
> I've never used Cython and am having a hard time figuring this out.
Could you send me the file 'scikits/sparse/cholmod.c'? This means that
there's some C type that was forward-declared, but never actually
defined, and then we tried to instantiate an instance of it. But I'll
need to see the generated code to figure out which type '__pyx_t_10'
is supposed to be.
-- Nathaniel
Thanks for getting back to me. I'll send you cholmod.c by email.
Anand
On May 3, 6:10 pm, Nathaniel Smith <n...@pobox.com> wrote:
> On Tue, May 3, 2011 at 5:51 AM, Anand Patil
>
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
Huh, this appears to be some bad interaction between numpy and cython,
rather than anything to do with my code. The offending variable comes
from doing 'cimport numpy as np' and then referring to
'np.NPY_F_CONTIGUOUS' -- this is being translated to:
enum requirements __pyx_t_10;
__pyx_t_10 = NPY_F_CONTIGUOUS;
and then gcc is complaining that 'enum requirements' is an undefined type.
What version of Numpy and Cython do you have installed?
Cython 0.14.1, Numpy 1.5.1. Which versions do you have?
Thanks,
Anand
>
> -- Nathaniel
> _______________________________________________
> SciPy-User mailing list
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user
It looks like with Cython 0.12.1, which is what I was using before, it
happens not to generate a temporary variable in this case, but Cython
0.14.1 generates the temporary variable.
I've just committed a workaround to the scikits.sparse repository:
https://code.google.com/p/scikits-sparse/source/detail?r=ad106e9c2c2d55f2022a3fb8b9282003b55666fc#
(I believe it works -- it does compile -- but technically I can't
guarantee it since for me the tests are now failing with an "illegal
instruction" error inside BLAS. But I think this must be an unrelated
Ubuntu screwup. Yay software.)
And I'll see about poking Cython upstream to get this fixed...
-- Nathaniel
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
- Mac
- Python, Numpy, SciPy from EPD 7.0.1
- SuiteSparse from MacPorts.
The patch follows.
Cheers,
Anand
----------- patch -----------
diff -r 0fd458997533 scikits/sparse/cholmod.pyx
--- a/scikits/sparse/cholmod.pyx Thu May 05 11:16:24 2011 -0700
+++ b/scikits/sparse/cholmod.pyx Fri May 06 10:01:09 2011 +0100
@@ -46,7 +46,7 @@
hack.base = <void *> base
return arr
-cdef extern from "suitesparse/cholmod.h":
+cdef extern from "ufsparse/cholmod.h":
cdef enum:
CHOLMOD_INT
CHOLMOD_PATTERN, CHOLMOD_REAL, CHOLMOD_COMPLEX
diff -r 0fd458997533 setup.py
--- a/setup.py Thu May 05 11:16:24 2011 -0700
+++ b/setup.py Fri May 06 10:01:09 2011 +0100
@@ -70,11 +70,11 @@
ext_modules = [
Extension("scikits.sparse.cholmod",
["scikits/sparse/cholmod.pyx"],
- libraries=["cholmod"],
- include_dirs=[np.get_include()],
+
libraries=["cholmod","amd","camd","colamd","metis","ccolamd"],
+ include_dirs=[np.get_include(),'/opt/local/
include'],
# If your CHOLMOD is in a funny place, you
may need to
# add something like this:
- #library_dirs=["/opt/suitesparse/lib"],
+ library_dirs=["/opt/local/lib"]
# And modify include_dirs above in a similar
way.
),
],
------------- end of patch ----------------
> https://code.google.com/p/scikits-sparse/source/detail?r=ad106e9c2c2d...
> (I believe it works -- it does compile -- but technically I can't
> guarantee it since for me the tests are now failing with an "illegal
> instruction" error inside BLAS. But I think this must be an unrelated
> Ubuntu screwup. Yay software.)
>
> And I'll see about poking Cython upstream to get this fixed...
>
> -- Nathaniel
> _______________________________________________
> SciPy-User mailing list
> SciPy-U...@scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user