Comment 2 for bug 882560

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) wrote : Re: [Bug 882560] Re: tr1::cyl_bessel_* functions are not found at linking stage of jit

On 27 October 2011 15:50, Garth Wells <email address hidden> wrote:
> I've added the math library to DOLFIN, but it doesn't seem to help.
> Perhaps Instant is not taking the flags from DOLFIN?

It looks like FFC.Jit calls instant through UFC passing only a few arguments.
Adding the line:

            libraries=["boost_math_tr1"])

to the call to

module = ufc_utils.build_ufc_module(

in jit_form() seems to do the trick.

The question is if we should ask users to set this manually through
the parameter system like 'cpp_optimize'?

> ** Changed in: dolfin
>       Status: New => Confirmed
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/882560
>
> Title:
>  tr1::cyl_bessel_* functions are not found at linking stage of jit
>
> Status in DOLFIN:
>  Confirmed
>
> Bug description:
>  When a jit compiled module using bessel functions is imported into
>  python, it fails with an undefined symbol error. Probably because the
>  boost math tr1 library is not linked in.
>
>  ImportError:/home/martinal/.instant/cache/d003d0ea29ed9346265963000f1a90648953f6a6/_d003d0ea29ed9346265963000f1a90648953f6a6.so:
>  undefined symbol: boost_cyl_bessel_j;
>
>
>  Code to reproduce:
>
>  from dolfin import *
>  mesh = Interval(10, 0.1, 2.0)
>  V = FunctionSpace(mesh, "CG", 1)
>  x = interval.x
>  f = bessel_J(0, x)
>  g = project(f, V)
>  plot(g, mesh=mesh)
>  interactive()
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/882560/+subscriptions
>