|
From: Vince D. <vi...@sa...> - 2002-07-03 15:19:31
|
Ok, I think I see the problem. It isn't anything to do with the 'libDir'
changes, but rather to calling tcl_findLibrary twice.
Use this:
if (Tcl_Eval(interp, initScript) != TCL_OK) {
#ifdef PLPLOT_EXTENDED_SEARCH
+ Tcl_UnsetVar(interp, "pllibrary", TCL_GLOBAL_ONLY);
if (Tcl_Eval(interp, initScriptExtended) != TCL_OK) {
(i.e. add the line with '+'), and all should work, I think... I only
rarely have access to a linux box (except perhaps through the sourceforge
compile farm), so it isn't that easy for me to test these things.
cheers,
-- Vince
<http://www.santafe.edu/~vince>
On Wed, 3 Jul 2002, Alan W. Irwin wrote:
> Vince,
>
> Sorry for another negative message, but it is part of my job to test your
> changes to make sure all the details are right so that we present a polished
> product for our next release. I am certainly willing to continue the Linux
> testing of your changes, but you might be able to eliminate a lot of these
> little problems (and achieve a lot better turnaround than when two of us are
> involved) if you tested your changes on a Linux box (which I understand you
> have access to) before committing them.
>
> With your latest change I am still getting exactly the same error message
> for the installed version:
>
> application-specific initialization failed: Can't find a usable plplot.tcl
> in the following directories:
> /usr/plplot5.1/library
>
> As I have said before, I believe the problem is one of your libDir changes
> below (perhaps even initializing it to NULL?) is severely limiting the
> directories that are being searched. For your latest change, I noticed you
> switched to the "5.1.0/tcl" style which worked for me in the past, but the
> point is no amount of fiddling with initScript or initScriptExtended is
> going to work if your libDir changes makes sure those lines are completely
> ignored. The error message above shows only one directory is being
> searched. That never happened to me before your libDir changes. So I
> suspect if you look carefully at everything you did with libDir, you will
> find the reason why the directory search is now so limited.
>
> I am going to quote my previous post on this (especially the diff) to help
> you get to the bottom of this.
>
> Alan
>
> On Tue, 2 Jul 2002, Alan W. Irwin wrote:
>
> > I didn't do anything particularly sophisticated. 3 versions ago (i.e., for
> > version 1.32), this worked
> > fine for install (but not for built version in plplot/tmp).
> >
> > static char initScript[] =
> > "tcl_findLibrary plplot 5.1.0/tcl \"\" plplot.tcl PL_LIBRARY pllibrary";
> >
> > i.e., I just replaced 5.1 by 5.1.0/tcl for just this line in 1.32. So I was
> > essentially just doing what you are now doing with initScriptExtended, and I
> > therefore think your current approach should work fine except for some
> > additional changes you made to libDir. Here is the diff I am talking about
> > between version 1.32 and version 1.35. I may have it wrong, but I think I
> > understand the initScriptExtended stuff so by elimination I think it is the
> > changed libDir stuff that is causing the trouble.
> >
> > Alan
> >
> > *******************
> > Index: tclAPI.c
> > ===================================================================
> > RCS file: /cvsroot/plplot/plplot/bindings/tcl/tclAPI.c,v
> > retrieving revision 1.32
> > retrieving revision 1.35
> > diff -u -3 -p -r1.32 -r1.35
> > --- tclAPI.c 2 Jul 2002 11:30:36 -0000 1.32
> > +++ tclAPI.c 2 Jul 2002 16:44:25 -0000 1.35
> > @@ -1,4 +1,4 @@
> > -/* $Id: tclAPI.c,v 1.32 2002/07/02 11:30:36 vincentdarley Exp $
> > +/* $Id: tclAPI.c,v 1.35 2002/07/02 16:44:25 vincentdarley Exp $
> >
> > Copyright 1994, 1995
> > Maurice LeBrun mj...@di...
> > @@ -313,6 +313,15 @@ loopbackCmd(ClientData clientData, Tcl_I
> > static char defaultLibraryDir[200] = PL_LIBRARY;
> > extern char* plplotLibDir;
> >
> > +#if (!defined(MAC_TCL) && !defined(__WIN32__))
> > +/*
> > + * Use an extended search for installations on Unix where we
> > + * have very likely installed plplot so that plplot.tcl is
> > + * in /usr/local/plplot/lib/plplot5.1.0/tcl
> > + */
> > +#define PLPLOT_EXTENDED_SEARCH
> > +#endif
> > +
> > /*
> > * PlbasicInit
> > *
> > @@ -326,7 +335,11 @@ PlbasicInit( Tcl_Interp *interp )
> > {
> > static char initScript[] =
> > "tcl_findLibrary plplot 5.1 \"\" plplot.tcl PL_LIBRARY pllibrary";
> > - char *libDir;
> > +#ifdef PLPLOT_EXTENDED_SEARCH
> > + static char initScriptExtended[] =
> > + "tcl_findLibrary plplot 5.1.0 \"\" tcl/plplot.tcl PL_LIBRARY pllibrary";
> > +#endif
> > + char *libDir = NULL;
> > #ifdef USE_TCL_STUBS
> > /*
> > * We hard-wire 8.1 here, rather than TCL_VERSION, TK_VERSION because
> > @@ -359,16 +372,48 @@ PlbasicInit( Tcl_Interp *interp )
> > #endif
> >
> > Tcl_SetVar(interp, "plversion", "5.1", TCL_GLOBAL_ONLY);
> > - if(Tcl_Eval(interp, initScript))
> > + if (Tcl_Eval(interp, initScript) != TCL_OK) {
> > +#ifdef PLPLOT_EXTENDED_SEARCH
> > + if (Tcl_Eval(interp, initScriptExtended) != TCL_OK) {
> > + /* Last chance, look in '.' */
> > + Tcl_DString ds;
> > + if (Tcl_Access("plplot.tcl", 0) != 0) {
> > + return TCL_ERROR;
> > + }
> > + if (Tcl_EvalFile(interp, "plplot.tcl") != TCL_OK) {
> > + return TCL_ERROR;
> > + }
> > + /* It is in the current directory */
> > + libDir = Tcl_GetCwd(interp, &ds);
> > + if (libDir == NULL) {
> > + return TCL_ERROR;
> > + }
> > + libDir = strdup(libDir);
> > + Tcl_DStringFree(&ds);
> > + }
> > + /*
> > + * Clear the result so the user isn't confused by an error
> > + * message from the previous failed search
> > + */
> > + Tcl_ResetResult(interp);
> > +#else
> > return TCL_ERROR;
> > +#endif
> > + }
> >
> > - libDir = Tcl_GetVar(interp, "pllibrary", TCL_GLOBAL_ONLY);
> > if (libDir == NULL) {
> > - Tcl_SetVar(interp, "pllibrary", defaultLibraryDir, TCL_GLOBAL_ONLY);
> > + libDir = Tcl_GetVar(interp, "pllibrary", TCL_GLOBAL_ONLY);
> > + if (libDir == NULL) {
> > + /* I don't believe this path can ever be reached now */
> > + Tcl_SetVar(interp, "pllibrary", defaultLibraryDir, TCL_GLOBAL_ONLY);
> > + libDir = defaultLibraryDir;
> > + }
> > } else {
> > - /* Used by init code in plctrl.c */
> > - plplotLibDir = strdup(libDir);
> > + Tcl_SetVar(interp, "pllibrary", libDir, TCL_GLOBAL_ONLY);
> > }
> > +
> > + /* Used by init code in plctrl.c */
> > + plplotLibDir = strdup(libDir);
> >
> > #ifdef TCL_DIR
> > if (libDir == NULL) {
> > *******************
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Plplot-devel mailing list
> > Plp...@li...
> > https://lists.sourceforge.net/lists/listinfo/plplot-devel
> >
>
>
|