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?


Cooking recipe Scilab SVN <-> Tcl/Tk 8.5 -- Windows platform, using Visual C++ Express Edition



Step 1

  • Checkout Tcl/Tk latest cvs core-8-5-branch version (instructions for Tcl are here ; instructions for Tk are here - you may have to adapt them to have core-8-5-branch and not HEAD, which is now 8.6)

  • 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).

Step 2

  • Checkout the svn version of Scilab (Trunk) from the Inria website (see instructions here) and save it in MYROOT/Scilab_svn

Step 3

  • 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

Step 4

  • 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
    Note: the above copies should be made while passing (ignoring) files from the hidden .svn directories.

Step 5

  • 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

Step 6

  • Compile Scilab source code using the f2c solution (Scilab_f2c.sln) in Visual C++ Express Edition.

Step 7

  • 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.

Step 9

  • 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!

Scipad_Tcl_Tk_85_Peers1.png


Cooking recipe Scilab 5.x SVN <-> Tcl/Tk 8.5 tried on Linux (FC5+updates)

  1. 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.
  2. Compared to what above, it is really no big deal.
  3. On linux, with the newest Tk you additionally gain rendering with many more nice antialiased fonts.


Step 1

lazy man solution

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/ .

Step 2

  • Build Scilab. ./configure recognizes correctly that Tcl 8.5 is installed. That's all.

Screenshot-SciPad-linux.png

  • 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.

public: Linking Scilab with Tcl/Tk 8.5 (last edited 2011-03-30 16:18:02 by localhost)