Theano/Theano — pull request #1042 by jlowin (2012-10-31 19:25:33+00:00)
Title: cutils_ext import fix -- allow theano to run on picloud servers (c|py only)

This address issue #728.

When theano is transmitted to picloud, the cutils_ext import fails if the __init__ file isn't available at a certain point.

It is not clear to me why this failure occurs. All this PR does is make sure the cutils_ext __init__ file exists by touching it. The existing line 1623 of theano/gof/cmodule (in compile_str) does exactly the same thing and should have been sufficient. Putting the touch at line 54 of theano/gof/cutils (immediately before calling compile_str) should also work, but doesn't. However, putting it even earlier in cutils does work.

**NOTE** this doesn't work with the CVM linker. I have tested it with the c|py linker. Importing lazylinker_c causes picloud to start some strange import behavior. This trips an except clause that results in the CVM class never being created. For some reason, I can't trace the error -- if I force the import of lazylinker_c (by removing the try/except), picloud acts as if the error took place during the initial "import theano".