wrong use of dropped `write_quadratic`

Issue #598 resolved
ftschindler created an issue

Dear all,

when building the dolfin-git package under arch linux I get the following error:

/tmp/pacaurtmp-aur/dolfin-git/src/dolfin/build/dolfin/swig/modules/io/modulePYTHON_wrap.cxx: In function ‘PyObject* _wrap_XDMFFile_write_quadratic(PyObject*, PyObject*)’:
/tmp/pacaurtmp-aur/dolfin-git/src/dolfin/build/dolfin/swig/modules/io/modulePYTHON_wrap.cxx:18354:15: error: ‘class dolfin::XDMFFile’ has no member named ‘write_quadratic’
       (arg1)->write_quadratic((dolfin::Function const &)*arg2,(dolfin::Function const &)*arg3);
               ^
dolfin/swig/modules/io/CMakeFiles/_io.dir/build.make:125: recipe for target 'dolfin/swig/modules/io/CMakeFiles/_io.dir/modulePYTHON_wrap.cxx.o' failed

The dolfin-git package is (currently) based on the current master, which for me is 8ad7544e6. The error was probably introduced in/is a result of a141acddd, which removes write_quadratic.

I do not know how swig works, but (just following the above commit) the following sed in the generated dolfin/swig/modules/io/modulePYTHON_wrap.cxx file (within the cmake build dir) fixes the issue for me, which is surely not the way to go in general...:

sed -i 's/(arg1)->write_quadratic((dolfin::Function const &)*arg2,(dolfin::Function const &)*arg3);/*arg1 << *arg2;*arg1 << *arg3;/' dolfin/swig/modules/io/modulePYTHON_wrap.cxx

Just for readability: it replaces the

(arg1)->write_quadratic((dolfin::Function const &)*arg2,(dolfin::Function const &)*arg3);

with

*arg1 << *arg2;*arg1 << *arg3;

Comments (4)

  1. Chris Richardson

    SWIG uses the header files from C++ to build its interface. If you have a clean up-to-date copy of the master branch of dolfin, then you will not get this error. Possibly, you have some old header files in your system elsewhere (e.g. in /usr/local) which are being found by SWIG.

  2. ftschindler reporter

    You were right, deinstalling dolfin prior to building solved the issue. Thanks for the input!

  3. Log in to comment