← Back to team overview

fenics team mailing list archive

Problems with Fenics port to Debian/Etch

 

Hi,

I have recently managed to build and install debian packages of Dolfin, FFC,
FIAT, UFC, Instant, SyFI, FErari, and Viper on Debian/Etch. These were
mostly backport of the Debian/Ubuntu packages in the Fenics repository. Very
few changes were necessary (3 or 4) to ensure all the code worked with
python2.4 (I am pleasently surprised). I have also used backported packages
of hashlib (from pyton2.5) numpy and matplotlib etc. Debian source packages
are available for all and will be happy to share them with anyone interested
if you let me know where and how to upload. Presently I install them from a
local repository on my laptop hard disk.

I have not yet familiarized myself with the usage of Fenics as I am
presently concerned with making sure everything is working correctly. Hence
I am looking for some sought of test suite. Is there any such thing ?

Playing around I find some things work and some don't. In particular running
the demo in the dolfin tutorial ( http://www.fenics.org/wiki/Tutorial )
produces the following error

Checking mesh ordering (finished).
Traceback (most recent call last):
  File "demo.py", line 5, in ?
    V = FunctionSpace(mesh, "CG", 1)
  File "/usr/lib/python2.4/site-packages/dolfin/functionspace.py", line 183,
in __init__
    FunctionSpaceBase.__init__(self, mesh, element)
  File "/usr/lib/python2.4/site-packages/dolfin/functionspace.py", line 45,
in __init__
    self.__ufc_element, self.__ufc_dofmap = jit(self._element)
  File "/usr/lib/python2.4/site-packages/dolfin/jit.py", line 43, in jit
    return jit_compile(form, options)
  File "/usr/lib/python2.4/site-packages/ffc/jit/jit.py", line 52, in jit
    return jit_element(object, options)
  File "/usr/lib/python2.4/site-packages/ffc/jit/jit.py", line 115, in
jit_element
    (compiled_form, module, form_data) = jit_form(form, options)
  File "/usr/lib/python2.4/site-packages/ffc/jit/jit.py", line 70, in
jit_form
    module = instant.import_module(jit_object,
cache_dir=options["cache_dir"])
  File "/usr/lib/python2.4/site-packages/instant/cache.py", line 140, in
import_module
    module, moduleids = check_memory_cache(moduleid)
  File "/usr/lib/python2.4/site-packages/instant/cache.py", line 75, in
check_memory_cache
    module = memory_cached_module(moduleid)
  File "/usr/lib/python2.4/site-packages/instant/cache.py", line 48, in
memory_cached_module
    module = _memory_cache.get(moduleid, None)
TypeError: __hash__() should return an int

The only changes made to the Instant package are the following (patch)

+++ instant-0.9.5/src/instant/cache.py
@@ -37,8 +37,8 @@
     except:
         instant_warning("In instant.import_module_directly: Failed to
import module '%s' from '%s'." % (modulename, path))
         module = None
-    finally:
         sys.path.pop(0)
+    sys.path.pop(0)
     return module


--- instant-0.9.5.orig/src/instant/build.py
+++ instant-0.9.5/src/instant/build.py
@@ -23,7 +23,7 @@
 def assert_is_str_list(x):
     instant_assert(isinstance(x, (list, tuple)),
         "In instant.build_module: Expecting sequence.")
-    instant_assert(all(isinstance(i, str) for i in x),
+    instant_assert(not False in (isinstance(i, str) for i in x),
         "In instant.build_module: Expecting sequence of strings.")

 def strip_strings(x):

However I am able to successfully run the examples on
http://www.fenics.org/wiki/Instant .

Versions of the fenics packages being used/built by me are as follows

dolfin (0.9.0)
ferari (0.0.2)
ffc (0.6.0)
fiat (0.3.4)
instant (0.9.5)
viper (0.4.2)
ufc (0.4.2)
numpy (1.1.1)
matplotlib (0.98)
hashlib (20081119 from http://code.krypto.org/python/hashlib)

I would be grateful for pointers and assistance you can give me in fixing
these problems.

Sincerely
B Thomas

Follow ups