Subject: Re: [Deb-dev] [DOLFIN-dev] Debian/Ubuntu Repositories

From: "Åsmund Ødegård" <[email-masked]>
Date: Tue, 2 Oct 2007 00:13:52 +0200

[moving discussion to the deb-dev list as requested by some on the
dolfin-dev list]

On 10/1/07, Lorenzo Isella <[email-masked]> wrote:
>
> Hello,
> And many thanks for your efforts.
> I think the dependency problems have been solved (since I can now
> install libdolfin-dev) but something is still missing.
> See what happens when I try running the tutorial:
>
> python demo.py
> Creating sub domain markers for boundary condition.
> Solving linear PDE.
> ['ffc_form_0_module.i', '../ffc_form_0.h']
> ['ffc_form_0_module.i', '../ffc_form_0.h']
> Traceback (most recent call last):
>   File "/home/iselllo/temp/dolfin/demo.py", line 47, in ?
>     u = pde.solve()
>   File "/usr/lib/python2.4/site-packages/dolfin/assemble.py", line 107, in
> solve
>     A = assemble(self.a, self.mesh)
>   File "/usr/lib/python2.4/site-packages/dolfin/assemble.py", line 24,
> in assemble
>     (compiled_form, module, form_data) = jit(form)
>   File "/usr/lib/python2.4/site-packages/ffc/jit/jit.py", line 68, in jit
>     exec("compiled_form = compiled_module.%s()" % form_name)
>   File "<string>", line 1, in ?
> AttributeError: 'module' object has no attribute 'ffc_form_0BilinearForm'
>
> Some folders and files are created, but something clearly goes wrong.
> Again, many thanks for your efforts!

The errormessage is indeed not very clear. I think the reason for this error
is a wrong pkg-config file for ufc. Please, edit the file
/usr/lib/pkgconfig/ufc-1.pc such that the last line reads:

Cflags: -I/usr/include

(This will be fixed in the next version of ufc debian-package).

Remark that you will also need swig 1.3.31 (which is not available on debian
stable at least), and the python-dev package is also required (I probably
have to introduce this is a dependency of the ffc-package).
As the example try to build an extension modules to python, the gcc compiler
is also required, but I assume you have that one.

Thank's for helping out in the debugging process, this is very welcome!

Lorenzo
>
>
>
> On 01/10/2007, Åsmund Ødegård <[email-masked]> wrote:
> > Lorenzo, LUK, list;
> >
> > I am now able to install libdolfin-dev and do "python -c 'import
> dolfin'" on
> > both Ubuntu and Debian (etch), i.e. on both python2.4 and python2.5.
> >
> > There are still some issues with e.g. the SyFI package, but basic stuff
> > should be in a working condition. Dolfin now depends on libufsparse.
> >
> >
> > Please tell me how it works for you!
> >
> >
>

-- 
[simula.research laboratory]
                 Åsmund Ødegård
                 IT-Manager
                 phone: +4790069915
                 http://www.simula.no/

---

From: "Åsmund Ødegård" <[email-masked]>
Date: Tue, 2 Oct 2007 00:18:31 +0200

On 10/1/07, LUK ShunTim <[email-masked]> wrote:
> Lorenzo Isella wrote:
> >   File "/usr/lib/python2.4/site-packages/dolfin/assemble.py", line 107,
> in solve
> Yap, same here. I tested a few of the C++ demos and they ran fine.

See  my other reply (and tell me about any progress!)

> I don't have such luck :-) with the *pure python modules* for python2.5
> (python 2.4 is fine) in Debian/sid. I got these errors:
>
>   File "<string>", line 1, in <module>
>   File "/usr/lib/python2.5/site-packages/dolfin/__init__.py", line 4, in
> <module>
>     from assemble import *
>   File "/usr/lib/python2.5/site-packages/dolfin/assemble.py", line 16,
> in <module>
>     from ffc import *
> ImportError: No module named ffc
>
> I cannot find the modules under /usr/lib/python2.5/site-packages/.
> Importing dolfin is fine, though, as can be seen above.

The pure python packages should be found in /usr/share/pycentral. I have to
look a bit more into the sid-issue to figure out why the links are not set
up correctly for python2.5 on that platform. Stay tuned.

I'll take a go at building them from source tomorrow on an amd64 box at
> my office and see what happens.

Ok - let me hear about it. As soon as we are satisfied with the packages on
i386, we will start building them on amd64 and probably itanium as well (and
creating fink-packages for MacOSX :).

---

From: LUK ShunTim <[email-masked]>
Date: Tue, 02 Oct 2007 11:30:36 +0800

Åsmund Ødegård wrote:
> 
> 
> On 10/1/07, *LUK ShunTim* <[email-masked] 
> <mailto:[email-masked]>> wrote:
> 
>     Lorenzo Isella wrote:
>      > Hello,
>      >   File "/usr/lib/python2.4/site-packages/dolfin/assemble.py",
>     line 107, in solve
>      > On 01/10/2007, Åsmund Ødegård < [email-masked]
>     <mailto:[email-masked]>> wrote:
>      >> Lorenzo, LUK, list;
>      >>
> The pure python packages should be found in /usr/share/pycentral. I have 
> to look a bit more into the sid-issue to figure out why the links are 
> not set up correctly for python2.5 on that platform. Stay tuned.

I think if you modify the "debian/control" file of these modules, it 
gets installed in the correct place. Here's the diff for ufc, for example.

<udiff-file>
--- 00/control.orig     2007-10-02 11:20:18.000000000 +0800
+++ debian/control      2007-10-02 11:20:50.000000000 +0800
@@ -2,9 +2,9 @@
  Section: devel
  Priority: optional
  Maintainer: �smund �deg�rd (Debian) <[email-masked]>
-Build-Depends: debhelper (>= 5), python-dev, python-central (>= 0.5)
+Build-Depends: debhelper (>= 5), python-all, python-central (>= 0.5)
  Standards-Version: 3.7.2
-XS-Python-Version: current
+XS-Python-Version: all

  Package: ufc
  Architecture: all
</udiff-file>

This is a pure python module, build-depends on python would be enough.

Regards,
ST
--

---

From: LUK ShunTim <[email-masked]>
Date: Tue, 02 Oct 2007 13:42:41 +0800

Åsmund Ødegård wrote:
> On 10/1/07, *Lorenzo Isella* < [email-masked] 
> <mailto:[email-masked]>> wrote:
> 
>     Hello,
>       File "/usr/lib/python2.4/site-packages/dolfin/assemble.py", line
>     107, in solve
> The errormessage is indeed not very clear. I think the reason for this 
> error is a wrong pkg-config file for ufc. Please, edit the file 
> /usr/lib/pkgconfig/ufc- 1.pc such that the last line reads:
> 
> Cflags: -I/usr/include
> 

Hello Asmund,

I think it's the difference that --prefix is used in setup.py and the 
debian build system. Here's a hackish way to fix it in the debian/rules 
file. Alternatively, we can patch setup.py.

<udiff-file>
--- rules.orig  2007-10-02 12:51:41.000000000 +0800
+++ debian/rules        2007-10-02 13:31:26.000000000 +0800
@@ -58,7 +58,12 @@
         # Add here commands to install the package into debian/fiat.
         #$(MAKE) DESTDIR=$(CURDIR)/debian/fiat install
         python setup.py install --prefix=$(CURDIR)/debian/ufc/usr
-
+
+       ### Fix path to pkgconfig file and put into correct place
+       sed 's!$(CURDIR)/debian/ufc!!' ufc-1.pc >tmp
+       mv -f tmp ufc-1.pc
+       cp -f ufc-1.pc $(CURDIR)/debian/ufc/usr/lib/pkgconfig/
+
  # Build architecture-independent files here.
  binary-indep: build install
         dh_testdir
</udiff-file>

Regards,
ST
--

---

From: "Åsmund Ødegård" <[email-masked]>
Date: Tue, 2 Oct 2007 12:11:22 +0200

On 10/2/07, LUK ShunTim <[email-masked]> wrote:
> 24,

Actually, the correct way is to use --root I think. I have already tested
this, and it works!

[snip]

---

From: LUK ShunTim <[email-masked]>
Date: Tue, 02 Oct 2007 18:41:13 +0800

Åsmund Ødegård wrote:
> 
> 
> On 10/2/07, *LUK ShunTim* <[email-masked] 
>     <mailto:[email-masked]>
>      > <mailto:[email-masked]
>     <mailto:[email-masked]>>> wrote:
>      >
>      >     Hello,
>     line
>     line 24,
>      >       File "/usr/lib/python2.4/site-packages/ffc/jit/jit.py",
>     line 68,
>      >     in jit
> Actually, the correct way is to use --root I think. I have already 
> tested this, and it works! 
> 
> [snip]

Yes, it should be.

But if you tried that then the ufc module would finally be installed 
under /usr/lib/python<current>/site-package/ and not 
/usr/share/pycentral. That's what I got when I try building the ufc-1.0 
from deb-src this morning. Are you using a newer version?

Thanks for sharing,
ST
--

---

From: "Åsmund Ødegård" <[email-masked]>
Date: Tue, 2 Oct 2007 22:34:56 +0200

> from deb-src this morning. Are you using a newer version?

I'm on the same version of ufc, but I am playing tricks with the stuff in
the debian subdir, which is not in the version you are using.

To be sure, I checked it. The way I do the debs now, stuff still ends up in
/usr/share/pycentral.

It will lasts a few day for this stuff appear in the debian repository at
fenics.org, there are still some stuff I want to sort out, and we are having
a baby one of these days...

---

From: LUK ShunTim <[email-masked]>
Date: Wed, 03 Oct 2007 14:39:35 +0800

Åsmund Ødegård wrote:
>      >      >       File
>     "/usr/lib/python2.4/site-packages/dolfin/assemble.py",
>      >     line
>      >      >     107, in solve
>      >      >         A = assemble( self.a, self.mesh)
>      >      >       File
>     "/usr/lib/python2.4/site-packages/dolfin/assemble.py",
>      >     line 24,
>      >      >     in assemble

[snipped]

>      >      > The errormessage is indeed not very clear. I think the
>     reason for
>      >     this

[snipped]

> 
> It will lasts a few day for this stuff appear in the debian repository 
> at fenics.org <http://fenics.org>, there are still some stuff I want to 
> sort out, and we are having a baby one of these days...

Fixing ufc-1.pc got me further until a similar error when ffc is invoked 
to compile a form for the line "u = pde.solve()". I'm not sure this is a 
upstream bug or just a packaging glitch. It'd be useful to distinguish 
between the two.

I won't bother you for now as the packaging is still in a state of flux.

And when life is concerned, everything can wait. Congratulatons and take 
care,
ST
--