There is a bug in dolfinx, as I can reproduce this with:
import dolfinx
from mpi4py import MPI
import ufl
N = 4
mesh = dolfinx.UnitSquareMesh(MPI.COMM_WORLD,N, N,dolfinx.cpp.mesh.CellType.quadrilateral)
deg = 1
We = ufl.FiniteElement("Lagrange", mesh.ufl_cell(), deg)
V = dolfinx.FunctionSpace(mesh, We)
u = ufl.TestFunction(V)
du = ufl.TrialFunction(V)
dx_shear = ufl.dx(metadata={"quadrature_degree": 2*deg-2})
a = ufl.inner(du, u) * ufl.dx + ufl.inner(du, u) * dx_shear
A = dolfinx.fem.assemble_matrix(a)
and error message
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:50: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:102: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:154: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:897:206: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c0 = coordinate_dofs[0] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:50: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:102: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:154: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:898:207: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c3 = coordinate_dofs[1] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:50: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:102: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:154: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:899:206: error: use of undeclared identifier 'FE4_C1_D01_Qf81'; did you mean 'FE4_C1_D01_Qa2c'?
const double J_c1 = coordinate_dofs[0] * FE4_C1_D01_Qf81[0][0][iq][0] + coordinate_dofs[3] * FE4_C1_D01_Qf81[0][0][iq][1] + coordinate_dofs[6] * FE4_C1_D01_Qf81[0][0][iq][2] + coordinate_dofs[9] * FE4_C1_D01_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C1_D01_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:882:25: note: 'FE4_C1_D01_Qa2c' declared here
static const double FE4_C1_D01_Qa2c[1][1][1][4] = { { { { -0.4999999999999999, -0.4999999999999999, 0.5, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:50: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:102: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:154: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:900:207: error: use of undeclared identifier 'FE4_C0_D10_Qf81'; did you mean 'FE4_C0_D10_Qa2c'?
const double J_c2 = coordinate_dofs[1] * FE4_C0_D10_Qf81[0][0][iq][0] + coordinate_dofs[4] * FE4_C0_D10_Qf81[0][0][iq][1] + coordinate_dofs[7] * FE4_C0_D10_Qf81[0][0][iq][2] + coordinate_dofs[10] * FE4_C0_D10_Qf81[0][0][iq][3];
^~~~~~~~~~~~~~~
FE4_C0_D10_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:881:25: note: 'FE4_C0_D10_Qa2c' declared here
static const double FE4_C0_D10_Qa2c[1][1][1][4] = { { { { -0.4999999999999998, 0.5, -0.4999999999999999, 0.5 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:909:27: error: use of undeclared identifier 'FE3_C0_Qf81'; did you mean 'FE3_C0_Qa2c'?
t0[i] = fw0 * FE3_C0_Qf81[0][0][iq][i];
^~~~~~~~~~~
FE3_C0_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:880:25: note: 'FE3_C0_Qa2c' declared here
static const double FE3_C0_Qa2c[1][1][1][4] = { { { { 0.25, 0.25, 0.25, 0.25 } } } };
^
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:912:33: error: use of undeclared identifier 'FE3_C0_Qf81'; did you mean 'FE3_C0_Qa2c'?
A[4 * i + j] += FE3_C0_Qf81[0][0][iq][j] * t0[i];
^~~~~~~~~~~
FE3_C0_Qa2c
libffcx_forms_bbce8a268b76eee4dd2f90f2f7ed90996312136e.c:880:25: note: 'FE3_C0_Qa2c' declared here
static const double FE3_C0_Qa2c[1][1][1][4] = { { { { 0.25, 0.25, 0.25, 0.25 } } } };
^
18 errors generated.
Traceback (most recent call last):
File "/usr/lib/python3.9/distutils/unixccompiler.py", line 117, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] +
File "/usr/lib/python3.9/distutils/ccompiler.py", line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/lib/python3.9/distutils/spawn.py", line 87, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/usr/bin/clang-12' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 51, in _build
dist.run_command('build_ext')
File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.9/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/usr/lib/python3.9/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.9/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3.9/distutils/command/build_ext.py", line 529, in build_extension
objects = self.compiler.compile(sources,
File "/usr/lib/python3.9/distutils/ccompiler.py", line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/usr/lib/python3.9/distutils/unixccompiler.py", line 120, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/clang-12' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/shared/debug/mwe.py", line 19, in <module>
A = dolfinx.fem.assemble_matrix(a)
File "/usr/lib/python3.9/functools.py", line 877, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "/root/shared/dolfinx/python/dolfinx/fem/assemble.py", line 278, in assemble_matrix
A = cpp.fem.create_matrix(_create_cpp_form(a))
File "/root/shared/dolfinx/python/dolfinx/fem/assemble.py", line 27, in _create_cpp_form
return Form(form)._cpp_object
File "/root/shared/dolfinx/python/dolfinx/fem/form.py", line 42, in __init__
self._ufc_form, module, self._code = jit.ffcx_jit(
File "/root/shared/dolfinx/python/dolfinx/jit.py", line 61, in mpi_jit
return local_jit(*args, **kwargs)
File "/root/shared/dolfinx/python/dolfinx/jit.py", line 215, in ffcx_jit
r = ffcx.codegeneration.jit.compile_forms([ufl_object], parameters=p_ffcx, **p_jit)
File "/root/shared/ffcx/ffcx/codegeneration/jit.py", line 167, in compile_forms
impl = _compile_objects(decl, forms, form_names, module_name, p, cache_dir,
File "/root/shared/ffcx/ffcx/codegeneration/jit.py", line 252, in _compile_objects
ffibuilder.compile(tmpdir=cache_dir, verbose=True, debug=cffi_debug)
File "/usr/local/lib/python3.9/dist-packages/cffi/api.py", line 725, in compile
return recompile(self, module_name, source, tmpdir=tmpdir,
File "/usr/local/lib/python3.9/dist-packages/cffi/recompiler.py", line 1564, in recompile
outputfilename = ffiplatform.compile('.', ext,
File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 22, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/usr/local/lib/python3.9/dist-packages/cffi/ffiplatform.py", line 58, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command '/usr/bin/clang-12' failed with exit code 1
I will submit an issue and keep you posted.