← Back to team overview

dolfin team mailing list archive

Re: compile errors (pydolfin)

 

Should be fixed now.

Garth

Ola Skavhaug wrote:
Ola Skavhaug skrev den 27/03-2007 følgende:
A bit more info; the wrapper code typically contains functions like this:

SWIGINTERN PyObject *_wrap_BoundaryCondition_applyBC__SWIG_0(PyObject
*SWIGUNUSE
  PyObject *resultobj = 0;
  dolfin::BoundaryCondition *arg1 = (dolfin::BoundaryCondition *) 0 ;
  dolfin::GenericMatrix *arg2 = 0 ;
  dolfin::GenericVector *arg3 = 0 ;
  dolfin::Mesh *arg4 = 0 ;
  dolfin::ufc::finite_element *arg5 = 0 ;
  [ ... ]

Hopefully, you'll be able to figure out a solution, because I'm too tired now.

Ola

A fresh start today revealed that the problem was in the header file
src/kernel/fem/dolfin/BoundaryCondition.h, and that the following fix works:

[...]

namespace dolfin
{

  class BoundaryValue;
  class Point;
  class GenericMatrix;
  class GenericVector;
  class Mesh;
  //class ufc::finite_element;
  //class ufc::dof_map;

[...]

The original forward declarations are in a sense ambiguous, as the class
ufc::finite_element is declared inside the dolfin namespace. The compiler
follows the included files and resolved this correctly, but SWIG can not.

Moving the forward declarations outside namespace dolfin work as
well. Perhaps this is the cleanest solution:

[...]

class ufc::finite_element;
class ufc::dof_map;

namespace dolfin
{

  class BoundaryValue;
  class Point;
  class GenericMatrix;
  class GenericVector;
  class Mesh;

[...]


Ola
Ola Skavhaug skrev den 27/03-2007 følgende:
After my latest pull, I get the following errors when compiling the pydolfin
wrappers:

dolfin_wrap.cpp: In function 'int SWIG_AsPtr_std_string(PyObject*,
std::string**)':
dolfin_wrap.cpp:3892: warning: dereferencing type-punned pointer will break
strict-aliasing rules
dolfin_wrap.cpp: In function 'int SWIG_AsVal_bool(PyObject*, bool*)':
dolfin_wrap.cpp:3919: warning: dereferencing type-punned pointer will break
strict-aliasing rules
dolfin_wrap.cpp:3922: warning: dereferencing type-punned pointer will break
strict-aliasing rules
dolfin_wrap.cpp: In function 'PyObject*
_wrap_BoundaryCondition_applyBC__SWIG_0(PyObject*, PyObject*)':
dolfin_wrap.cpp:26939: error: 'dolfin::ufc' has not been declared
dolfin_wrap.cpp:26939: error: 'arg5' was not declared in this scope
dolfin_wrap.cpp:26993: error: expected type-specifier
dolfin_wrap.cpp:26993: error: expected `>'
dolfin_wrap.cpp:26993: error: expected `('
dolfin_wrap.cpp:26993: error: 'dolfin::ufc' has not been declared
dolfin_wrap.cpp:26993: error: expected primary-expression before '>' token
dolfin_wrap.cpp:26993: error: expected `)' before ';' token
dolfin_wrap.cpp: In function 'PyObject*
_wrap_BoundaryCondition_applyBC__SWIG_1(PyObject*, PyObject*)':
dolfin_wrap.cpp:27007: error: 'dolfin::ufc' has not been declared
dolfin_wrap.cpp:27007: error: 'arg4' was not declared in this scope
dolfin_wrap.cpp:27008: error: 'dolfin::ufc' has not been declared
dolfin_wrap.cpp:27008: error: 'arg5' was not declared in this scope
dolfin_wrap.cpp:27054: error: expected type-specifier
dolfin_wrap.cpp:27054: error: expected `>'
dolfin_wrap.cpp:27054: error: expected `('
dolfin_wrap.cpp:27054: error: 'dolfin::ufc' has not been declared
dolfin_wrap.cpp:27054: error: expected primary-expression before '>' token
dolfin_wrap.cpp:27054: error: expected `)' before ';' token
dolfin_wrap.cpp:27062: error: expected type-specifier
dolfin_wrap.cpp:27062: error: expected `>'
dolfin_wrap.cpp:27062: error: expected `('

etc.


Ola
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev





References