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

"Expression" does not work anymore

+4 votes

Hello everyone.

For some reason, the "Expression" function suddenly stopped working on my computer. It was working fine the last time I used Fenics (about two weeks ago). I have not (deliberately) changed anything to fenics-related modules. I have found similar Issues on the forum, but none of them seemed to be 100% consistent with my problem.

Btw, I have this Problem in both the python2 notebook and when running python from a Terminal (2.7.6)

I am posting Error message from ipython and compile.log below and would be very grateful for any help!!!

Error Message:

In instant.recompile: The module did not compile with command 'make
VERBOSE=1', see '/home/sebastian/.instant/error
/dolfin_compile_code_b75a7140f4b7f593c8d2e8c722e633c4711e3c15
/compile.log'

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-3acb5d0a57d7> in <module>()
     18 V2 = V*V
     19 
---> 20 u0 = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]')

/usr/lib/python2.7/dist-packages/dolfin/functions/expression.pyc in __new__(cls, cppcode, element, cell, domain, degree, name, label, mpi_comm, **kwargs)
    600         cpp_base, members = compile_expressions([cppcode],
    601                                                 [generic_function_members], \
--> 602                                                 mpi_comm=mpi_comm)
    603         cpp_base, members = cpp_base[0], members[0]
    604 

/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.pyc in compile_expressions(cppargs, generic_function_members, mpi_comm)
    215         code_snippets), classnames, additional_declarations="\n".join(\
    216                                                      additional_declarations),
--> 217                                                  mpi_comm=mpi_comm)
    218 
    219     return expression_classes, all_members

/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.pyc in compile_expression_code(code, classnames, module_name, additional_declarations, mpi_comm)
    143     compiled_module = compile_extension_module(\
    144         code, additional_declarations=additional_declarations, \
--> 145         mpi_comm=mpi_comm)
    146 
    147     # Get the compiled class

/usr/lib/python2.7/dist-packages/dolfin/compilemodules/jit.pyc in mpi_jit(*args, **kwargs)
     62         # Just call JIT compiler when running in serial
     63         if MPI.size(mpi_comm) == 1:
---> 64             return local_jit(*args, **kwargs)
     65 
     66         # Compile first on process 0

/usr/lib/python2.7/dist-packages/dolfin/compilemodules/compilemodule.pyc in compile_extension_module(code, module_name, additional_declarations, additional_system_headers, mpi_comm, **instant_kwargs)
    456         code              = code,
    457         additional_declarations = _additional_declarations % declaration_strs,
--> 458         **instant_kwargs)
    459 
    460     sys.stdout.flush()

/usr/lib/python2.7/dist-packages/instant/build.pyc in build_module(modulename, source_directory, code, init_code, additional_definitions, additional_declarations, sources, wrap_headers, local_headers, system_headers, include_dirs, library_dirs, libraries, swigargs, swig_include_dirs, cppargs, lddargs, object_files, arrays, generate_interface, generate_setup, cmake_packages, signature, cache_dir)
    561 
    562         # Recompile if necessary
--> 563         recompile(modulename, module_path, new_compilation_checksum, build_system)
    564 
    565         # --- Load, cache, and return module

/usr/lib/python2.7/dist-packages/instant/build.pyc in recompile(modulename, module_path, new_compilation_checksum, build_system)
    163                     os.remove(compilation_checksum_filename)
    164                 msg = "In instant.recompile: The module did not compile with command '%s', see '%s'"
--> 165                 instant_error(msg % (cmd, compile_log_filename_dest))
    166 
    167     finally:

/usr/lib/python2.7/dist-packages/instant/output.pyc in instant_error(*message)
     83     _log.error(*message)
     84     text = message[0] % message[1:]
---> 85     raise RuntimeError(text)
     86 
     87 def instant_assert(condition, *message):

RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/sebastian/.instant/error/dolfin_compile_code_b75a7140f4b7f593c8d2e8c722e633c4711e3c15/compile.log'

And here is the compile.log
http://pastebin.com/eiVujhPh

edit: I tried downgrading from dolfin 1.5 to 1.4, but still no change.

asked Jun 13, 2015 by multigrid202 FEniCS User (3,780 points)
edited Jun 13, 2015 by multigrid202

Did you ever solve this? I've had the exact same problem for a couple months now - Expression stopped working one day, along with the same RuntimeError message and libsuitesparse error in the compile log here. I spent a long time trying to figure it out but couldn't, so I just aviod using Expressions now. It's really frustrating...

Hi Nick. Sry I am busy on a project atm. Fenics does all I need if I don't use Expressions. I will try to fix this once I have more time. If I manage to solve this, I will let you know immediately.

Hi, I too have run into the exact same problem and spent quite a bit of time attempting to debug it. Would love to know if either of you have found a solution yet. I've just submitted a post to fenics-support linking to this post. Hopefully we can come up with a quick and easy fix.

Hello, sorry I still have no solution to this problem. Sorry for the late reply, I haven't really checked in for a while now

Yeah me neither. I ended up eventually reinstalling my operating system and then installing fenics again from scratch and that worked.

1 Answer

0 votes

Looks like a link problem with libsuitesparse

answered Jun 13, 2015 by chris_richardson FEniCS Expert (31,740 points)

Hi Chris,

thanks for your answer. Unfortunately, I don't really know what to do with this information. Do you have any advice for me? Or is there any other information that would help solve the problem?

regards

Sorry - it can be a bit difficult to sort out sometimes. It looks like your code is trying to link against a static library "libsuitesparse.a", and can't. Often this is caused by having multiple versions on your system, and having the wrong one in your LD_LIBRARY_PATH. You could start by doing "locate libsuitesparse" to track it down.
There was a similar problem recently on the development buildbot - I'm not sure what the resolution was, but you might find something useful on the bitbucket site, too.

I think this was the fix:

https://bitbucket.org/fenics-project/dolfin/commits/fa7cc1ea13725de050f5913c9cdf2da35ac2186c?at=next

Hi Chris,

Sorry for getting back to you so late, but unfortunately I was busy with other things.

I tried using your advice, but I don't really know what to do with the output.

It does not seem that I have multiple versions of libsuitesparse installed. The only version number I can find on my computer is 4.4.3

However, none of the files from locate libsuitesparse are called libsuitesparse.a. There's only a (unique) libsuitesparseconfig.a (which seems to be the one causeing the problem acording to the log-file).

What is LD_LIBRARY_PATH? echo $LD_LIBRARY_PATH shows nothing.

regards

...