Dijitso failed to load existing file

Dear community, I recently reinstalled the lagacy version of fenics on my cluster with conda as I messed up my conda environment with some other installations last week.

I used conda install -c conda-forge fenics for the installation. (Before doing so, I deleted my miniconda folder and reinstalled conda).

After that, I found that my fenics code no longer runs with an “dijitso failed to load existing file” error. I tried to run the demo code from fenics tutorial and got the same error:

Calling FFC just-in-time (JIT) compiler, this may take some time.
dijitso failed to load existing file:
error is:
        /home/spshu/.cache/dijitso/lib/libdijitso-dolfin_expression_c49ebd8fd6c25a3c31b612f2a1752a2c.so: undefined symbol: _ZNK6dolfin8Variable3strEb
Traceback (most recent call last):
  File "/home/spshu/miniconda3/lib/python3.9/site-packages/dolfin/jit/jit.py", line 168, in compile_class
    submodule = dijitso.extract_factory_function(module, "create_" + module_name)()
  File "/home/spshu/miniconda3/lib/python3.9/site-packages/dijitso/jit.py", line 47, in extract_factory_function
    function = getattr(lib, name)
AttributeError: 'NoneType' object has no attribute 'create_dolfin_expression_c49ebd8fd6c25a3c31b612f2a1752a2c'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/spshu/tmp_scratch/demo.py", line 18, in <module>
    u_D = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]', degree=2)
  File "/home/spshu/miniconda3/lib/python3.9/site-packages/dolfin/function/expression.py", line 400, in __init__
    self._cpp_object = jit.compile_expression(cpp_code, params)
  File "/home/spshu/miniconda3/lib/python3.9/site-packages/dolfin/function/jit.py", line 158, in compile_expression
    expression = compile_class(cpp_data, mpi_comm=mpi_comm)
  File "/home/spshu/miniconda3/lib/python3.9/site-packages/dolfin/jit/jit.py", line 170, in compile_class
    raise RuntimeError("Unable to compile C++ code with dijitso")
RuntimeError: Unable to compile C++ code with dijitso

Do you have any insights on this error? How can I fix it? Thanks!

dijitso uses a cache to speed up processing when the same weak form is used. The cache might be stale due a version upgrade. Try clearing it with dijitso clean.

Unfortunately this does not solve the problem.

After running the dijitso clean command, when running the demo code, "Calling FFC just-in-time (JIT) compiler, this may take some time." appears as expected, but the same “dijitso failed to load existing file” error follows.

Hi Milankovich007, we are also encountering this issue when installing FEniCS. Did you find the cause?