[SciPy-User] Scikits.sparse build issue

Anand Patil anand.prabhakar.patil at gmail.com
Fri May 6 05:05:12 EDT 2011


Thanks, Nathaniel! I had to make a few more changes to get the tests
to run on my setup, which is:

- 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 ----------------

On May 5, 7:42 pm, Nathaniel Smith <n... at pobox.com> wrote:
> On Thu, May 5, 2011 at 3:03 AM, Anand Patil
>
>
>
>
>
>
>
>
>
> <anand.prabhakar.pa... at gmail.com> wrote:
>
> > On May 4, 8:16 pm, Nathaniel Smith <n... at pobox.com> wrote:
> >> On Tue, May 3, 2011 at 10:10 AM, Nathaniel Smith <n... at pobox.com> wrote:
> >> > On Tue, May 3, 2011 at 5:51 AM, Anand Patil
> >> > <anand.prabhakar.pa... at gmail.com> wrote:
> >> >> 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.
>
> >> 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?
>
> 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=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... at scipy.orghttp://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list