← Back to team overview

dolfin team mailing list archive

pydolfin compile problems

 

It seems like the swig generated wrapper code for dolfin does no longer
compile. I use swig version 1.3.29 and g++ version 4.1.2, all on a 64 bit
ubuntu edgy platform.


The SWIG error is related to a va_list. Compile crash:

[...]

dolfin_wrap.cpp:9346: error: ISO C++ forbids assignment of arrays
dolfin_wrap.cpp: In function 'PyObject* _wrap_new_Function__SWIG_3(PyObject*,
PyObject*)':

[...]

make[3]: *** [_dolfin_la-dolfin_wrap.lo] Error 1
make[3]: Leaving directory `/home/skavhaug/devel/dolfin/src/pydolfin'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/skavhaug/devel/dolfin/src/pydolfin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/skavhaug/devel/dolfin/src'
make: *** [all-recursive] Error 1





The wrapper code that crashes (The line with the comment "This is illegal"):

SWIGINTERN PyObject *_wrap_Logger_info__SWIG_1(PyObject *SWIGUNUSEDPARM(self),
PyObject *args) {
  PyObject *resultobj = 0;
  dolfin::Logger *arg1 = (dolfin::Logger *) 0 ;
  char *arg2 = (char *) 0 ;
  va_list arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  void *argp3 ;
  int res3 = 0 ;
  PyObject * obj0 = 0 ;
  PyObject * obj1 = 0 ;
  PyObject * obj2 = 0 ;

  if (!PyArg_ParseTuple(args,(char *)"OOO:Logger_info",&obj0,&obj1,&obj2))
SWIG_fail;
  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_dolfin__Logger, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Logger_info" "',
argument " "1"" of type '" "dolfin::Logger *""'");
  }
  arg1 = reinterpret_cast< dolfin::Logger * >(argp1);
  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Logger_info" "',
argument " "2"" of type '" "char const *""'");
  }
  arg2 = buf2;
  {
    res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_va_list,  0  | 0);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Logger_info" "',
argument " "3"" of type '" "va_list""'");
    }
    if (!argp3) {
      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in
method '" "Logger_info" "', argument " "3"" of type '" "va_list""'");
    } else {
      va_list * temp = reinterpret_cast< va_list * >(argp3);
      arg3 = *temp; // This is illegal
      if (SWIG_IsNewObj(res3)) delete temp;
    }
  }
  (arg1)->info((char const *)arg2,arg3);
  resultobj = SWIG_Py_Void();
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
  return NULL;
}


What's going on here? The problem seems to be in the Logger class.

Ola


Follow ups