This is version 3.1. In this release there have been many bugs fixed and a number of new classes. Depending on when you get this, there may be more recent versions out. For more information and a FAQ see our web page at http://www.kitware.com
The Visualization Toolkit, An Object-Oriented Approach to 3D Graphics by Will Schroeder, Ken Martin and Bill Lorensen. Prentice Hall, Second Edition
First we will give you the quick and dirty way to build vtk. If you have OpenGL do the following:
If you will be using C++ as your development language:
1) untar the src files 2) untar the data files 3) cd vtk 4) ./configure 5) read and edit user.make 6) makeIf you will be using tcl in addition to C++:
1) untar the src files 2) untar the data files 3) cd vtk 4) obtain and build Tcl/Tk if you don't already have it 5) ./configure --with-tcl 6) read and edit user.make 7) makeIt is a very good idea to tell configure what C and C++ compilers you will be using. This can avoid many build problems. On most systems you can pass this information to configure in the following way:
env CXX=/your/C++/compiler CC=/your/c/compiler ./configureotherwise you must set CXX and CC in your environment and then run configure.
This release has java support, you can use --with-java but I think it only works on Sun Solaris and Windows. But feel free to experiment.
If you do not have OpenGL, you will need to get and compile Mesa, a wonderful free version of OpenGL. You will need to add --with-mesa to your configure line. If you want to try building shared libraries you can use the --with-shared option also.
Now here is the slightly more detailed version.
This software uses scripts generated by GNU autoconfigure to build itself. There are a couple of options in building the software that you need to decide on. First you need to decide if you are going to use the Mesa rendering library developed by Brian Paul. This is a software renderer that vtk can use on Xwindows based workstations. If your workstation doesn't support OpenGL then you will need Mesa because you have no other choice :-) If you want to build the vtk interpreter then you will need to have Tcl7.4 and Tk4.0 or greater.
Look to http://www.scriptics.com/ for information about getting Tcl and Tk. To obtain a copy of Mesa, written by Brian Paul, you can visit http://www.ssec.wisc.edu/~brianp/Mesa.html.
To build vtk in the distribution directory just type ./configure You can specify --with-tcl and/or --with-mesa on the command line if you would like to use those packages as well. Building vtk for multiple architectures will be discussed later.
To build the vtk library and the tcl bindings and use mesa you would specify
./configure --with-tcl --with-mesaThe command:
./configure --helpgives some brief help for the command line arguments. If you are using gmake then you might want to consider the --srcdir option.
The next step is to modify the user.make file. If you are using tcl/tk you must specify the full path to find the include files and libraries. If you are using mesa you must do the same. You might also want to specify the compiler flags. We recommend compiling without debug information and with optimizations. The debug information can quadruple the executable size. If you are going to be working with the C++ library you might want to look into using shared libraries. We use them in our development I just didn't figure out a good way to use them with the GNU autoconfigure stuff. So you might want to look into modifying the generated Makefiles and user.make to generate shared libraries. On most machines these days it's not too difficult.
Once this is done you can type make (or gmake if you have it) and it should compile :-)
If you are planning to build vtk for multiple architectures then you can either make a copy of the entire vtk tree for each architecture and then follow the instructions above. Or if you have gmake, you can have one copy of the vtk tree and compile it in a different manner. Instead of running configure from the vtk directory, create a new directory where you have some free disk space (not in the vtk tree), a possible name would be vtk-solaris. cd into this directory and then run configure similar to the following example:
ls /home/joe_user vtk vtk-solaris vtk-sgi cd vtk-solaris /home/joe_user/vtk/configure --with-tclThis will create makefiles in the vtk-solaris directory. Then you can run gmake in vtk-solaris to compile vtk. Repeate this process for each architecture you wish to build.
1. Install vtk3.1 distribution by unzipping in appropriate directory. 2. Execute vtk\pcmaker\pcmaker.exe. This will pop-up a little GUI that allows you to tailor the build. It then starts building makefiles and dependencies. It will run for a couple minutes depending on your system. You'll have to tell pcamaker where you've placed your vtk source code, and where to build the object code and dll's (we'll call it "vtkbin"). 3. When pcmaker completes, start up a MS-DOS shell window and change directories to vtkbin\vtkdll. Then run "nmake" (Microsft compiler) or "" (Borland compiler). This will compile for a LONG time. When it's done, you'll have a vtkdll.dll file in vtkbin\vtkdll\obj. You can then move this file into the appropriate system directory (on Win95: Windows\System; on NT: WinNT\system). 4. If you want to use Tcl/Tk on your PC, repeat step 3 above except work in directory vtkbin\vtktcl to create vtkbin\vtktcl\vtktcl.dll. Remember to move this file into your system area. (You'll also have to have Tcl (e.g., Wish) installed.) 5. You can then link against vtkdll.dll (C++); or run Tcl (wish). If you're running Tcl, make sure you start by dynamically loading the vtktcl libraries with the command "load vtktcl". 6. Enjoy.We recommend a 250MByte minimum swap size or you'll have trouble during the link phase.
To run the cc examples just type their name. To run the tcl examples, (assuming that you built the tcl stuff) type
../../tcl/vtk mace.tcl
1) create the .cxx and .h file for the new class in one of the existing directories. 2) edit Makefile.in for that directory and follow the instructions in there. You will need to add the class in only one place. 3) you will need to rerun configure 4) then make (or gmake)