On 2010-12-23 12:09-0800 Alan W. Irwin wrote: > Hi Andrew: > > Actually, numerical arrays, matrices, and other special constructs > need typemaps, but input PLINT, PLFLT, and strings apparently do not. > Therefore, I am going to spend a few hours on this project immediately > with a no-typemaps plplot_octave.i, and the necessary CMake support > (including an option for choosing the swig-based Octave bindings which > simultanously limits the examples tested) to see how far I can get (on > Linux but also on wine if Linux works) with examples such as example > 10 that do not use arrays.
I have gotten a lot farther with this. For example, with a few changes I got the gcd example at http://www.swig.org/Doc1.3/Octave.html#Octave_nn3 to work perfectly which verified for me that swig generates good octave interfaces. I then had similar success with plplot_octave (see below). But now I need some simple octave help to achieve my goal of getting octave example 10 to work on Linux (and wine???) with the swig-generated approach. The current issue is I am making some stupid mistake in how I wrap functions in octave. Can somebody quickly give me a few minutes of octave advice about that issue? With the swig-based approach, I have gotten to the point where I can load the plplot_octave dll from within octave, and successfully initiate PLplot using the following two commands. plplot_octave plplot_octave.plinit() Which agains verifies the swig-generated approach is working (at least on Linux). However, all our octave examples currently drop the plplot_octave namespace so I would like to do that as well (at least as a temporary measure). So instead of the above I am trying to get plplot_octave plplot_stub_hand_crafted plinit() to work where plplot_stub_hand_crafted.m (revision 11388) attempts to drop the plplot_octave namespace using wrappers of the following form: function plinit() plplot_octave.plinit(); endfunction But that doesn't work. I get the following error message: error: can't perform indexing operations for <unknown type> type error: called from: error: plinit at line 189, column 3 (Line 189 of plplot_stub_hand_crafted.m corresponds to " plplot_octave.plinit();" This is how the matrap-generated plplot_stub.m does this instead: function plinit() % plinit() % % Original PLplot call documentation: % % % plinit: Initialize PLplot % % DESCRIPTION: % % This function is used in all of the examples. % % SYNOPSIS: % % plinit() plplot_octave(59); endfunction The 59 means plinit is the 59th PLplot function to be wrapped by matwrap. This way of doing things is a peculiarity of how matwrap interfaces functions (and an indication of the fragile manner that interfacing is done by matwrap). Since plplot_octave.plinit() works when I execute that command by hand for the swig-generated interface, I thought to copy from the matwrap version of plplot_stub.m to the hand-crafted version using plplot_octave.plinit(); while dropping all the % stuff which appears just to be comments. What am I missing? BTW, here is the Linux cookbook of how I am doing my testing of the swig-generated approach. run cmake in an initially empty build tree as normal except you also specify the -DENABLE_swig_octave=ON option. # Build the octave interface to PLplot. make plplot_octave # Change to the correct directory (in anticipation of running x10c.m eventually like plplot_test/test_octave.sh does) and make dependencies of # plplot_octave accessible. cd examples TOPDIR=pwd/.. export LD_LIBRARY_PATH="$TOPDIR"/src:"$TOPDIR"/lib/csa:"$TOPDIR"/lib/nn octave -f -q -p \ /home/software/plplot_svn/HEAD/build_dir/examples/../bindings/octave:/home/software/plplot_svn/HEAD/plplot_cmake_qt/examples/../bindings/octave/PLplot:/home/software/plplot_svn/HEAD/plplot_cmake_qt/examples/../bindings/octave/PLplot/support:/home/software/plplot_svn/HEAD/plplot_cmake_qt/examples/../bindings/octave/misc:/home/software/plplot_svn/HEAD/plplot_cmake_qt/examples:/home/software/plplot_svn/HEAD/plplot_cmake_qt/examples/../bindings/octave I am a bit frustrated at the moment that the wrapping in plplot_stub_hand_crafted.m isn't working quite correctly to drop the plplot_octave namespace because once that namespace dropping works, then all indications are that at least example 10 should just work with the swig-generated approach on Linux (and wine???). Anyhow, quick octave help from anybody with octave experience that is paying attention to this list during these Christmas holidays would be much appreciated. Happy Boxing Day to all. Alan __________________________ Alan W. Irwin 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 libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel