I recently installed FEniCSx 0.5.1 on a laptop and on a desktop computer, both on a new install of Ubuntu 22 LTS. My existing scripts run fine on the laptop, but for some reason running the exact same scripts on the desktop PC results in the following error:
INFO:root:/home/sebastiaan/miniforge3/envs/caddee/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/sebastiaan/miniforge3/envs/caddee/include -fPIC -O2 -isystem /home/sebastiaan/miniforge3/envs/caddee/include -march -DNDEBUG -D_FORTIFY_SOURCE -fPIC -I/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/ffcx/codegeneration -I/home/sebastiaan/miniforge3/envs/caddee/include/python3.9 -c libffcx_forms_062cdda3b79c1137c54891d6fea1c8be87a7275e.c -o ./libffcx_forms_062cdda3b79c1137c54891d6fea1c8be87a7275e.o -O2 -g0
x86_64-conda-linux-gnu-cc: error: unrecognized command-line option '-march'
Traceback (most recent call last):
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 185, in _compile
self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn
spawn(cmd, dry_run=self.dry_run, **kwargs)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command '/home/sebastiaan/miniforge3/envs/caddee/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/cffi/ffiplatform.py", line 48, in _build
dist.run_command('build_ext')
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/dist.py", line 963, in run_command
super().run_command(command)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 88, in run
_build_ext.run(self)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
self.build_extensions()
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
_build_ext.build_extension(self, ext)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
objects = self.compiler.compile(
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py", line 600, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py", line 187, in _compile
raise CompileError(msg)
distutils.errors.CompileError: command '/home/sebastiaan/miniforge3/envs/caddee/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/sebastiaan/Repositories/femo/examples/test_shell_m3l/run_pav_shell_2WayCoupling.py", line 249, in <module>
fenics_invariantmatrix_petsc_component = assemble_matrix(form(inner(fenics_force_function_component, fenics_disp_function_component)*dx))
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/dolfinx/fem/forms.py", line 166, in form
return _create_form(form)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/dolfinx/fem/forms.py", line 161, in _create_form
return _form(form)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/dolfinx/fem/forms.py", line 135, in _form
ufcx_form, module, code = jit.ffcx_jit(mesh.comm, form,
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/dolfinx/jit.py", line 56, in mpi_jit
return local_jit(*args, **kwargs)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/dolfinx/jit.py", line 204, in ffcx_jit
r = ffcx.codegeneration.jit.compile_forms([ufl_object], parameters=p_ffcx, **p_jit)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/ffcx/codegeneration/jit.py", line 168, in compile_forms
impl = _compile_objects(decl, forms, form_names, module_name, p, cache_dir,
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/ffcx/codegeneration/jit.py", line 252, in _compile_objects
ffibuilder.compile(tmpdir=cache_dir, verbose=True, debug=cffi_debug)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/cffi/api.py", line 725, in compile
return recompile(self, module_name, source, tmpdir=tmpdir,
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/cffi/recompiler.py", line 1564, in recompile
outputfilename = ffiplatform.compile('.', ext,
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/cffi/ffiplatform.py", line 20, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
File "/home/sebastiaan/miniforge3/envs/caddee/lib/python3.9/site-packages/cffi/ffiplatform.py", line 54, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.VerificationError: CompileError: command '/home/sebastiaan/miniforge3/envs/caddee/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1
I’ve encountered this in multiple scripts. Running the same scripts in debug mode in Visual Studio Code works fine for some reason.
Dolfinx was installed through mamba/conda on both computers, but the fact that this issue only occurs on my desktop computer makes me think that this is a hardware- or driver-dependent problem. @jkrokowski reported the same issue in this thread late last year with Dolfin 0.6.0. We’re both running Ubuntu 22 LTS on Dell Optiplex 7090 computers. I’m running version 10.4.0 of gcc_linux-64
and gxx_linux-64
whereas @jkrokowski runs version 12.3.0 of both.
This thread seems to contain the same issue, but no solution was found. Some coworkers that run Dolfinx on the same hardware reported no similar issues, but they were running Ubuntu 20 instead. I’m not sure what the issue could be, so I’m posting this in hopes that other people have encountered this as well and found a solution, or at the very least could help me out with finding a solution.