Dnia 2012-04-22, nie o godzinie 16:51 -0400, Andreas Kloeckner pisze:
On Sun, 22 Apr 2012 20:28:29 +0200, Tomasz Rybak
> I have tried to build PyCUDA on 64-bit Debian using Python 3,
> but got problems. Compiler complaints about
> C++ code contains PyString_* and PyInt_* function calls, but
> those functions were replaced by PyBytes_* and PyLong_*
> I am not sure what is the correct fix for this - whether
> we should surround calls to those with
> #ifdef PYTHON2
> or use macros:
> #ifdef PYTHON3
> #define PyString_Check(x) PyBytes_Check(x)
So far, PyCUDA does not support Python 3. This particular problem is
easy to fix by now, though. PyOpenCL now contains _pvt_struct_v2 and
_pvt_struct_v3, which are both modified versions of the Py2/3 struct
module with support for complex numbers. Simply copying the PyOpenCL _v3
module (and setup.py snippet) should solve this particular issue.
I have renamed _pycuda_struct.cpp to _pvt_struct_v2.cpp adding ifdef,
added _pvt_struct_v3.cpp, and copied snippets from PyOpenCL setup.py.
It builds on Debian now. Lintian (Debian tool checking package
validity) complains a bit, but at least I have both Python2 and Python3
binaries. I also had to change call to hack_distutils because calling
it with debug=True caused build to fail. See attached patch.
(And as far as I recall, that was the one remaining roadblock to
enabling PyCUDA on Python 3--though there might a few minor things left
I had to fix tests to run on Python3 (see patch). Almost all fail now
because of Unicode hashing, but at least they run, so we can start
Andreas, can you apply those two patches?
Tomasz Rybak GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A 488E C654 FB33 2AD5 9860