tcl error "can't find package struct::tree " - tcl

I tried to use the tree package for TCL but I'm unable to find any documentation at all. When trying to run the examples from http://tcllib.sourceforge.net/doc/struct_tree.html, i get the error
can't find package struct::tree
Can anyone tell me how to include it in tcl 8.5?

The struct::tree package is part of Tcllib.
If you are using ActiveTcl, doing a teacup update (possibly with elevated permissions, depending on how you installed) will download a copy. I don't know whether all Linuxes have Tcllib done as an appropriate system package, but Debian does. Otherwise, there's a download link in on the main Tcllib page; Tcllib works just fine as a bunch of .tcl files that you include with your application code.

Related

TCL_LIB_SPEC missing in modules install

I'm trying to install modules from SourceForge and I'm getting an error that a variable named TCL_LIB_SPEC is not set. What is this supposed to be set to?
The answer here is to install the TCL development package
% yum install tcl-devel
This gives you a tclConfig.sh file at /usr/lib64/tcl8.5
So
% cd /usr/lib64/tcl8.5
% . ./tclConfig.sh
Then configure works.
It's supposed to be set to the instructions to use with your compiler for linking against the Tcl C library, and it should (conventionally) be generated by running the relevant configure script inside a Tcl source distribution. Or a distribution of Tcl (e.g., on Linux perhaps called tcl-dev) may have alternate correct values already set up.

Octave: Loaded package is not recognized

I have installed package image via pkg install -forge image and after tons of warnings (I am using clang as a C compiler, yeah, I know...) it finished installing.
I then loaded the package with ordinary pkg load image and Octave did not complain. But when I typed help viscircles to get some help on the function, Octave behaved like there was no package image, meaning it returned
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge but has not yet been implemented.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
Now I executed the pkg list to see if the package was indeed installed and loaded and yes, it was (there was an asterisk next to image package, which indicates that the certain package is loaded).
I decided to unload all packages and so I did. Now, before loading image again, I executed help viscircles again, but this time I got the next error:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge which you have installed but not loaded. To load the
package, run 'pkg load image' from the Octave prompt.
Interesting... I loaded the package again and same problem as before. I also downloaded the package manually and reinstalled it, same problems.
And yes, I have Octave 4.0.2, the requirements for image 2.6.2 is version 4.0.0+.
The function viscircles is on development versions of the image package only. It is not part of the current release, version 2.6.2 which you have installed.
The error message:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge which you have installed but not loaded. To load the
package, run 'pkg load image' from the Octave prompt.
means that the function is not part of Octave and if it is to exist at all, it will be on the image package. It doesn't mean that the image package will actually have it, only that it belongs to it. The error message you get after loading the package:
>> help viscircles
error: help: the 'viscircles' function belongs to the image package
from Octave Forge but has not yet been implemented.
Please read <http://www.octave.org/missing.html> to learn how you can
contribute missing functionality.
tells you the issue. The function viscircles is not implemented on that version of the package.
You can get it from the mercurial repository of the image package though at 75df28049249. Not sure if it will work on Octave 4.0 though.

failed to include tcl package during generating executable with tclkit

I am trying to generate a standalone executable from a single tcl file. I am using the method using tclkit.exe mentioned in http://wiki.tcl.tk/11861.
The problem is the tcl file uses 3 packages.
package require Tk
package require tcom
package require Img
I was not able to successfully add the packages in lib folder of the generated vfs folder. Whenever I click the exe it says, failed to load tcom.dll.
Btw, there are lot of different version of activestate tcl and tclkit.exe based on x86 and x64 system. I am doing the whole thing in a 64 bit win7 system. What am I doing wrong? please help.

signal functions does not recognized by octave 3.6.1

I have installed Octave 3.6.1 along with packages including "signal 1.1.2" but when i run a simple example of "sigmoid_train" function an error appears "sigmoid_train function is undefined".
Can any body tell me what is the problem?
The problem is that you didn't load the signal package. When you type pkg list you can find which ones are loaded by an asterisk in front of their names. Load a package with pkg load signal.
Having to load a packages is that thing that many users coming from Matlab find strange but if you compare with other languages, such as Python, Perl, or C++, would you expect them to import, use, or #include every libraries available in the system by default? See Octave's FAQ for more details.
If you want a package to be loaded automatically by default, the recommended action is to add the line pkg load signal to your ~/.octaverc file.
Finally, you have just started with Octave, you should had installed Octave 3.8.1.

nuget package restore with MonoDevelop

I have a solution that is primarily developed in Visual Studio 2012. I would like to develop in MonoDevelop without major incompatibilities.
Thus far, I have installed mrward's nuget addin for MonoDevelop and things work if I manually add each package in packages.config through that interface. However, this is highly onerous. This addin doesn't have support for automated package restore as of this writing.
I downloaded nuget.exe from CodePlex ("NuGet command line utility", as it's labeled). I use a simple find/xargs combination to install all required packages:
find . -name packages.config | xargs -I '{}' mono nuget.exe install '{}'
This creates several dozen directories in the directory from which it is run instead of putting things under packages/ as expected, and it also doesn't touch the project files so MonoDevelop still thinks that it should be looking for package references in the directory from which MonoDevelop was started.
I therefore opened MonoDevelop from the working directory that contains all of these package folders, and I still get invalid references. I think this is probably because the project is looking for package_name/ reference, but the folders are name package_name.version/ in the working directory.
Any suggestions for a sane, simple way to interact with this solution? I'm next going to try modifying my shell command so that it automatically drops to project/packages and runs nuget from that directory.
Did you try using the -o command line parameter with NuGet.exe? You can use that to get the packages to install into a particular packages folder.
The NuGet addin for MonoDevelop supports package restore from version 0.6 or above. Right click your project and select Restore Packages. This will download all the packages defined in your packages.config for all projects in the solution. It uses NuGet.exe to do this.
Another way to get this working is to use the custom NuGet MSBuild target so the package restore happens at build time when using xbuild. It would require some manual editing of project files though. Under the covers the custom MSBuild target just uses NuGet.exe with a similar command line to what you have already just with the output directory option specified. So I would try the command line approach since that will be less work.
You would have to get the following files from the NuGet repository on codeplex:
NuGet.exe
NuGet.targets
NuGet.config
Put these in a directory somewhere. Typically these are put in a .nuget directory in the same directory as your solution file. Then you need to edit your project files to include the NuGet.targets file and also define the SolutionDir property. So something like this:
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
You will also need to enable package restore on your machine. You can do this using the NuGet addin for MonoDevelop in the Options dialog. Under Linux this is available from the Edit menu under Preferences. Then look in the NuGet - General options and there is a checkbox for enabling package restore.
There is an example project on GitHub created by Jonathan Channon which uses package restore and works when building with xbuild inside MonoDevelop. There is also an issue on GitHub about using NuGet restore on Linux which might be helpful.
Update: 2014-05-14: NuGet addin for MonoDevelop now supports package restore.