fjarri / reikna

Pure Python GPGPU library
http://reikna.publicfields.net/
MIT License
164 stars 16 forks source link

Some fixes for Python 2.6 #16

Closed SyamGadde closed 10 years ago

SyamGadde commented 10 years ago

I don't know if these are all the changes needed to re-enable support for Python 2.6, but it got me as far as I needed to go.

andyofmelbourne commented 10 years ago

Running python 2.6.6 I get the error:

In [1]: import reikna

In [2]: import reikna.cluda as cluda ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (8, 0))


TypeError Traceback (most recent call last)

/afs/desy.de/user/a/amorgan/ in ()

/afs/desy.de/user/a/amorgan/python_packages/lib/reikna/cluda/init.py in () 2 supported_api_ids, get_api, cuda_api, ocl_api, any_api 3 from reikna.cluda.api_tools import find_devices ----> 4 from reikna.cluda.kernel import Module, Snippet 5 6

/afs/desy.de/user/a/amorgan/python_packages/lib/reikna/cluda/kernel.py in () 8 9 ---> 10 TEMPLATE = template_for(file) 11 12

/afs/desy.de/user/a/amorgan/python_packages/lib/reikna/helpers/init.pyc in template_for(filename) 151 """ 152 name, _ext = os.path.splitext(os.path.abspath(filename)) --> 153 return make_template(name + '.mako', filename=True) 154 155

/afs/desy.de/user/a/amorgan/python_packages/lib/reikna/helpers/init.pyc in make_template(template, filename) 93 if filename: 94 kwds['filename'] = template ---> 95 return Template(_kwds) 96 else: 97 return Template(template, _kwds)

TypeError: init() got an unexpected keyword argument 'future_imports'

SyamGadde commented 10 years ago

Looks like you need a newer version of Mako:

https://github.com/Pylons/pyramid_mako/issues/22

SyamGadde commented 10 years ago

Oops -- I guess this would be the relevant link:

https://bitbucket.org/zzzeek/mako_hg/pull-request/3/added-future_imports-feature-to-template/diff

fjarri commented 10 years ago

Thank you! I'll run the full test suite and check if there are some dict comprehensions left to fix.

andyofmelbourne commented 10 years ago

After running a few test cases from the website using Python 2.6.6 things are looking pretty sweet on my end.

Thanks Syam Gadde for the pointer on Mako.