Hi,
I have an application (TORQUE resource manager) which provides a TCL interface to its C library and provides the ability to program its behaviour using TCL. Basically it has a C program (pbs_sched) which calls Tcl_CreateInterp() and other Tcl library calls, and then runs a TCL script which I can write to control its behaviour.
I would like to include XOTcl functionality to my control script, but naively using "package require XOTcl" doesn't seem to work. I get "TCL error @ line 3: can't find package XOTcl". Which I guess indicates you can't do that from a standard TCL script.
So, is there a simple way to drop the XOTcl interpretor in place of the normal Tcl interpretor? Or just to add XOTcl functionality?
Thanks,
Kevin
On 11/08/2010 10:51 AM, Kevin Van Workum wrote:
I have an application (TORQUE resource manager) which provides a TCL interface to its C library and provides the ability to program its behaviour using TCL. Basically it has a C program (pbs_sched) which calls Tcl_CreateInterp() and other Tcl library calls, and then runs a TCL script which I can write to control its behaviour.
I would like to include XOTcl functionality to my control script, but naively using "package require XOTcl" doesn't seem to work. I get "TCL error @ line 3: can't find package XOTcl". Which I guess indicates you can't do that from a standard TCL script.
So, is there a simple way to drop the XOTcl interpretor in place of the normal Tcl interpretor? Or just to add XOTcl functionality?
It sounds like you are trying to use libtcl.so (or equivalient) in your setup. It is possible to make use of extensions if you initialize everything correctly. It is also possible to build special-purpose DLLs that can actually include other extensions added, called stardlls. See http://wiki.tcl.tk/15969 for more. This enhanced setup provides a lot of flexibility for embedders.
Jeff
On Wed, Aug 11, 2010 at 3:11 PM, Jeff Hobbs jeffh@activestate.com wrote:
On 11/08/2010 10:51 AM, Kevin Van Workum wrote:
I have an application (TORQUE resource manager) which provides a TCL interface to its C library and provides the ability to program its behaviour using TCL. Basically it has a C program (pbs_sched) which calls Tcl_CreateInterp() and other Tcl library calls, and then runs a TCL script which I can write to control its behaviour.
I would like to include XOTcl functionality to my control script, but naively using "package require XOTcl" doesn't seem to work. I get "TCL error @ line 3: can't find package XOTcl". Which I guess indicates you can't do that from a standard TCL script.
So, is there a simple way to drop the XOTcl interpretor in place of the normal Tcl interpretor? Or just to add XOTcl functionality?
It sounds like you are trying to use libtcl.so (or equivalient) in your setup. It is possible to make use of extensions if you initialize everything correctly. It is also possible to build special-purpose DLLs that can actually include other extensions added, called stardlls. See http://wiki.tcl.tk/15969 for more. This enhanced setup provides a lot of flexibility for embedders.
Jeff
Replacing "Tcl_Init()" with "Xotcl_Init()" in my C code, and then linking to libxotcl1.6.6.so seems to have worked. Pretty simple.
On 11.08.10 19:51, Kevin Van Workum wrote:
I would like to include XOTcl functionality to my control script, but naively using "package require XOTcl" doesn't seem to work.
"package require XOTcl" is supposed to work. In xotcl 1.6.6, i count 128 occurrences of "package require XOTcl".
If Tcl does not find the package, it might be the case that you installed it to some directory not on your auto_path or (TCLLIBPATH, etc.), or that you are using a Tcl distribution, not including it. After the install you should have e.g.
/usr/local/lib/xotcl1.6.6/pkgIndex.tcl /usr/local/lib/xotcl1.6.6/libxotcl1.6.6.so /usr/local/lib/xotcl1.6.6/libxotclstub1.6.6.a
You can certainly initialize via C as well (using Xotcl_Init()), but i would recommend the "package require" way.
best regards -gustaf neumann
On Thu, Aug 12, 2010 at 9:20 AM, Gustaf Neumann neumann@wu-wien.ac.atwrote:
On 11.08.10 19:51, Kevin Van Workum wrote:
I would like to include XOTcl functionality to my control script, but naively using "package require XOTcl" doesn't seem to work.
"package require XOTcl" is supposed to work. In xotcl 1.6.6, i count 128 occurrences of "package require XOTcl".
If Tcl does not find the package, it might be the case that you installed it to some directory not on your auto_path or (TCLLIBPATH, etc.), or that you are using a Tcl distribution, not including it.
That's was I initially thought. so I simply set TCLLIBPATH which didnt' work. I recently discovered that for security reasons, the invoking env is not being passed through to the interpreter's env. I didn't think to manually set auto_path in my script, but now that's what I'm doing and it works.
Thanks.
After the install you should have e.g.
/usr/local/lib/xotcl1.6.6/pkgIndex.tcl /usr/local/lib/xotcl1.6.6/libxotcl1.6.6.so /usr/local/lib/xotcl1.6.6/libxotclstub1.6.6.a
You can certainly initialize via C as well (using Xotcl_Init()), but i would recommend the "package require" way.
best regards -gustaf neumann
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl