V 0.5.1 doesn't work in Conda on Intel MacBook

I installed FEniCSx on my Intel MacBook using Conda. V 0.5.0 worked just fine. I tried moving on to 0.5.1 but it doesn’t seem to work.

import dolfinx
print(f"DOLFINx version: {dolfinx.__version__} based on GIT commit: {dolfinx.git_commit_hash} of https://github.com/FEniCS/dolfinx/")

from mpi4py import MPI
from dolfinx import mesh
domain = mesh.create_unit_square(MPI.COMM_WORLD, 8, 8, mesh.CellType.quadrilateral)

from dolfinx.fem import FunctionSpace
V = FunctionSpace(domain, ("CG", 1))

print("No Errors")

The error I’m getting is:

DOLFINx version: 0.5.1 based on GIT commit:  of https://github.com/FEniCS/dolfinx/
Traceback (most recent call last):
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/ffcx/codegeneration/jit.py", line 65, in get_cached_module
    open(c_filename, "x")
FileExistsError: [Errno 17] File exists: '/Users/varunkumar/.cache/fenics/libffcx_elements_bc4d96cb344a1e394b6c4f7eb06e35f03dda42eb.c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/varunkumar/Documents/FEniCSx Codes/FEniCSx v0.5.1/testx.py", line 9, in <module>
    V = FunctionSpace(domain, ("CG", 1))
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/dolfinx/fem/function.py", line 457, in __init__
    (self._ufcx_element, self._ufcx_dofmap), module, code = jit.ffcx_jit(
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/dolfinx/jit.py", line 56, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/dolfinx/jit.py", line 206, in ffcx_jit
    r = ffcx.codegeneration.jit.compile_elements([ufl_object], parameters=p_ffcx, **p_jit)
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/ffcx/codegeneration/jit.py", line 110, in compile_elements
    obj, mod = get_cached_module(module_name, names, cache_dir, timeout)
  File "/opt/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/ffcx/codegeneration/jit.py", line 78, in get_cached_module
    raise ModuleNotFoundError("Unable to find JIT module.")
ModuleNotFoundError: Unable to find JIT module.

Could this be because I have both V 0.5.0 and V 0.5.1 on 2 different environments in the same system? I did not want to risk it and delete V 0.5.0 from my system.

It is probably because you are using the same cache directory for both installations.
Consider deleting the files in

or explicitly set another cache dir, as for instance done in
https://jorgensd.github.io/dolfinx-tutorial/chapter4/compiler_parameters.html#jit-parameters-and-visualization-using-pandas

1 Like