This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Problem with Expression

+1 vote

Hi everybody, this is my first post and I an going to ask what, to mee, looks like a very dumb question :(

Consider the tutorial given in http://fenicsproject.org/documentation/tutorial/fundamentals.html#implementation-1 , namely

from dolfin import *

# Create mesh and define function space
mesh = UnitSquareMesh(6, 4)
#mesh = UnitCube(6, 4, 5)
V = FunctionSpace(mesh, 'Lagrange', 1)

# Define boundary conditions
u0 = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]')

[...]

If I run it with Python 2.7.5, it works, but if I try to change the Expression line, whatever I enter makes it crash :(
More precisely,

u0 = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]')

works, but any of the following

u0 = Expression('1 + x[0]*x[0] + 2.0*x[1]*x[1]')
u0 = Expression('1 + x[0]*x[0] + 3*x[1]*x[1]')
u0 = Expression('1 + 2*x[0]*x[0] + 2*x[1]*x[1]')
u0 = Expression('1 + x[0]*x[0] + 1*x[1]*x[1]')

doesn't.

Python complains

$ python2 test2.py
Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/massimiliano/.instant/error/dolfin_compile_code_59a3925c9acb624970f3f16d2128c5d7/compile.log'
Traceback (most recent call last):
  File "test2.py", line 9, in <module>
    U0 = Expression('1 + x[0]*x[0] + 3*x[1]*x[1]')
  File "/usr/lib/python2.7/site-packages/dolfin/functions/expression.py", line 582, in __new__
    [generic_function_members])
  File "/usr/lib/python2.7/site-packages/dolfin/compilemodules/expressions.py", line 217, in compile_expressions
    additional_declarations))
  File "/usr/lib/python2.7/site-packages/dolfin/compilemodules/expressions.py", line 142, in compile_expression_code
    code, additional_declarations=additional_declarations)
  File "/usr/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 60, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/dolfin/compilemodules/compilemodule.py", line 448, in compile_extension_module
    **instant_kwargs)
  File "/usr/lib/python2.7/site-packages/instant/build.py", line 542, in build_module
    recompile(modulename, module_path, new_compilation_checksum, build_system)
  File "/usr/lib/python2.7/site-packages/instant/build.py", line 151, in recompile
    instant_error(msg % (cmd, compile_log_filename_dest))
  File "/usr/lib/python2.7/site-packages/instant/output.py", line 57, in instant_error
    raise RuntimeError(text)
RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/massimiliano/.instant/error/dolfin_compile_code_59a3925c9acb624970f3f16d2128c5d7/compile.log'
closed with the note: User found out of the issue
asked Oct 27, 2013 by Massimiliano Leoni FEniCS User (1,760 points)
closed Oct 28, 2013 by johanhake

Could you post the content of the config.log

Sure!

It's too long for a single message, so I'll go for pastebin http://pastebin.com/iBvLjV8c

Thanks for support :)

It might look like you do not have libgfortran installed. There are also some weird complaints about construction time of tmp directory. I would suggest you try to figure out if you have libgfortran installed, and then run instant-clean.

libgfortran should be installed as a part of package gcc-fortran [I'm on Archlinux]. In my repos there's also gcc-fortran-multilib, which is supposedly the 32bit version of the package above, but it's not easy to install as it conflicts with its 64bit counterpart.

Now I'm recompiling dolfin from Archlinux' community repos but I noted it is flagged as "outdated", don't knonw why...

Other hints or infos I can provide?
Thanks

Ok, apparently solved compiling again. It looks like there was a newer version but, somehow, hadn't been notified!

Thanks for help

...