← Back to team overview

dolfin team mailing list archive

Re: UFC Python wrapper location change?

 

On Fri, Aug 20, 2010 at 08:29:44PM +0100, Garth N. Wells wrote:
> On Fri, 2010-08-20 at 21:05 +0200, Anders Logg wrote:
> > On Fri, Aug 20, 2010 at 11:01:40AM -0700, Johan Hake wrote:
> > > On Friday August 20 2010 03:10:27 Anders Logg wrote:
> > > > On Fri, Aug 20, 2010 at 11:03:21AM +0100, Garth N. Wells wrote:
> > > > > On Fri, 2010-08-20 at 11:56 +0200, Anders Logg wrote:
> > > > > > On Fri, Aug 20, 2010 at 10:54:04AM +0100, Garth N. Wells wrote:
> > > > > > > I'm running into a Python error (below), which I suspect is due to
> > > > > > > the relocation of the UFC Python module (now in its own
> > > > > > > subdirectory). Do I need to add
> > > > > > >
> > > > > > >     from ufc import *
> > > > > > >
> > > > > > > somewhere?
> > > > > > >
> > > > > > > Garth
> > > > > > >
> > > > > > > Traceback (most recent call last):
> > > > > > >   File "demo.py", line 20, in <module>
> > > > > > >
> > > > > > >     from dolfin import *
> > > > > > >
> > > > > > >   File
> > > > > > >
> > > > > > > "/home/garth/Work/FEniCS/lib/python2.6/site-packages/dolfin/__init__.
> > > > > > > py", line 13, in <module>
> > > > > > >
> > > > > > >     import dolfin.cpp as cpp
> > > > > > >
> > > > > > >   File
> > > > > > >
> > > > > > > "/home/garth/Work/FEniCS/lib/python2.6/site-packages/dolfin/cpp.py",
> > > > > > > line 8902, in <module>
> > > > > > >
> > > > > > >     class GenericFunction(ufc.function,Variable):
> > > > > > > AttributeError: 'module' object has no attribute 'function'
> > > > > >
> > > > > > Looks like a missing __init__.py in the ufc directory, but I thought
> > > > > > that was added?
> > > > >
> > > > > It's present on my machine.
> > > > >
> > > > >
> > > > > Make sure that you clean out any pkg-config and old versions for UFC.
> > > >
> > > > It's all installed in one directory which I just delete before
> > > > testing.
> > >
> > > You also need to get rid of old ufc.py{c} and _ufc.so sticking around.
> >
> > They are also somewhere under the same install tree and I just delete
> > the entire tree so that shouldn't be an issue.
> >
> > > Does it work now when function is imported?
> >
> > Yes, everything builds fine (just finished on Lucid) but something is
> > wrong which prevents me from running the demos. Will need to debug.
> >
>
> Are you compiling the demos with CMake/make or SCons?

I wasn't sourcing the correct file before.

I'm getting a ton of these now when I compile the Poisson demo:

/home/logg/scratch/lib/fenics-dev/lib/libpytrilinos.so: undefined
reference to `PyObject_SetAttrString'
/home/logg/scratch/lib/fenics-dev/lib/libpytrilinos.so: undefined
reference to `PyType_IsSubtype'
/home/logg/scratch/lib/fenics-dev/lib/libpytrilinos.so: undefined
reference to `PyErr_Fetch'
/home/logg/scratch/lib/fenics-dev/lib/libpytrilinos.so: undefined
reference to `PyCObject_Import'
/home/logg/scratch/lib/fenics-dev/lib/libpytrilinos.so: undefined
reference to `PyExc_RuntimeError'

Any ideas? I have never really used Trilinos before so I'm not
familiar with how it's setup, but do we really use the Python wrappers
for Trilinos? Perhaps they can be disabled in the build to get around
this.

--
Anders



Follow ups

References