From 848307a593e664b517b90ffb6acdb6775d838eb5 Mon Sep 17 00:00:00 2001 From: Jack Betteridge Date: Fri, 1 Nov 2024 13:47:30 +0000 Subject: [PATCH] Missed a file --- firedrake/configuration.py | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 firedrake/configuration.py diff --git a/firedrake/configuration.py b/firedrake/configuration.py new file mode 100644 index 0000000000..9aedb0c2c1 --- /dev/null +++ b/firedrake/configuration.py @@ -0,0 +1,49 @@ +"""Replaces functionality from the removed `firedrake_configuration` module.""" + +import os + +from pathlib import Path + + +# Make a configuration that mimics the old one: +_config = { + "options": { + "package_manager": False, + "minimal_petsc": False, + "mpicc": "/opt/mpich/bin/mpicc", + "mpicxx": "/opt/mpich/bin/mpicxx", + "mpif90": "/opt/mpich/bin/mpif90", + "mpiexec": "/opt/mpich/bin/mpiexec", + "disable_ssh": False, + "honour_petsc_dir": True, + "with_parmetis": False, + "slepc": True, + "packages": [], + "honour_pythonpath": False, + "opencascade": False, + "tinyasm": True, + "petsc_int_type": "int32", + "cache_dir": "/scratch/jbetteri/firedrake_py311_opt/.cache", + "complex": False, + "remove_build_files": False, + "with_blas": None, + "torch": "cpu", + "netgen": True, + "jax": False, + }, + "environment": {}, + "additions": [], +} + + +def get_config(): + """Return the current configuration dictionary""" + return None + + +def setup_cache_dirs(): + root = Path(os.environ.get("VIRTUAL_ENV", "~")) + if "PYOP2_CACHE_DIR" not in os.environ: + os.environ["PYOP2_CACHE_DIR"] = str(root.joinpath("pyop2")) + if 'FIREDRAKE_TSFC_KERNEL_CACHE_DIR' not in os.environ: + os.environ["FIREDRAKE_TSFC_KERNEL_CACHE_DIR"] = str(root.joinpath("tsfc"))