Re: [Plplot-devel] -dev tk has an embedded blank issue

2010-02-05 Thread Andrew Ross

Arjen,

If you could supply a test case then I'd be happy to try it out on Linux.
I think your experience generally with tcl / tk is much greater than mine.

Thanks

Andrew

On Fri, Feb 05, 2010 at 09:32:25AM +0100, Arjen Markus wrote:
 Hi Andrew,
 
 I see from the comments that the tk device is relying on the autoload
 mechanism. I have not got a Linux system at hand at the moment, so I
 can not easily test the tk device. I imagine though that autoloading
 does not deal gracefully with spaces in directory names. That is
 something I can experiment with.
 
 Regards,
 
 Arjen
 
 On 2010-02-04 21:23, Andrew Ross wrote:
  Hi Alan,
  
  I've taken a quick look at this and, like you, can't see an immediate cause.
  My experience with debugging the tk bindings is only slightly more than 
  yours. I'll keep looking.
  
  Andrew
  
  On Fri, Jan 29, 2010 at 10:32:29PM -0800, Alan Irwin wrote:
  Hi Andrew:
 
  I am getting this strange embedded blank result with -dev tk.
 
  softw...@raven c/x01c -dev tk
  PLplot library version: 5.9.5
  TCL command plclient_init failed:
   invalid command name plclient_init
  TCL command plclient_link_end failed:
   invalid command name plclient_link_end
  Program aborted
  softw...@raven c/x01c -dev tk
  PLplot library version: 5.9.5
  TCL command plclient_init failed:
invalid command name plclient_init
  TCL command plclient_link_end failed:
invalid command name plclient_link_end
 
  The problem disappears if the build, source, and install trees do not have
  embedded blanks in their top-level directory names.  I arranged that with a
  symlink of plplot svn to plplot_svn for one prefix component of the 
  build,
  source, and install trees.
 
  For the plplot svn case, I did fix up pkgIndex.tcl.in components in
  revision 10782 so that all directory names were quoted, but it made no
  difference, and furthermore when I changed the resulting
  bindings/pkgIndex.tcl file to replace plplot svn with plplot_svn it made
  no difference.
 
  So this embedded blank issue appears to be more fundamental than can be
  accounted for by simple *.tcl changes.
 
  Would you be willing to take a look?
 
  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
  __
 
  --
  The Planet: dedicated and managed hosting, cloud storage, colocation
  Stay online with enterprise data centers and the best network in the 
  business
  Choose flexible plans and management services without long-term contracts
  Personal 24x7 support from experience hosting pros just a phone call away.
  http://p.sf.net/sfu/theplanet-com
  ___
  Plplot-devel mailing list
  Plplot-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/plplot-devel
 
  
  --
  The Planet: dedicated and managed hosting, cloud storage, colocation
  Stay online with enterprise data centers and the best network in the 
  business
  Choose flexible plans and management services without long-term contracts
  Personal 24x7 support from experience hosting pros just a phone call away.
  http://p.sf.net/sfu/theplanet-com
  ___
  Plplot-devel mailing list
  Plplot-devel@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/plplot-devel
  
 
 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel
 

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com

Re: [Plplot-devel] -dev tk has an embedded blank issue

2010-02-05 Thread Arjen Markus
Hi Andrew,

will do. Could you send me the Tcl/Tk files as found in the
installation (probably best to it off list, so as not to muddy
the information flow)? I would like to see what the substituted
directory names look like.

Regards,

Arjen

On 2010-02-05 09:39, Andrew Ross wrote:
 Arjen,
 
 If you could supply a test case then I'd be happy to try it out on Linux.
 I think your experience generally with tcl / tk is much greater than mine.
 
 Thanks
 
 Andrew
 
 On Fri, Feb 05, 2010 at 09:32:25AM +0100, Arjen Markus wrote:
 Hi Andrew,

 I see from the comments that the tk device is relying on the autoload
 mechanism. I have not got a Linux system at hand at the moment, so I
 can not easily test the tk device. I imagine though that autoloading
 does not deal gracefully with spaces in directory names. That is
 something I can experiment with.

 Regards,

 Arjen

 On 2010-02-04 21:23, Andrew Ross wrote:
 Hi Alan,

 I've taken a quick look at this and, like you, can't see an immediate cause.
 My experience with debugging the tk bindings is only slightly more than 
 yours. I'll keep looking.

 Andrew

 On Fri, Jan 29, 2010 at 10:32:29PM -0800, Alan Irwin wrote:
 Hi Andrew:

 I am getting this strange embedded blank result with -dev tk.

 softw...@raven c/x01c -dev tk
 PLplot library version: 5.9.5
 TCL command plclient_init failed:
  invalid command name plclient_init
 TCL command plclient_link_end failed:
  invalid command name plclient_link_end
 Program aborted
 softw...@raven c/x01c -dev tk
 PLplot library version: 5.9.5
 TCL command plclient_init failed:
   invalid command name plclient_init
 TCL command plclient_link_end failed:
   invalid command name plclient_link_end

 The problem disappears if the build, source, and install trees do not have
 embedded blanks in their top-level directory names.  I arranged that with a
 symlink of plplot svn to plplot_svn for one prefix component of the 
 build,
 source, and install trees.

 For the plplot svn case, I did fix up pkgIndex.tcl.in components in
 revision 10782 so that all directory names were quoted, but it made no
 difference, and furthermore when I changed the resulting
 bindings/pkgIndex.tcl file to replace plplot svn with plplot_svn it made
 no difference.

 So this embedded blank issue appears to be more fundamental than can be
 accounted for by simple *.tcl changes.

 Would you be willing to take a look?

 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
 __

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the 
 business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the 
 business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Plplot-devel mailing list
 Plplot-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/plplot-devel

 
 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the 

[Plplot-devel] [PATCH] Move plgdev call to after plinit in example 14

2010-02-05 Thread David MacMahon
Changes examples/*/x14*.* to call plgdev and print the driver name after
calling plinit.  Calling plgdev after plparseopts but before plinit will
only get a device name if one is specified on the command line via the
-dev option.  If the device is not specified via -dev, calling plgdev
before plinit will get an empty string.  To ensure that plgdev gets a
device name regardless of how it is specified, it must be called after
plinit (specifically, after pllib_devinit, which is called by plinit).
Without this change, running example 14 with no device specified on the
command line would result in the following message...

Demo of multiple output streams via the  driver.

Note the double space between the and driver where the driver name
belongs.

Also removes previously superfluous, now invalid call to plsdev before
plinit.

Tested C++, C, F77, and F95 versions.  Not sure if other languages are
modified correctly.
---
 examples/c++/x14.cc|   17 -
 examples/c/x14c.c  |   17 -
 examples/d/x14d.d  |   21 ++---
 examples/f77/x14f.fm4  |   25 -
 examples/f95/x14f.f90  |   25 -
 examples/java/x14.java |   19 +--
 examples/lua/x14.lua   |   13 ++---
 examples/ocaml/x14.ml  |   15 +++
 examples/octave/x14c.m |   25 -
 examples/perl/x14.pl   |   15 +++
 examples/tcl/x14.tcl   |   13 ++---
 11 files changed, 97 insertions(+), 108 deletions(-)

diff --git a/examples/c++/x14.cc b/examples/c++/x14.cc
index 80569ad..54759c8 100644
--- a/examples/c++/x14.cc
+++ b/examples/c++/x14.cc
@@ -92,7 +92,7 @@ x14::x14( int argc, const char ** argv )
 // Using DP results in a crash at the end due to some odd cleanup problems
 // The geometry strings MUST be in writable memory
 
-char   driver[80];
+char   driver[80] = ;
 
 PLINT  fam, num, bmax;
 
@@ -110,13 +110,6 @@ x14::x14( int argc, const char ** argv )
 // Parse and process command line arguments.
 pls1-parseopts( argc, argv, PL_PARSE_FULL );
 
-pls1-gdev( driver );
-pls1-gfam( fam, num, bmax );
-
-cout  Demo of multiple output streams via the  
-driver   driver.  endl;
-cout  Running with the second stream as slave to the first.\n  endl;
-
 //If valid geometry specified on command line, use it for both streams.
 pls1-gpage( xp0, yp0, xleng0, yleng0, xoff0, yoff0 );
 valid_geometry = ( xleng0  0  yleng0  0 );
@@ -128,12 +121,18 @@ x14::x14( int argc, const char ** argv )
 else
 pls1-setopt( geometry, geometry_master );
 
-pls1-sdev( driver );
 pls1-ssub( 2, 2 );
 
 // Initialize PLplot.
 pls1-init();
 
+pls1-gdev( driver );
+pls1-gfam( fam, num, bmax );
+
+cout  Demo of multiple output streams via the  
+driver   driver.  endl;
+cout  Running with the second stream as slave to the first.\n  endl;
+
 pls2 = new plstream();
 
 if ( valid_geometry )
diff --git a/examples/c/x14c.c b/examples/c/x14c.c
index 22e38ba..ace4aa4 100644
--- a/examples/c/x14c.c
+++ b/examples/c/x14c.c
@@ -58,7 +58,7 @@ main( int argc, const char *argv[] )
 char  geometry_master[] = 500x410+100+200;
 char  geometry_slave[]  = 500x410+650+200;
 
-char  driver[80];
+char  driver[80] = ;
 
 PLINT fam, num, bmax;
 PLFLT xp0, yp0;
@@ -70,13 +70,6 @@ main( int argc, const char *argv[] )
 
 (void) plparseopts( argc, argv, PL_PARSE_FULL );
 
-plgdev( driver );
-plgfam( fam, num, bmax );
-
-printf( Demo of multiple output streams via the %s driver.\n, driver );
-printf( Running with the second stream as slave to the first.\n );
-printf( \n );
-
 /* If valid geometry specified on command line, use it for both streams. */
 plgpage( xp0, yp0, xleng0, yleng0, xoff0, yoff0 );
 valid_geometry = ( xleng0  0  yleng0  0 );
@@ -88,10 +81,16 @@ main( int argc, const char *argv[] )
 else
 plsetopt( geometry, geometry_master );
 
-plsdev( driver );
 plssub( 2, 2 );
 plinit();
 
+plgdev( driver );
+plgfam( fam, num, bmax );
+
+printf( Demo of multiple output streams via the %s driver.\n, driver );
+printf( Running with the second stream as slave to the first.\n );
+printf( \n );
+
 /* Start next stream */
 
 plsstrm( 1 );
diff --git a/examples/d/x14d.d b/examples/d/x14d.d
index 41fe5bb..0782f90 100644
--- a/examples/d/x14d.d
+++ b/examples/d/x14d.d
@@ -51,15 +51,6 @@ int main( char[][] args )
 /* Parse and process command line arguments */
 plparseopts( args, PL_PARSE_FULL );
 
-string driver;
-plgdev( driver );
-
-PLINT fam, num, bmax;
-plgfam( fam, num, bmax );
-
-writefln( Demo of multiple output streams via the %s driver., driver );
-writefln( Running with the second stream as slave to the first.\n );
-
 /* If valid geometry specified on command line, use it for both