On Sun, 20 May 2012 21:05:25 +0200, Tomasz Rybak <tomasz.ry...@post.pl> wrote:
> Dnia 2012-04-22, nie o godzinie 16:51 -0400, Andreas Kloeckner pisze:
> > On Sun, 22 Apr 2012 20:28:29 +0200, Tomasz Rybak <tomasz.ry...@post.pl> 
> > wrote:
> > > Hello.
> > > I have tried to build PyCUDA on 64-bit Debian using Python 3,
> > > but got problems. Compiler complaints about
> > > src/wrapper/_pycuda_struct.cpp
> > > 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
> > > PyString_*
> > > #else
> > > PyBytes_*
> > > #endif 
> > > or use macros:
> > > #ifdef PYTHON3
> > > #define PyString_Check(x) PyBytes_Check(x)
> > > #endif
> > > 
> > > etc.?
> > 
> > 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
> > over.)
> 
> 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
> fixing them.
> 
> Andreas, can you apply those two patches?

Done.

Thanks!
Andreas

Attachment: pgpVmeZ4UAWBV.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to