Error in Instant.recompile

Hi there,
I am trying to use a code (https://bitbucket.org/finsberg/mesh_generation/src/master/demo/echo_mesh.py) available in this repo (https://bitbucket.org/finsberg/mesh_generation/src/master/). The repo ‘readme’ instructions says that the code would run with FEniCS 2016.1.0 which i have installed along side yaml, H5py and other dependencies however when ever i try to run the above mentioned demo example i.e. echo_mesh.py i get the following error:-

RuntimeError: In instant.recompile: The module did not compile with command ‘python setup.py build_ext install --install-platlib=.’, see ‘/home/fenics/.instant/error/instant_module_6845b426e05ff4716ec6f00dca3bd42f992f71cb/compile.log’

The complete error message is pasted below:-
fenics@c882ac520eaa:~/shared/meshgen/demo$ python echo_mesh.py
Round off Error
In instant.recompile: The module did not compile with command ‘python setup.py build_ext install --install-platlib=.’, see ‘/home/fenics/.instant/error/instant_module_6845b426e05ff4716ec6f00dca3bd42f992f71cb/compile.log’
Traceback (most recent call last):
File “echo_mesh.py”, line 52, in
main()
File “echo_mesh.py”, line 42, in main
M.mesh()
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 163, in mesh
mesh = self.generate_mesh()
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 224, in generate_mesh
mesh, markers, data = create_mesh(**self.parameters)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 131, in create_mesh
mesh_char_len)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 75, in estimate_round_off_buffer
bounds=(-1.0,1.0), options={“xatol” : 0.01})
File “/usr/lib/python2.7/dist-packages/scipy/optimize/_minimize.py”, line 611, in minimize_scalar
return _minimize_scalar_bounded(fun, bounds, args, **options)
File “/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py”, line 1601, in _minimize_scalar_bounded
fx = func(x, *args)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 66, in measured_vs_computed_volume
return_domain = False)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/generate_mesh.py”, line 104, in create_mesh_w_round_off_buffer
marker_ids=fiber_markers)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/mesh_utils.py”, line 904, in create_lv_geometry
mesh, markers = geo2dolfin(geocode, marker_ids=marker_ids)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/gmsh/geo2dolfin.py”, line 59, in geo2dolfin
gmsh_cpp_geo2msh(geoname, topological_dimension, mshname, logname)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/gmsh/inline_backend.py”, line 79, in gmsh_cpp_geo2msh
func = gmsh_cpp_inline(code, extra_system_headers=headers)
File “/usr/local/lib/python2.7/dist-packages/mesh_generation/gmsh/inline_backend.py”, line 43, in gmsh_cpp_inline
return inline(code, **p)
File “/usr/local/lib/python2.7/dist-packages/instant/inlining.py”, line 54, in inline
module = build_module(**kwargs)
File “/usr/local/lib/python2.7/dist-packages/instant/build.py”, line 563, in build_module
recompile(modulename, module_path, new_compilation_checksum, build_system)
File “/usr/local/lib/python2.7/dist-packages/instant/build.py”, line 137, in recompile
instant_error(msg % (cmd, compile_log_filename_dest))
File “/usr/local/lib/python2.7/dist-packages/instant/output.py”, line 85, in instant_error
raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile with command ‘python setup.py build_ext install --install-platlib=.’, see ‘/home/fenics/.instant/error/instant_module_6845b426e05ff4716ec6f00dca3bd42f992f71cb/compile.log’
Aborted

I would be thankful if someone from the community can very kindly point towards the reason of this error and possible remedy.
Best Regards,
Ovais

Hi,

Since the code is failing in the mesh generation step where it is calling out to gmsh, I suspect that you either have the wrong version of gmsh installed or you didn’t enable shared libraries when you installed gmsh.

You can have a look at the following docker image to see how to install gmsh properly on ubuntu: https://github.com/ComputationalPhysiology/docker_workflows/blob/master/mesh_generation/Dockerfile

2 Likes

Yes you were correct. Thank you very much , henrik!