Warning: this page is now obsolete for the Windows platform
Starting at svn trunk from 29/05/08 on, Scilab has to be linked with Tcl/Tk 8.5 on Windows. Therefore the tricks below no longer apply.
However, linking the latest Scilab to Tcl/Tk 8.6, i.e. the bleeding edge of the Tcl/Tk development is easy: just follow the same instructions replacing 84->85->86 and 8.4->8.5->8.6.
I have managed to link Scilab with 8.6 and it worked nicely (but I had to change a bit the source code of Scilab). I'll update this page some day when I'll feel less lazy...
On Linux this page is perhaps still useful (see at the bottom of this page).
Linking Scilab SVN (Scilab 5.x) to Tcl/Tk 8.5
Why would I want to link Scilab with Tcl/Tk 8.5?
- To be able to use advanced features of Tcl/Tk, such as peer text widgets in Scipad. This is available in Scipad since version 6.72, and allows to display a file in more than one Scipad window. Really handy and a must, but this cannot be done easily with Tcl/Tk 8.4.
- To benefit from some bug fixes or improvements in Tcl/Tk that are not available in the version shipped with Scilab (currently 8.4.14).
- When searching/replacing in the selection, search matches do not extend outside of the selected text (uses the -strictlimits option for text search)
- Native stretching of the panes in tile mode (uses the -stretch option for panedwindows)
- Better time stamping in the Scipad debug procs (uses clock milliseconds)
- Tk bug 1169429 (relative to cursor blinking) is fixed in 8.5, therefore the workaround hack used in 8.4 is no longer used
- Watch window more likely to stay on top when requested (uses the -topmost option for toplevels) - Linux only, Windows is already OK in 8.4
- string reverse (TIP #272) is used during undo/redo, improving performance drastically
- The replace cursor is a nice looking block cursor
- Scilab 5.x will use Tcl/Tk 8.5 by default when Tcl/Tk 8.5 will be released (this is the case now...)
Cooking recipe Scilab SVN <-> Tcl/Tk 8.5 -- Windows platform, using Visual C++ Express Edition
- This is for Windows only, for Linux see far below.
- I only checked compilation using Visual Studio C++ Express Edition 2008
- This works today (re-checked 28/05/08) with the SVN version of Scilab and Tcl/Tk 8.5.3b1 from cvs core-8-5-branch. Since these are constantly changing versions, no guarantee is granted for the future.
- Compile this source code the following way:
set MYTCL="MYROOT\tcl-cvs" set MYTK="MYROOT\tk-cvs" set MYTCLTK="MYROOT\tcltk-cvs" CALL "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" cd %MYTCL%\win nmake -f makefile.vc MACHINE=IX86 release nmake -f makefile.vc install MACHINE=IX86 INSTALLDIR=%MYTCLTK% cd %MYTK%\win nmake -f makefile.vc MACHINE=IX86 release TCLDIR=%MYTCL% nmake -f makefile.vc MACHINE=IX86 install TCLDIR=%MYTCL% INSTALLDIR=%MYTCLTK%
same thing for x64 version (tested with Tcl/Tk 8.5.2)
set MYTCL="MYROOT\tcl-cvs" set MYTK="MYROOT\tk-cvs" set MYTCLTK="MYROOT\tcltk-cvs" CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64 cd %MYTCL%\win nmake -f makefile.vc MACHINE=AMD64 release nmake -f makefile.vc install MACHINE=AMD64 INSTALLDIR=%MYTCLTK% cd %MYTK%\win nmake -f makefile.vc MACHINE=AMD64 release TCLDIR=%MYTCL% nmake -f makefile.vc MACHINE=AMD64 install TCLDIR=%MYTCL% INSTALLDIR=%MYTCLTK%
- The only directory names to adapt to your configuration should be MYTCL, MYTK and MYTCLTK, where MYROOT should be set to the path of your choice where you checkouted the Tcl and Tk source code. The CALL uses the standard installation path from Microsoft (change it if needed).
Checkout the svn version of Scilab (Trunk) from the Inria website (see instructions here) and save it in MYROOT/Scilab_svn
- Checkout the Windows prerequisites for compilation, and put them aside of Scilab_svn (not in the same directory):
md Prerequirements cd Prerequirements svn co --username anonymous --password Scilab svn://frioul.inria.fr/scilab/trunk/Dev-Tools/SE/Prerequirements/Windows
- Copy only some prerequirement files in the directory where Scilab svn sources are located, namely: From prerequirements:
- directories java, libs, thirdparty and tools must be copied without change
- directory bin content must be copied entirely, except tcl84.dll, tk84.dll, tcl84.lib and tk84.lib
- directory modules content must be copied entirely, except modules/tclsci that should just be ignored
- Copy tcl85.dll and tk85.dll files from MYROOT/tcltk-cvs/bin into MYROOT/Scilab_svn/bin
- Copy tcl85.lib and tk85.lib files from MYROOT/tcltk-cvs/lib into MYROOT/Scilab_svn/bin
- Create directory MYROOT/Scilab-svn/modules/tclsci/includes/tcltk
- Copy the directory MYROOT/tcltk-cvs/include into MYROOT/Scilab-svn/modules/tclsci/includes/tcltk
- Copy tcl8.5 and tk8.5 directories from MYROOT/tcltk-cvs/lib into MYROOT/Scilab_svn/modules/tclsci/tcl
- Compile Scilab source code using the f2c solution (Scilab_f2c.sln) in Visual C++ Express Edition.
- Define an environment variable TCL_LIBRARY set to MYROOT\Scilab_svn\modules\tclsci\tcl\tcl8.5
This step is not yet fully understood. Without it, the call to Tcl_Init in MYROOT\Scilab_svn\modules\tclsci\src\InitTclTk.c does no longer fail preventing Scilab launch, but Tcl is not functioning properly. In fact it seems there is a conflict with the TCL_LIBRARY environment variable defined at the WScilex process level during Scilab startup. Bug 3054 probably has something to do with this.
About the TCL_LIBRARY environment variable, see : http://wiki.tcl.tk/1629
Step 8 (optional)
- Copy the msgcat1.3 (or later) directory into MYROOT/Scilab_svn/modules/tclsci/tcl/tcl8.5 to make localization features available in Scipad
The msgcat package can be found in any Tcl installation (such as the ActiveState distribution), or in the installation directory of binary versions of Scilab (SCI\tcl\tcl8.4).
- Copy the tkdnd directory into MYROOT/Scilab_svn/modules/tclsci/tcl/tk8.5 to make drag and drop support available in Scipad
The tkdnd package can be found in the installation directory of binary versions of Scilab (SCI\tcl\tk8.4), or following directions in help scipad.
- Check that everything is OK by running Scilab and querying the Tcl/Tk version used by this build:
___________________________________________ scilab-trunk-SVN Copyright (c) 1989-2008 Consortium Scilab (INRIA, ENPC) ___________________________________________ Startup execution: loading initial environment -->TCL_GetVersion() ans = TCL/TK 8.5.3 Final Release -->
- Here is a snapshot of Scipad running under Tcl/Tk 8.5. Note the tile mode showing three different parts of one single file. This is really very cool!
Cooking recipe Scilab 5.x SVN <-> Tcl/Tk 8.5 tried on Linux (FC5+updates)
- As of today (24/1/07). Work on the compilation of the svn snapshot under linux is still under progress, and often the build fails, or the result is partially functional.
- Compared to what above, it is really no big deal.
On linux, with the newest Tk you additionally gain rendering with many more nice antialiased fonts.
lazy man solution
get the Tcl and Tk sources tarballs from http://www.tcl.tk/software/tcltk/downloadnow85.html instead of sourceforge.
unpack them, say in directories tcl8.5a5/ and tk8.5a5/
real man solution
checkout the sourceforge cvs, as described above. This is really better, as you get a more advanced version. Scipad 6.81 requires Tcl/Tk 8.5a6, else it gives an (easily hackable) error upon undo delete text block.
in both cases:
in each of the two directories, issue cd unix; ./configure; make; make install . For the last step, you need to be root. Worked like a charm for me.
the resulting libraries and directories end up in /usr/local/lib, whereas the distribution libraries coming from the rpm installation are in /usr/lib, but the two coexist happily. However, note that tkdnd, if installed systemwise, has to be found at the same level as tk8.5/. I made it with ln -s /usr/lib/tkdnd1.0 /usr/local/lib/ .
Build Scilab. ./configure recognizes correctly that Tcl 8.5 is installed. That's all.
The danger of forward incompatibilities with ged and the sciGUI help has to be taken into account. In my case, sciGUI with the new Tk has certain troubles in rendering tables; ged dialogs don't exactly fit the window with the nicer new fonts.