How to create the vtk.exe

How to create the vtk.exe, I just show the .tcl file, there is no any tips to show how to create the vtk.exe?

What do you mean by vtk.exe? VTK is a library, you should expect to have .dll files.

I remember there is an binary download package installation, there is vtk.exe, but now there is no binary installation

The vtk.exe is not included in any of the VTK packages that are available, and VTK dropped Tcl support completely in 2017.

It is possible to build vtk.exe from the VTK 7.1.1 source code.

thank you for the reply, but I didn’t find the project in VTK 7.1.1 to create the VTK.exe,
is it the project of vtkwraptcl? it shows I need to download from other website if I enabled this option in CMake-gui

it’s really disappointed even such basic requirement

The CMake options you need to set for building vtk.exe are VTK_WRAP_TCL=ON and VTK_USE_TK=ON. You will also want to set BUILD_TESTING:BOOL=OFF to avoid extra downloads and build time.

The last time that I built vtk.exe, myself, was about two years ago. I had to do the following:

  1. download source for Tcl8.6, then build and install it.
  2. download source for Tk8.6, then build and install it.
  3. build VTK 7.1 from source.

Building Tcl and Tk was a pain, but this is necessary because none of the binary Tcl/Tk packages for Windows seem to have all the necessary header files.

If you are really interested in pursuing this (I warn you that it will take many hours of your time), then I can examine my previous build and give you more detailed instructions. Unfortunately Tcl is just not as well-supported as it was 10 or 20 years ago.

As tcl is replaced by python, vtk.exe is replaced by python.exe. There is no need to build a custom executable, just pip install vtk in your python environment.

I have built and installed the tcl and tk , but I don’t know how to set the
Could NOT find TCL (missing: TCL_LIBRARY)
Could NOT find TCLTK (missing: TCL_LIBRARY TK_LIBRARY)
Could NOT find TK (missing: TK_LIBRARY)

even I add those variables in the environment, but it is not valid, do you remember how to config?

@Johnny, what are your reasons for trying to revive tcl support? Even if you succeeded, using tcl would isolate you from the rest of the world: anything that you do in tcl will not be of interest to most other people, and you won’t be able to benefit from all the enormous advancements that Python is going through nowadays. If you have legacy tcl code that you would like to keep using then you could invest time into porting that to Python instead of trying to restore VTK’s tcl support.

right now we have a legacy solution, it creates a tcl file and uses the vtk.exe to show. it just a isolated file. maybe it is another way by using the python

Using Python, it’ll be a single executable, too, but you also need to copy a bunch of other files to the Python folder, too. It is a small price to pay for what you get. If single-file standalone executable is a must then you can look into building Python executable with VTK support embedded (probably not trivial effort but it may be useful in general).

@Johnny those TCL variables must be set in cmake-gui. First, you must find where Tcl is installed on your system, and then find the tcl and tk libraries. For example:

TCL_LIBRARY=C:/Tcl86/lib/tcl86t.lib
TK_LIBRARY=C:/Tcl86/lib/tk86t.lib
TCL_INCLUDE_PATH=C:/Tcl86/include
TK_INCLUDE_PATH=C:/Tcl86/include

It might also be necessary to set the following, but cmake should find it automatically (the following path assumes your VTK source is in “C:/vtk-7.1”, so of course you would use the actual path to your VTK source tree).

TK_INTERNAL_PATH=C:/vtk-7.1/ThirdParty/TclTk/internals/tk8.6