Here are the entire traceback when I attempted to import pylsmlib. 

Thank you.

Yunbo

Python 2.7.2 (default, Nov 29 2011, 14:43:22) 
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylsmlib

Error compiling Cython file:
------------------------------------------------------------
...
import numpy as np
from numpy.core import intc     
cimport numpy as np
from numpy.compat import asbytes
from numpy import int, double, int32
from lsmlib cimport computeDistanceFunction2d
^
------------------------------------------------------------

lsmlib.pyx:7:0: 'computeDistanceFunction2d.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
import numpy as np
from numpy.core import intc     
cimport numpy as np
from numpy.compat import asbytes
from numpy import int, double, int32
from lsmlib cimport computeDistanceFunction2d
                   ^
------------------------------------------------------------

lsmlib.pyx:7:20: Name 'computeDistanceFunction2d' not declared in module 
'lsmlib'

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[double, ndim=1] mask = np.zeros((nx * ny,))
    cdef int spatial_derivative_order = 2                                       
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
    
    error = computeDistanceFunction2d(
                                    ^
------------------------------------------------------------

lsmlib.pyx:17:37: undeclared name not builtin: computeDistanceFunction2d

Error compiling Cython file:
------------------------------------------------------------
...
    cdef int spatial_derivative_order = 2                                       
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
    
    error = computeDistanceFunction2d(
        <double *> distance_function.data,
^
------------------------------------------------------------

lsmlib.pyx:18:1: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
    
    error = computeDistanceFunction2d(
        <double *> distance_function.data,
        <double *> phi.data,    
    ^
------------------------------------------------------------

lsmlib.pyx:19:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
    
    error = computeDistanceFunction2d(
        <double *> distance_function.data,
        <double *> phi.data,    
        <double *> mask.data,
    ^
------------------------------------------------------------

lsmlib.pyx:20:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    error = computeDistanceFunction2d(
        <double *> distance_function.data,
        <double *> phi.data,    
        <double *> mask.data,
        spatial_derivative_order,
        <int *> grid_dims.data,
    ^
------------------------------------------------------------

lsmlib.pyx:22:5: Cannot convert 'int *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        <double *> distance_function.data,
        <double *> phi.data,    
        <double *> mask.data,
        spatial_derivative_order,
        <int *> grid_dims.data,
        <double *> _dx.data)
    ^
------------------------------------------------------------

lsmlib.pyx:23:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...

    for i in range(num_ext_fields):
        ext_fields[i] = &extReturnFields[i,0]
        source_fields[i] = &extensionFields[i,0]
        
    error = computeExtensionFields2d(
                                   ^
------------------------------------------------------------

lsmlib.pyx:45:36: undeclared name not builtin: computeExtensionFields2d

Error compiling Cython file:
------------------------------------------------------------
...
    for i in range(num_ext_fields):
        ext_fields[i] = &extReturnFields[i,0]
        source_fields[i] = &extensionFields[i,0]
        
    error = computeExtensionFields2d(
        <double *> distance_function.data,
^
------------------------------------------------------------

lsmlib.pyx:46:1: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        ext_fields[i] = &extReturnFields[i,0]
        source_fields[i] = &extensionFields[i,0]
        
    error = computeExtensionFields2d(
        <double *> distance_function.data,
        <double **> ext_fields,
^
------------------------------------------------------------

lsmlib.pyx:47:1: Cannot convert 'double **' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        source_fields[i] = &extensionFields[i,0]
        
    error = computeExtensionFields2d(
        <double *> distance_function.data,
        <double **> ext_fields,
        <double *> phi.data,    
    ^
------------------------------------------------------------

lsmlib.pyx:48:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        
    error = computeExtensionFields2d(
        <double *> distance_function.data,
        <double **> ext_fields,
        <double *> phi.data,    
        <double *> mask.data,
    ^
------------------------------------------------------------

lsmlib.pyx:49:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    error = computeExtensionFields2d(
        <double *> distance_function.data,
        <double **> ext_fields,
        <double *> phi.data,    
        <double *> mask.data,
        <double **> source_fields,
^
------------------------------------------------------------

lsmlib.pyx:50:1: Cannot convert 'double **' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        <double *> phi.data,    
        <double *> mask.data,
        <double **> source_fields,
        num_ext_fields,
        spatial_derivative_order,
        <int *> grid_dims.data,
    ^
------------------------------------------------------------

lsmlib.pyx:53:5: Cannot convert 'int *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        <double *> mask.data,
        <double **> source_fields,
        num_ext_fields,
        spatial_derivative_order,
        <int *> grid_dims.data,
        <double *> _dx.data)
    ^
------------------------------------------------------------

lsmlib.pyx:54:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[double, ndim=1] mask = np.zeros((nx * ny,))
    cdef int spatial_derivative_order = 2                                       
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
  
    error = solveEikonalEquation2d(
                                 ^
------------------------------------------------------------

lsmlib.pyx:69:34: undeclared name not builtin: solveEikonalEquation2d

Error compiling Cython file:
------------------------------------------------------------
...
    cdef int spatial_derivative_order = 2                                       
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
  
    error = solveEikonalEquation2d(
        <double *> phi.data,
^
------------------------------------------------------------

lsmlib.pyx:70:1: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[int, ndim=1] grid_dims = np.array((nx, ny), dtype=int32)
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
  
    error = solveEikonalEquation2d(
        <double *> phi.data,
        <double *> speed.data,  
    ^
------------------------------------------------------------

lsmlib.pyx:71:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    cdef np.ndarray[double, ndim=1] _dx = np.array((dx, dy))
  
    error = solveEikonalEquation2d(
        <double *> phi.data,
        <double *> speed.data,  
        <double *> mask.data,
    ^
------------------------------------------------------------

lsmlib.pyx:72:5: Cannot convert 'double *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
    error = solveEikonalEquation2d(
        <double *> phi.data,
        <double *> speed.data,  
        <double *> mask.data,
        spatial_derivative_order,
        <int *> grid_dims.data,
    ^
------------------------------------------------------------

lsmlib.pyx:74:5: Cannot convert 'int *' to Python object

Error compiling Cython file:
------------------------------------------------------------
...
        <double *> phi.data,
        <double *> speed.data,  
        <double *> mask.data,
        spatial_derivative_order,
        <int *> grid_dims.data,
        <double *> _dx.data)
    ^
------------------------------------------------------------

lsmlib.pyx:75:5: Cannot convert 'double *' to Python object
/home/ba01/u142/wang1320/.pyxbld/temp.linux-x86_64-2.7/pyrex/lsmlib.c:1:2: 
error: #error Do not use this file, it is the result of a failed Cython 
compilation.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pylsmlib.py", line 10, in <module>
    from lsmlib import computeDistanceFunction2d_ as computeDistanceFunction2d
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/pyximport/pyximport.py",
 line 335, in load_module
    self.pyxbuild_dir)
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/pyximport/pyximport.py",
 line 183, in load_module
    so_path = build_module(name, pyxfilename, pyxbuild_dir)
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/pyximport/pyximport.py",
 line 167, in build_module
    reload_support=pyxargs.reload_support)
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/pyximport/pyxbuild.py",
 line 85, in pyx_to_dll
    dist.run_commands()
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/dist.py", line 953, in 
run_commands
    self.run_command(cmd)
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/dist.py", line 972, in 
run_command
    cmd_obj.run()
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/Cython/Distutils/build_ext.py",
 line 135, in run
    _build_ext.build_ext.run(self)
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/command/build_ext.py", 
line 340, in run
    self.build_extensions()
  File 
"/home/ba01/u142/wang1320/build/cython/lib/python2.7/site-packages/Cython/Distutils/build_ext.py",
 line 143, in build_extensions
    self.build_extension(ext)
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/command/build_ext.py", 
line 499, in build_extension
    depends=ext.depends)
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/ccompiler.py", line 
624, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/apps/rhel5/Python-2.7.2/lib/python2.7/distutils/unixccompiler.py", 
line 180, in _compile
    raise CompileError, msg
ImportError: Building module failed: ["CompileError: command 'gcc' failed with 
exit status 1\n"]

On Sep 28, 2012, at 10:30 AM, Daniel Wheeler wrote:

> On Thu, Sep 27, 2012 at 5:49 PM, wang yunbo <[email protected]> wrote:
>> The test works fine for both of machines here. It seems cimport is working 
>> aright.
>> 
>> Could it be something caused by different gcc versions?
> 
> I doubt it. Maybe compiling with a different version of gcc than the
> version that built python, I have had that as an issue in the past.
> Check that.
> 
> Can you post the entire traceback when you try and run something using
> pylsmlib? Maybe the cimport is caused because it is not finding
> lsmlib.pxd?
> 
> -- 
> Daniel Wheeler


_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to