← Back to team overview

fenics team mailing list archive

Re: dolfinPython wrapper error in dorsal

 

On Sun, Nov 18, 2012 at 9:16 PM, Shiyuan <gshy2014@xxxxxxxxx> wrote:
> Hi,
>    I try to build FEniCS using dorsal on Mac 10.7. but at first python
> wrapper fails to build.  The swig interface in dolfinPYTHON_wrap.cxx are not
> correct generated and cannot be compiled.  After the following patch is
> applied, it can be compiled but the demo programs don't run due to some
> SWIG-boost error.
>
> mac0347712n$ python demo_cahn-hilliard.py
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Traceback (most recent call last):
>   File "demo_cahn-hilliard.py", line 64, in <module>
>     V = FunctionSpace(mesh, "Lagrange", 1)
>   File
> "/Users/sgu/softwares/mpi/FEniCS/lib/python2.7/site-packages/dolfin/functions/functionspace.py",
> line 353, in __init__
>     FunctionSpaceBase.__init__(self, mesh, element)
>   File
> "/Users/sgu/softwares/mpi/FEniCS/lib/python2.7/site-packages/dolfin/functions/functionspace.py",
> line 80, in __init__
>     self._dolfin_element = cpp.FiniteElement(ufc_element)
>   File
> "/Users/sgu/softwares/mpi/FEniCS/lib/python2.7/site-packages/dolfin/cpp.py",
> line 17790, in __init__
>     _cpp.FiniteElement_swiginit(self,_cpp.new_FiniteElement(*args))
> TypeError: in method 'new_FiniteElement', argument 1 of type
> 'boost::shared_ptr< ufc::finite_element const >'

This is the same problem as reported in
https://bugs.launchpad.net/dolfin/+bug/799513.

One solution is to downgrade to SWIG 2.0.3. You can do that by letting
Dorsal build SWIG for you. In that case, make sure to rebuild
Trilinos, UFC and DOLFIN. You will need to remove the CMake cache,
that is dorsal_build_dir, for all these project before doing the
rebuild.

Another solution might be to upgrade Xcode, however, I'm not
absolutely sure that this will make it work with SWIG 2.0.8.

Johannes


Follow ups

References