Making Development Environment without compiling source distribution: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 60: Line 60:


In order for running ParaView client, and external python interpreter,  we need two environment variables, PATH and PYTHONPATH. PATH should include the dll or exe file directories of python, Qt, ParaView and VTK. PYTHONPATH is needed for executing VTK python or ParaView python scripts in external python interpretor, which should includes the directories of python specific .pyd files and pure python packages. Followings are batch files for setup environment variables:
In order for running ParaView client, and external python interpreter,  we need two environment variables, PATH and PYTHONPATH. PATH should include the dll or exe file directories of python, Qt, ParaView and VTK. PYTHONPATH is needed for executing VTK python or ParaView python scripts in external python interpretor, which should includes the directories of python specific .pyd files and pure python packages. Followings are batch files for setup environment variables:


----
----

Revision as of 12:22, 1 July 2010

The tedious compiling from VTK source is gone by the help of ParaView 3.8.0 developer distribution. By simply installing ParaView 3.8.0 developer distribution, we can develop C++ program with VTK, run VTK python script in external python interpreter, and extending ParaView.

This document is based on Windows 32bit OS, and ParaView 3.8.0 developer distribution(ParaView-Development-3.8.0-Win32-x86.exe). The compiler should be Microsoft Visual Studio 2008 SP1 (MSVC 2008), which is used compiling the distribution.

Three prerequisites are DirectX SDK, Qt, and Python distributions. The tested versions are

- MS DirectX SDK (June 2010)

- Qt 4.6.3 (qt-win-opensource-4.6.3-vs2008.exe [1])

- Python 2.6.5 (python-2.6.5.msi [2])


At the end of setup, we can get the following directory tree.

- c:/ParaView/3.8.0/Dev : Installation direction of ParaView developer distribution

- c:/ParaView/3.8.0/SRC : ParaView source directory

- c:/ParaView/3.8.0/ParaViewData : ParaView sample data directory

- c:/ParaView/3.8.0/VTKData : VTK sample data directory


The setup procedure are as followings:


STEP 1. Download ParaView 3.8.0 developer distribution, source distribution, data and help files


- ParaView-Development-3.8.0-Win32-x86.exe, ParaView-3.8.0.zip, ParaViewData-3.8.0.zip, ParaView3-html.tar.gz [3]

- vtkdata-5.6.0.zip, vtkDocHtml-5.6.0.tar.gz [4]


STEP 2. Install ParaView-Development-3.8.0-Win32-x86.exe to C:/ParaView/3.8.0/Dev


STEP 3. Unzip ParaView-3.8.0.zip to c:/ParaView/3.8.0/SRC


STEP 4. Unzip ParaViewData-3.8.0.zip to c:/ParaView/3.8.0/ParaViewData


STEP 5. Unzip vtkdata-5.6.0.zip to c:/ParaView/3.8.0/VTKData


The directory tree is completed. Next some cmake setting file should be edited for the prerequisites. In VTKConfig.cmake, VTKConfigQt.cmake and VTKLibraryDepends.cmake, which can be found in Dev/Lib/ParaView-3.8.0, modify followings:

- C:/Python/Python26-x86 -> C:/Python26

- C:/qt/qt-4.6.2-x86 -> C:/Qt/4.6.3

- C:/Program Files (x86)/Microsoft DirectX SDK (February 2010) -> C:/Program Files/Microsoft DirectX SDK (June 2010)


Noting that '/' is used, not '\'.

Setup environment variables

In order for running ParaView client, and external python interpreter, we need two environment variables, PATH and PYTHONPATH. PATH should include the dll or exe file directories of python, Qt, ParaView and VTK. PYTHONPATH is needed for executing VTK python or ParaView python scripts in external python interpretor, which should includes the directories of python specific .pyd files and pure python packages. Followings are batch files for setup environment variables:


setenv.bat

@set PATH=c:\python26;c:\Qt\4.6.3\bin;c:\ParaView\3.8.0\Dev\BIN;%PATH%

@set PYTHONPATH=c:\ParaView\3.8.0\SRC\VTK\Wrapping\Python;c:\ParaView\3.8.0\Dev\LIB\paraview-3.8;%PYTHONPATH%


Now simply VTK python scripts can be run in console as following


setenv.bat

python test.py