← Back to team overview

instant team mailing list archive

Re: import_module

 

On Thu, Sep 04, 2008 at 04:38:11PM +0200, Martin Sandve Alnæs wrote:
> 2008/9/4 Anders Logg <logg@xxxxxxxxx>:
> > On Thu, Sep 04, 2008 at 04:26:24PM +0200, Martin Sandve Alnæs wrote:
> >> 2008/9/4 Anders Logg <logg@xxxxxxxxx>:
> >> > On Thu, Sep 04, 2008 at 03:59:52PM +0200, Martin Sandve Alnæs wrote:
> >> >> I know, the in-memory cache isn't quite done. I'll look at it.
> >> >
> >> > ok.
> >> >
> >> > It's important that this step is fast, so it should be as simple as
> >> > possible. Isn't it just a matter of doing
> >> >
> >> >  if object in cache:
> >> >    return cache[object]
> >> >
> >> >  signature = object.signature()
> >> >  if signature in cache:
> >> >    return cache[signature]
> >> >
> >> >  Then look at the disc-cache
> >> >
> >>
> >> Except that object doesn't have .signature if it is a string.
> >>
> >> Try now. I don't have any tests for this, we need better test coverage.
> >
> > Yes, it seems to work now, at least in part. I don't get an error at
> > least, but I have some more code to write (remove) before I know if it
> > works.
> 
> It still isn't added properly to the cache when calling build_module.

ok.

Do you have a good way to get the include directory for ufc.h (which
needs to be sent with the argument additional_declarations)?

FFC does the following:

  (path, dummy, dummy, dummy) =
  instant.header_and_libs_from_pkgconfig("ufc-1")
  if len(path) == 0:
      path = [("/").join(sysconfig.get_python_inc().split("/")[:-2]) + "/include"]
  ufc_include = '%%include "%s/ufc.h"' % path[0]

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References