Description: Change cache directory is created
Origin: https://github.com/inducer/pycuda/pull/59
Bug: https://github.com/inducer/pycuda/issues/54
Applied-Upstream: https://github.com/inducer/pycuda/pull/59
Last-Update: 2014-11-29
Index: pycuda-2014.1/pycuda/compiler.py
===================================================================
--- pycuda-2014.1.orig/pycuda/compiler.py
+++ pycuda-2014.1/pycuda/compiler.py
@@ -208,13 +208,13 @@ def compile(source, nvcc="nvcc", options
 
     if cache_dir is None:
         from os.path import join
-        from tempfile import gettempdir
-        cache_dir = join(gettempdir(),
-                "pycuda-compiler-cache-v1-%s" % _get_per_user_string())
+        import appdirs
+        cache_dir = os.path.join(appdirs.user_cache_dir("pycuda", "pycuda"),
+                "compiler-cache-v1")
 
-        from os import mkdir
+        from os import makedirs
         try:
-            mkdir(cache_dir)
+            makedirs(cache_dir)
         except OSError, e:
             from errno import EEXIST
             if e.errno != EEXIST:
Index: pycuda-2014.1/setup.py
===================================================================
--- pycuda-2014.1.orig/setup.py
+++ pycuda-2014.1/setup.py
@@ -173,7 +173,8 @@ def main():
 
             install_requires=[
                 "pytools>=2011.2",
-                "decorator>=3.2.0"
+                "decorator>=3.2.0",
+                "appdirs>=1.4.0"
                 ],
 
             ext_package="pycuda",
