The module did not compile with command

Hi there,

I am trying to run some fenics code for solids with Ubuntu on my Windows pc.
I installed version fenics=2017.2.0 with python=3.6 sympy=1.1.1 boost=1.65 libboost=1.65.

Some parts of fenics seem to run fine, since I can create a mesh and define function spaces. However, when I use “Expression()” I get the following error:

" RuntimeError: In instant.recompile: The module did not compile with command ‘cmake -DDEBUG=TRUE .’ "

I also get this error when using “CompiledSubDomain()”

My code is below:


from dolfin import *
from fenics import *
import numpy as np

Define mesh parameters

Lx = 2. # [cm] -length of patch
Ly = 1.
Lz = 1.
Nx = 4
Ny = 2
Nz = Ny
elem_dg = 2 # set the degree of mesh elements

Create mesh and define function space

mesh = BoxMesh(Point(0,0,0),Point(Lx,Ly,Lz),Nx,Ny,Nz)
V_normal = FunctionSpace(mesh, “Lagrange”,elem_dg)
V_vector = VectorFunctionSpace(mesh, “Lagrange”, elem_dg)
V_tensor = TensorFunctionSpace(mesh, “Lagrange”, elem_dg)

fiber_exp = Expression((“1.0”, “0.0”,“0.0”), element=V_vector.ufl_element())

The full error message is:

File “”, line 30, in
fiber_exp = Expression((“1.0”, “0.0”,“0.0”), element=V_vector.ufl_element())
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/dolfin/functions/”, line 679, in new
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/dolfin/compilemodules/”, line 266, in compile_expressions
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/dolfin/compilemodules/”, line 183, in compile_expression_code
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/dolfin/compilemodules/”, line 70, in mpi_jit
return local_jit(*args, **kwargs)
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/dolfin/compilemodules/”, line 603, in compile_extension_module
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/instant/”, line 577, in build_module
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/instant/”, line 158, in recompile
instant_error(msg % (cmd, compile_log_filename_dest))
File “/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/lib/python3.6/site-packages/instant/”, line 96, in instant_error
raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile with command ‘cmake -DDEBUG=TRUE .’, see ‘/home/mvdknaap/anaconda3/envs/fenics-2017-2-new/.cache/instant/error/dolfin_16904bd4f218f3971471e7768edfd087b53fdf38/compile.log’

The compile log tells:
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

– Configuring incomplete, errors occurred!

See also “/tmp/tmpbj70l9s_2020-12-28-11-08_instant_44f59f19d720d7567e1428c71e966a4151401d3b/dolfin_16904bd4f218f3971471e7768edfd087b53fdf38/CMakeFiles/CMakeOutput.log”.

compile.log (END)

I guess some versions are not compatible, but my knowledge in software is not sufficient to some this. I am still using the older version because the models I will use later on are not compatible with the newer fincs versions. It would be really nice if someone could help me fix this problem, so I can finally start building some models instead of keep struggling with the installation.

Thanks in advance,


Seems like you are using the wrong version of cmake:

The easiest way of using dolfin of Windows is by using docker (Which has easy access to a large span of versions, 2016.2.0-dev version), and saves you from installation issues.

Thanks a lot for your reply. Though I do not really know how to solve it. In the link you shared they are doing cross compiling, but I am trying to install and run with ubuntu.

Also they say: “the problem is about the version of cmake 3.16.0 has this problem, but it can build under 3.10.3.”
My cmake version is 3.18.2. Should I also change it to 3.10.3? And if so, how do I do that?



If you are installing dolfin from source, you should be able to follow How to install dolfin on Ubuntn-20.04 from source

I still recommend using docker, as you can then skip all installation by running

docker run -ti -p -v $(pwd):/home/fenics/shared -w /home/fenics/shared

It took a while but the problem is solved. Running the lines:

Sudo apt-get install make
Sudo apt-get install --reinstall pkg-config cmake-data

This way fenics can find the right files and my code does run.