error compiling cython file

1,475 views
Skip to first unread message

cha...@gmail.com

unread,
Aug 21, 2017, 3:54:20 PM8/21/17
to QuTiP: Quantum Toolbox in Python
Hello,
I am getting the error below when compiling qutip (dev version). Any help is appreciated.
Thanks,
Chaffra


[ 1/13] Cythonizing qutip/cy/brtools.pyx
Error compiling Cython file:
------------------------------------------------------------
...
    fview : memview
        A zeroed memoryview in fortran-order.
    """
    cdef double complex * temp = <double complex *>PyDataMem_NEW_ZEROED(nrows*nrows,sizeof(complex))
    cdef complex[:,::1] cview = <double complex[:nrows, :nrows]> temp
    cdef complex[::1,:] fview = cview.T
                                    ^
------------------------------------------------------------
qutip/cy/brtools.pyx:72:37: Memoryview 'double complex[:, ::1]' not conformable to memoryview 'double complex[::1, :]'.
Error compiling Cython file:
------------------------------------------------------------
...
    for kk in range(nrows**2):
        if cabs(eig_mat[kk]) < atol:
            eig_mat[kk] = 0
    cdef complex[:,::1] out = <complex[:nrows, :nrows]> eig_mat
    #This just gets the correct f-ordered view on the data
    cdef complex[::1,:] out_f = out.T
                                  ^
------------------------------------------------------------
qutip/cy/brtools.pyx:274:35: Memoryview 'double complex[:, ::1]' not conformable to memoryview 'double complex[::1, :]'.
Error compiling Cython file:
------------------------------------------------------------
...
    cdef int * isuppz = <int *>PyDataMem_NEW((2*nrows) * sizeof(int))
    cdef complex * work = <complex *>PyDataMem_NEW(lwork * sizeof(complex))
    cdef double * rwork = <double *>PyDataMem_NEW((24*nrows) * sizeof(double))
    cdef int * iwork = <int *>PyDataMem_NEW((10*nrows) * sizeof(int))
    cdef complex[:,::1] cZ = <complex[:nrows, :nrows]><complex *>PyDataMem_NEW(nrows**2 * sizeof(complex))
    cdef complex[::1,:] Z = cZ.T
                             ^
------------------------------------------------------------

qutip/cy/brtools.pyx:593:30: Memoryview 'double complex[:, ::1]' not conformable to memoryview 'double complex[::1, :]'.
Traceback (most recent call last):
  File "setup.py", line 242, in <module>
    ext_modules = cythonize(EXT_MODULES),
  File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 877, in cythonize
    cythonize_one(*args)
  File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 997, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: qutip/cy/brtools.pyx

Paul Nation

unread,
Aug 21, 2017, 3:55:09 PM8/21/17
to QuTiP Group
What version of Cython are you using?

--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rayc...@gmail.com

unread,
Mar 13, 2018, 5:53:51 AM3/13/18
to QuTiP: Quantum Toolbox in Python
Hi, I also get the same problem, the version of Cython is 0.23.4, and the QuTip source code is simply cloned from github.

在 2017年8月22日星期二 UTC+8上午3:55:09,Paul Nation写道:
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.

Paul Nation

unread,
Mar 13, 2018, 5:56:32 AM3/13/18
to qu...@googlegroups.com
You need a newer version of Cython.

March 12, 2018 at 23:09
Hi, I also get the same problem, the version of Cython is 0.23.4, and the QuTip source code is simply cloned from github.

在 2017年8月22日星期二 UTC+8上午3:55:09,Paul Nation写道:
--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
August 21, 2017 at 15:55
What version of Cython are you using?

August 21, 2017 at 15:26
Hello,
I am getting the error below when compiling qutip (dev version). Any help is appreciated.
Thanks,
Chaffra


Yuanjia Wang

unread,
Mar 13, 2018, 9:54:38 AM3/13/18
to qu...@googlegroups.com
Thanks very much! I have installed the latest version of Cython and solved the problem. 

2018-03-13 17:56 GMT+08:00 Paul Nation <nonher...@gmail.com>:
You need a newer version of Cython.

March 12, 2018 at 23:09
Hi, I also get the same problem, the version of Cython is 0.23.4, and the QuTip source code is simply cloned from github.

在 2017年8月22日星期二 UTC+8上午3:55:09,Paul Nation写道:
--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
August 21, 2017 at 15:55
What version of Cython are you using?

August 21, 2017 at 15:26
Hello,
I am getting the error below when compiling qutip (dev version). Any help is appreciated.
Thanks,
Chaffra


--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/d4ad1l2wQUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+unsubscribe@googlegroups.com.

finnova...@gmail.com

unread,
Jun 12, 2018, 1:16:47 PM6/12/18
to QuTiP: Quantum Toolbox in Python
Same thing here. Latest Cython though: 
Cython==0.28.3


On Tuesday, March 13, 2018 at 1:54:38 PM UTC, Yuanjia Wang wrote:
Thanks very much! I have installed the latest version of Cython and solved the problem. 
2018-03-13 17:56 GMT+08:00 Paul Nation <nonher...@gmail.com>:
You need a newer version of Cython.

March 12, 2018 at 23:09
Hi, I also get the same problem, the version of Cython is 0.23.4, and the QuTip source code is simply cloned from github.

在 2017年8月22日星期二 UTC+8上午3:55:09,Paul Nation写道:
--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
August 21, 2017 at 15:55
What version of Cython are you using?

August 21, 2017 at 15:26
Hello,
I am getting the error below when compiling qutip (dev version). Any help is appreciated.
Thanks,
Chaffra


--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/d4ad1l2wQUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.

Paul Nation

unread,
Jun 12, 2018, 1:31:26 PM6/12/18
to qu...@googlegroups.com
I see no such issues with the same Cythone version.

-P

Omer Ben-Ami

unread,
Jun 12, 2018, 3:22:15 PM6/12/18
to qu...@googlegroups.com
This can definitely be a mistake.
Reply all
Reply to author
Forward
0 new messages