-
由 notoraptor 提交于
to make theano scripts installed when running pip install. These step are done to fix issue #5308. The bin folder containing the scripts is now importable from Python, with each script embedding its code into a main() function specified as the entry point of the script in `setup.py`. We also detect a Windows-specific error: the cache folder cannot be deleted because it contains shared libraries that are always loaded at theano importation and stay opened on Windows, which forbide the deletion of the shared library files in the cache. The workaround chosen is to unset theano config flag `cxx` only on Windows platform and only in theano-cache script. Doing that, Theano will not try to compile any C code, and will also not try to load compiled C codes that are in the cache, allowing these files to be deleted. To ensure this workaround does work, we also ensure that lazylinker module will be also ignored from cache when `cxx` is unset. Previously, if cxx was unset, Theano would not compile lazylinker but would look for an already compiled version of this module in the cache.
0f446def