[PYTHON] move ephemeral files to homedir (#549)
This prevents potential conflicts with other users on shared machines.
This commit is contained in:
committed by
GitHub
parent
93209c07e0
commit
8ce2c12e33
@@ -27,10 +27,11 @@ def get_llvm():
|
|||||||
return '', ''
|
return '', ''
|
||||||
# download if nothing is installed
|
# download if nothing is installed
|
||||||
name = 'clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04'
|
name = 'clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-16.04'
|
||||||
dir = '/tmp'
|
dir = os.path.join(os.environ["HOME"], ".triton", "llvm")
|
||||||
llvm_include_dir = '{dir}/{name}/include'.format(dir=dir, name=name)
|
llvm_include_dir = '{dir}/{name}/include'.format(dir=dir, name=name)
|
||||||
llvm_library_dir = '{dir}/{name}/lib'.format(dir=dir, name=name)
|
llvm_library_dir = '{dir}/{name}/lib'.format(dir=dir, name=name)
|
||||||
if not os.path.exists(llvm_library_dir):
|
if not os.path.exists(llvm_library_dir):
|
||||||
|
os.makedirs(dir, exist_ok=True)
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(os.path.join(dir, name))
|
shutil.rmtree(os.path.join(dir, name))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@@ -1158,8 +1158,7 @@ class DependenciesFinder(ast.NodeVisitor):
|
|||||||
|
|
||||||
|
|
||||||
def default_cache_dir():
|
def default_cache_dir():
|
||||||
import getpass
|
return os.path.join(os.environ["HOME"], ".triton", "cache")
|
||||||
return f'/tmp/triton_{getpass.getuser()}'
|
|
||||||
|
|
||||||
|
|
||||||
class JITFunction:
|
class JITFunction:
|
||||||
|
Reference in New Issue
Block a user