issue with dolfin_compile_code

Asked by Nick Davies

Hi everyone.
Today I tried to run some fenics code that uses the Expression() function, however it is giving the following error. This didnt used to happen however latley I have not been using this part of fenics so the problem might not nessaseraly be a new one. I was using the dev version when this first occoured, so I reinstalled the stable version and the same error comes up. The error is as follows and is produced using the poisson demo.

In instant.import_module_directly: Failed to import module 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18' from '/home/nick/.instant/cache';
ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so: undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
Failed to import module found in cache. Modulename: 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
Path: '/home/nick/.instant/cache';
ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so: undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
Traceback (most recent call last):
  File "/home/nick/Work/FEniCS/share/dolfin/demo/pde/poisson/python/demo_poisson.py", line 54, in <module>
    f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
  File "/usr/lib/python2.7/dist-packages/dolfin/functions/expression.py", line 523, in __new__
    cpp_base, members = compile_expressions([cppcode])
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py", line 176, in compile_expressions
    code_snippets), classnames)
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py", line 114, in compile_expression_code
    compiled_module = compile_extension_module(code)
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/jit.py", line 66, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/compilemodule.py", line 505, in compile_extension_module
    compiled_module = instant.import_module(module_name)
  File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 156, in import_module
    return check_disk_cache(modulename, cache_dir, moduleids)
  File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 122, in check_disk_cache
    module = import_and_cache_module(path, modulename, moduleids)
  File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 68, in import_and_cache_module
    instant_assert(module is not None, "Failed to import module found in cache. Modulename: '%s';\nPath: '%s';\n%s:%s;" % (modulename, path, type(e).__name__, e))
  File "/usr/lib/python2.7/dist-packages/instant/output.py", line 55, in instant_assert
    raise AssertionError(text)
AssertionError: Failed to import module found in cache. Modulename: 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
Path: '/home/nick/.instant/cache';
ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so: undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;

Does anyone know what would be causing this or how to go about fixing it?

Thanks for any help.

P.S. OS is ubuntu 12.04 with latest updates

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Johan Hake
Solved:
Last query:
Last reply:
Revision history for this message
Best Johan Hake (johan-hake) said :
#1

Try running instant-clean.

Johan
On Jan 8, 2013 3:31 AM, "Nick Davies" <email address hidden>
wrote:

> New question #218590 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/218590
>
> Hi everyone.
> Today I tried to run some fenics code that uses the Expression() function,
> however it is giving the following error. This didnt used to happen however
> latley I have not been using this part of fenics so the problem might not
> nessaseraly be a new one. I was using the dev version when this first
> occoured, so I reinstalled the stable version and the same error comes up.
> The error is as follows and is produced using the poisson demo.
>
> In instant.import_module_directly: Failed to import module
> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18' from
> '/home/nick/.instant/cache';
> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
> Failed to import module found in cache. Modulename:
> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
> Path: '/home/nick/.instant/cache';
> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
> Traceback (most recent call last):
> File
> "/home/nick/Work/FEniCS/share/dolfin/demo/pde/poisson/python/demo_poisson.py",
> line 54, in <module>
> f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) /
> 0.02)")
> File "/usr/lib/python2.7/dist-packages/dolfin/functions/expression.py",
> line 523, in __new__
> cpp_base, members = compile_expressions([cppcode])
> File
> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py",
> line 176, in compile_expressions
> code_snippets), classnames)
> File
> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py",
> line 114, in compile_expression_code
> compiled_module = compile_extension_module(code)
> File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/jit.py",
> line 66, in mpi_jit
> return local_jit(*args, **kwargs)
> File
> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/compilemodule.py",
> line 505, in compile_extension_module
> compiled_module = instant.import_module(module_name)
> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 156, in
> import_module
> return check_disk_cache(modulename, cache_dir, moduleids)
> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 122, in
> check_disk_cache
> module = import_and_cache_module(path, modulename, moduleids)
> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 68, in
> import_and_cache_module
> instant_assert(module is not None, "Failed to import module found in
> cache. Modulename: '%s';\nPath: '%s';\n%s:%s;" % (modulename, path,
> type(e).__name__, e))
> File "/usr/lib/python2.7/dist-packages/instant/output.py", line 55, in
> instant_assert
> raise AssertionError(text)
> AssertionError: Failed to import module found in cache. Modulename:
> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
> Path: '/home/nick/.instant/cache';
> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
>
>
> Does anyone know what would be causing this or how to go about fixing it?
>
> Thanks for any help.
>
> P.S. OS is ubuntu 12.04 with latest updates
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

Revision history for this message
Nick Davies (ntd14) said :
#2

On 01/08/2013 06:45 PM, Johan Hake wrote:
> Your question #218590 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/218590
>
> Status: Open => Answered
>
> Johan Hake proposed the following answer:
> Try running instant-clean.
>
> Johan
> On Jan 8, 2013 3:31 AM, "Nick Davies" <email address hidden>
> wrote:
>
>> New question #218590 on FEniCS Project:
>> https://answers.launchpad.net/fenics/+question/218590
>>
>> Hi everyone.
>> Today I tried to run some fenics code that uses the Expression() function,
>> however it is giving the following error. This didnt used to happen however
>> latley I have not been using this part of fenics so the problem might not
>> nessaseraly be a new one. I was using the dev version when this first
>> occoured, so I reinstalled the stable version and the same error comes up.
>> The error is as follows and is produced using the poisson demo.
>>
>> In instant.import_module_directly: Failed to import module
>> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18' from
>> '/home/nick/.instant/cache';
>> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
>> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
>> Failed to import module found in cache. Modulename:
>> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
>> Path: '/home/nick/.instant/cache';
>> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
>> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
>> Traceback (most recent call last):
>> File
>> "/home/nick/Work/FEniCS/share/dolfin/demo/pde/poisson/python/demo_poisson.py",
>> line 54, in <module>
>> f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) /
>> 0.02)")
>> File "/usr/lib/python2.7/dist-packages/dolfin/functions/expression.py",
>> line 523, in __new__
>> cpp_base, members = compile_expressions([cppcode])
>> File
>> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py",
>> line 176, in compile_expressions
>> code_snippets), classnames)
>> File
>> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/expressions.py",
>> line 114, in compile_expression_code
>> compiled_module = compile_extension_module(code)
>> File "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/jit.py",
>> line 66, in mpi_jit
>> return local_jit(*args, **kwargs)
>> File
>> "/usr/lib/python2.7/dist-packages/dolfin/compilemodules/compilemodule.py",
>> line 505, in compile_extension_module
>> compiled_module = instant.import_module(module_name)
>> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 156, in
>> import_module
>> return check_disk_cache(modulename, cache_dir, moduleids)
>> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 122, in
>> check_disk_cache
>> module = import_and_cache_module(path, modulename, moduleids)
>> File "/usr/lib/python2.7/dist-packages/instant/cache.py", line 68, in
>> import_and_cache_module
>> instant_assert(module is not None, "Failed to import module found in
>> cache. Modulename: '%s';\nPath: '%s';\n%s:%s;" % (modulename, path,
>> type(e).__name__, e))
>> File "/usr/lib/python2.7/dist-packages/instant/output.py", line 55, in
>> instant_assert
>> raise AssertionError(text)
>> AssertionError: Failed to import module found in cache. Modulename:
>> 'dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18';
>> Path: '/home/nick/.instant/cache';
>> ImportError:/home/nick/.instant/cache/dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18/_dolfin_compile_code_d4025685e68b365b82b5fce1a0c3ec18.so:
>> undefined symbol: _ZNK6dolfin10Expression15value_dimensionEj;
>>
>>
>> Does anyone know what would be causing this or how to go about fixing it?
>>
>> Thanks for any help.
>>
>> P.S. OS is ubuntu 12.04 with latest updates
>>
>> --
>> You received this question notification because you are a member of
>> FEniCS Team, which is an answer contact for FEniCS Project.
>>
Worked great thanks

Revision history for this message
Nick Davies (ntd14) said :
#3

Thanks Johan Hake, that solved my question.