Issue with xdress produced cython

45 views
Skip to first unread message

Andrew Davis

unread,
May 22, 2014, 6:15:06 PM5/22/14
to xdr...@googlegroups.com
Guys

I used xdress to wrap some cpp as part of PyNE, the cpp itself compiles fine, however when compiling the cython I get the following error

ent_names, would be a std::vector<std::string>, if that matters.

Error compiling Cython file:
------------------------------------------------------------
...
        ent_names_size = len(ent_names)
        if isinstance(ent_names, np.ndarray) and (<np.ndarray> ent_names).descr.type_num == np.NPY_OBJECT:
            ent_names_data = <void *> np.PyArray_DATA(<np.ndarray> ent_names)
            ent_names_proxy = cpp_vector[std_string](<size_t> ent_names_size)
            for ient_names in range(ent_names_size):
                ent_names_proxy[ient_names] = ent_names_data[ient_names]
                                                           ^
------------------------------------------------------------

/mnt/data/opt/pyne_dev/pyne/pyne/tally.pyx:177:60: Cannot assign type 'void' to 'string'

Error compiling Cython file:
------------------------------------------------------------
...
            for ient_names in range(ent_names_size):
                ent_names_proxy[ient_names] = ent_names_data[ient_names]
        else:
            ent_names_proxy = cpp_vector[std_string](<size_t> ent_names_size)
            for ient_names in range(ent_names_size):
                ent_names_proxy[ient_names] = <void> ent_names[ient_names]
                                             ^
------------------------------------------------------------

/mnt/data/opt/pyne_dev/pyne/pyne/tally.pyx:181:46: Cannot assign type 'void' to 'string'

Error compiling Cython file:
------------------------------------------------------------
...
            value_size = len(value)
            if isinstance(value, np.ndarray) and (<np.ndarray> value).descr.type_num == np.NPY_OBJECT:
                value_data = <void *> np.PyArray_DATA(<np.ndarray> value)
                value_proxy = cpp_vector[std_string](<size_t> value_size)
                for ivalue in range(value_size):
                    value_proxy[ivalue] = value_data[ivalue]
                                                   ^
------------------------------------------------------------

/mnt/data/opt/pyne_dev/pyne/pyne/tally.pyx:350:52: Cannot assign type 'void' to 'string'

Error compiling Cython file:
------------------------------------------------------------
...
                for ivalue in range(value_size):
                    value_proxy[ivalue] = value_data[ivalue]
            else:
                value_proxy = cpp_vector[std_string](<size_t> value_size)
                for ivalue in range(value_size):
                    value_proxy[ivalue] = <void> value[ivalue]
                                         ^
------------------------------------------------------------

/mnt/data/opt/pyne_dev/pyne/pyne/tally.pyx:354:42: Cannot assign type 'void' to 'string'
make[2]: *** [pyne/tally.cxx] Error 1


Thanks 

Anthony Scopatz

unread,
Jun 9, 2014, 7:07:03 PM6/9/14
to Andrew Davis, xdress
Hello Andy, 

What version of Cython are you on?  Actually, what is the output of "xdress --version"? Mine is:

scopatz@ares ~ $ xdress --version
XDress: 0.5-dev
pycparser (optional): 2.09.1
lxml (optional): 3.3.3
NumPy (optional): 1.9.0.dev-a6f9b78
Cython (optional): 0.20.1

Be Well
Anthony


--
You received this message because you are subscribed to the Google Groups "xdress" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/xdress/aaa39810-e750-4ab3-a416-c9e37ff7f8be%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages