From: Alan W. I. <ir...@be...> - 2004-11-09 21:07:05
|
On 2004-11-09 18:14-0000 Andrew Ross wrote: > On Thu, Nov 04, 2004 at 05:18:19PM -0800, Alan Irwin wrote: >> Warning: it appears swig 1.3.22 is backwards incompatible with previous >> versions of swig and also our current cvs version of PLplot. 1.3.22 has >> been out now since 2004-09-03 and has propagated, for example to Debian >> testing. The symptom you will see if you attempt to build PLplot from raw >> cvs with this latest swig version is the plplotcmodule_double.c source file >> will have lots of compilation errors. (My compilations never reached to the >> java stage so I don't know whether there would be additional errors in that >> case as well for swig-1.3.22.) >> > > I've looked into this a little bit more. Firstly the good news - java > seems to be unaffected and works fine with swig-1.3.22. > > There are two sources of errors in the python bindings. One is code like > > static PyObject *_wrap_pltr0(PyObject *, PyObject *args) { > ... > } > > Omitting the function parameter name for an unused argument is legal in > C++ but not so far as I know in C. This appears to be because we are > using the -c++ option to swig, but are not compiling the resulting > wrapper with a c++ compiler. Removing -c++ seems to fix the problem. Thanks, Andrew for looking into this. I copied that -c++ option from Gary Bishop's work and didn't think too much about it since it worked, but since it now seems to make a (bad) difference, I am glad you have removed it. > > The other error is in the SwigMethod array. This is modified by > makedocstrings.py to create plplotcmodule_double.c from > plplotcmodule_p_double.c. This fixes the documentation handling which is > broken in swig. Looks like the handling of this section has > changed. Swig now adds the NULL parameter in for the document string. > makedocstrings.py just tacks our documentation string onto the end of > this array rather than replacing the NULL with our string. I'm not a > python expert, however I think I have successfully hacked the > makedocstrings.py script to work with swig 1.3.21 and 1.3.22. It > compiles ok for me with both and the examples seem to work. Perhaps > someone else has a more elegant solution. I am not much of a python expert (although I would like to be!), but your cvs change seems okay to me by visual inspection. I haven't had a chance to try your changes, but I assume they will work fine for me since we both have Debian testing systems. So, thanks very much for your efforts! > > I noticed in testing that "make check" still doesn't work for python in > a separate build tree. I believe the solution is to conditionally (when we have a separate build tree) make at build time the required symlinks from the build tree back to the source tree. One possibility for implementing this is to adapt what was done in the examples/tk/Makefile.am file which generates required symlinks to the tcl examples. However, it is possible there may be a more elegant way to make symlinks at build time. Rafael, could you please comment on the current examples/tk/Makefile.am symlink solution? Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |