twiecki / CythonGSL

Cython interface for the GNU Scientific Library (GSL).
Other
121 stars 38 forks source link

Building tests fail on OS X 10.7 #10

Closed fonnesbeck closed 12 years ago

fonnesbeck commented 12 years ago

CythonGSL builds and installs without issue, but trying to build the tests results in a raft of errors. Looks like I cannot comport the package for some reason. Here are the first few errors:

Ronning:~/Code/CythonGSL/test
[569] 10:47:37 fonnescj:master* $ python setup.py build_ext -i
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'cython_include_dirs'
  warnings.warn(msg)
running build_ext
cythoning blas.pyx to blas.c

Error compiling Cython file:
------------------------------------------------------------
...
from cython_gsl cimport *
^
------------------------------------------------------------

blas.pyx:1:0: 'cython_gsl.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from cython_gsl cimport *
from numpy import array, dot, transpose, outer, conjugate
from numpy.linalg import inv

def t_gsl_blas_ddot():
    cdef gsl_vector *v1, *v2
        ^
------------------------------------------------------------

blas.pyx:6:9: 'gsl_vector' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
    gsl_vector_free(v1)
    gsl_vector_free(v2)
    return ary

def t_gsl_blas_zdotu():
    cdef gsl_complex z
        ^
------------------------------------------------------------

blas.pyx:22:9: 'gsl_complex' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
    gsl_vector_free(v2)
    return ary

def t_gsl_blas_zdotu():
    cdef gsl_complex z
    cdef gsl_vector_complex *v1, *v2
        ^
------------------------------------------------------------

blas.pyx:23:9: 'gsl_vector_complex' is not a type identifier
twiecki commented 12 years ago

I think the key to the problem is in this line:

extension.py:133: UserWarning: Unknown Extension options: 'cython_include_dirs'

which implies that you are using distutils.Extension, which doesn't work with CythonGSL. Can you try to instead use the Cython Extension module:

from Cython.Distutils import Extension

On Sun, May 13, 2012 at 11:53 AM, Chris Fonnesbeck reply@reply.github.com wrote:

CythonGSL builds and installs without issue, but trying to build the tests results in a raft of errors. Here are the first few:

   Ronning:~/Code/CythonGSL/test    [569] 10:47:37 fonnescj:master* $ python setup.py build_ext -i    /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'cython_include_dirs'      warnings.warn(msg)    running build_ext    cythoning blas.pyx to blas.c

   Error compiling Cython file:    ------------------------------------------------------------    ...    from cython_gsl cimport *    ^    ------------------------------------------------------------

   blas.pyx:1:0: 'cython_gsl.pxd' not found

   Error compiling Cython file:    ------------------------------------------------------------    ...    from cython_gsl cimport *    from numpy import array, dot, transpose, outer, conjugate    from numpy.linalg import inv

   def t_gsl_blas_ddot():        cdef gsl_vector v1, v2            ^    ------------------------------------------------------------

   blas.pyx:6:9: 'gsl_vector' is not a type identifier

   Error compiling Cython file:    ------------------------------------------------------------    ...        gsl_vector_free(v1)        gsl_vector_free(v2)        return ary

   def t_gsl_blas_zdotu():        cdef gsl_complex z            ^    ------------------------------------------------------------

   blas.pyx:22:9: 'gsl_complex' is not a type identifier

   Error compiling Cython file:    ------------------------------------------------------------    ...        gsl_vector_free(v2)        return ary

   def t_gsl_blas_zdotu():        cdef gsl_complex z        cdef gsl_vector_complex v1, v2            ^    ------------------------------------------------------------

   blas.pyx:23:9: 'gsl_vector_complex' is not a type identifier


Reply to this email directly or view it on GitHub: https://github.com/twiecki/CythonGSL/issues/10

fonnesbeck commented 12 years ago

These are your tests within CythonGSL, not my own code. From setup.py:

from distutils.core import setup
import numpy as np
from Cython.Distutils import Extension
from Cython.Distutils import build_ext
import os
import cython_gsl
from glob import glob
from os.path import splitext
twiecki commented 12 years ago

Oh, that's weird then. Is your cython version up-to-date?

Also, I just updated the test infrastructure in the most recent version. Should now be (in the root directory):

python setup_test.py build

After installing CythonGSL.

On Sun, May 13, 2012 at 12:05 PM, Chris Fonnesbeck reply@reply.github.com wrote:

These are your tests within CythonGSL, not my own code. From setup.py:

   from distutils.core import setup    import numpy as np    from Cython.Distutils import Extension    from Cython.Distutils import build_ext    import os    import cython_gsl    from glob import glob    from os.path import splitext


Reply to this email directly or view it on GitHub: https://github.com/twiecki/CythonGSL/issues/10#issuecomment-5677232

fonnesbeck commented 12 years ago

I think it is still looking for a test directory, which is no longer there:

package init file 'cython_gsl/test/__init__.py' not found (or not a regular file)
running build_ext
cythoning cython_gsl/test/blas.pyx to cython_gsl/test/blas.c

Error compiling Cython file:
------------------------------------------------------------
...
from cython_gsl cimport *
^
------------------------------------------------------------

cython_gsl/test/blas.pyx:1:0: 'cython_gsl.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from cython_gsl cimport *
from numpy import array, dot, transpose, outer, conjugate
from numpy.linalg import inv

def t_gsl_blas_ddot():
    cdef gsl_vector *v1, *v2
        ^
------------------------------------------------------------

cython_gsl/test/blas.pyx:6:9: 'gsl_vector' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
    gsl_vector_free(v1)
    gsl_vector_free(v2)
    return ary

def t_gsl_blas_zdotu():
    cdef gsl_complex z
        ^
------------------------------------------------------------

cython_gsl/test/blas.pyx:22:9: 'gsl_complex' is not a type identifier
twiecki commented 12 years ago

Ah, I forgot to add test/init.py. Can you pull and try again?

On Sun, May 13, 2012 at 12:16 PM, Chris Fonnesbeck reply@reply.github.com wrote:

I think it is still looking for a test directory, which is no longer there:

   package init file 'cython_gsl/test/init.py' not found (or not a regular file)    running build_ext    cythoning cython_gsl/test/blas.pyx to cython_gsl/test/blas.c

   Error compiling Cython file:    ------------------------------------------------------------    ...    from cython_gsl cimport *    ^    ------------------------------------------------------------

   cython_gsl/test/blas.pyx:1:0: 'cython_gsl.pxd' not found

   Error compiling Cython file:    ------------------------------------------------------------    ...    from cython_gsl cimport *    from numpy import array, dot, transpose, outer, conjugate    from numpy.linalg import inv

   def t_gsl_blas_ddot():        cdef gsl_vector v1, v2            ^    ------------------------------------------------------------

   cython_gsl/test/blas.pyx:6:9: 'gsl_vector' is not a type identifier

   Error compiling Cython file:    ------------------------------------------------------------    ...        gsl_vector_free(v1)        gsl_vector_free(v2)        return ary

   def t_gsl_blas_zdotu():        cdef gsl_complex z            ^    ------------------------------------------------------------

   cython_gsl/test/blas.pyx:22:9: 'gsl_complex' is not a type identifier


Reply to this email directly or view it on GitHub: https://github.com/twiecki/CythonGSL/issues/10#issuecomment-5677314

fonnesbeck commented 12 years ago

Updating to cython 0.16 seems to do the trick.