VTK/CSharp/ActiViz/Build: Difference between revisions

From KitwarePublic
< VTK
Jump to navigationJump to search
mNo edit summary
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Current Status=
There is an updated version of the wrappers under review for VTK6 with new modular source base: http://www.vtk.org/Wiki/VTK/CSharp/ComingSoon
<p>See this related message on the status of gccxml: http://public.kitware.com/pipermail/gccxml/2010-November/001435.html
</p>
<h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1>
<h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1>
Preface: There's no need to build ActiViz.NET. You can download precompiled, ready to install versions (32-bit and 64-bit Windows XP and later) here:[http://www.kitware.com/products/avdownload.php]<br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.


<h2>Prerequisites to build ActiViz.NET</h2>
<h2>Prerequisites to build ActiViz.NET</h2>
Line 80: Line 88:
<p></p>
<p></p>


<h3>Activiz.NET source</h3>
<h3>ActiViz.NET source</h3>
<p>Use git to retrieve mummy source code:</p>
<p>Use git to retrieve ActiViz.NET source code:</p>
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p>
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p>
<p></p>
<p></p>
Line 134: Line 142:
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p>
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p>


<p>
<p>
Line 143: Line 151:


<p>Click Configure. CMake first check your compiler capabilities, then trying
<p>Click Configure. CMake first check your compiler capabilities, then trying
to find the prerequisite tools and gather other informations. This may take a
to find the required tools and gather other informations. This may take a
while.</p>
while.</p>


Line 155: Line 163:
       <td style="width: 25%;">CMAKE_INSTALL_PREFIX</td>
       <td style="width: 25%;">CMAKE_INSTALL_PREFIX</td>
       <td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td>
       <td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td>
       <td>where binaries are installed</td>
       <td>Where binaries are installed</td>
     </tr>
     </tr>
     <tr>
     <tr>
       <td style="width: 25%;">CVSCOMMAND</td>
       <td style="width: 25%;">CVSCOMMAND</td>
       <td style="width: 30%;">C:/Windows/cvs.exe</td>
       <td style="width: 30%;">C:/Windows/cvs.exe</td>
       <td>whereever you copied cvs.exe to (folder must be set in environment
       <td>Wherever you copied cvs.exe to (folder must be set in environment
         variable PATH)</td>
         variable PATH)</td>
     </tr>
     </tr>
Line 186: Line 194:
       <td style="width: 25%;">VTK_DATA_ROOT</td>
       <td style="width: 25%;">VTK_DATA_ROOT</td>
       <td style="width: 30%;">C:/VTK/vtkdata</td>
       <td style="width: 30%;">C:/VTK/vtkdata</td>
       <td>needed for final tests</td>
       <td>Needed for final tests</td>
     </tr>
     </tr>
     <tr>
     <tr>
       <td style="width: 25%;">VTK_LARGE_DATA_ROOT</td>
       <td style="width: 25%;">VTK_LARGE_DATA_ROOT</td>
       <td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td>
       <td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td>
       <td>not necessarely needed</td>
       <td>Not necessarily needed</td>
     </tr>
     </tr>
</table>
</table>
Line 202: Line 210:
       <td style="width: 25%;">BUILD_SHARED_LIBS</td>
       <td style="width: 25%;">BUILD_SHARED_LIBS</td>
       <td style="width: 30%;">ON</td>
       <td style="width: 30%;">ON</td>
       <td>necessary</td>
       <td>Necessary</td>
     </tr>
     </tr>
     <tr>
     <tr>
       <td style="width: 25%;">VTK_USE_PARALLEL</td>
       <td style="width: 25%;">VTK_USE_PARALLEL</td>
       <td style="width: 30%;">ON</td>
       <td style="width: 30%;">ON</td>
       <td>needed for ActiViz (it needs VPIC.dll, which is only being build when
       <td>Not necessarily needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)</td>
        VTK_USE_PARALLEL is checked)</td>
     </tr>
     </tr>
</table>
</table>
Line 215: Line 222:


<table border="1" style="width: 100%; margin-top: 25px;">
<table border="1" style="width: 100%; margin-top: 25px;">
   <caption>useful settings, but not necessarely needed</caption>
   <caption>Useful settings, but not necessarily needed</caption>
     <tr>
     <tr>
       <td style="width: 25%;">BUILD_DOCUMENTATION</td>
       <td style="width: 25%;">BUILD_DOCUMENTATION</td>
Line 234: Line 241:
       <td style="width: 25%;">HDF5_BUILD_HL_LIB</td>
       <td style="width: 25%;">HDF5_BUILD_HL_LIB</td>
       <td style="width: 30%;">ON</td>
       <td style="width: 30%;">ON</td>
       <td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td>
       <td>Not necessarily needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)</td>
     </tr>
     </tr>
</table>
</table>
Line 240: Line 247:
<p>Click Configure again.</p>
<p>Click Configure again.</p>


<p>After this Configure run only one line should be marked in red color
<p>Having VTK_USE_PARALLEL set to on only one line should be marked in red color after this Configure run: </p>
anymore</p>


<p>VTK_USE_MPI</p>
<p>VTK_USE_MPI</p>
Line 263: Line 269:
MapReduceMPI.dll
MapReduceMPI.dll
mpistubs.dll
mpistubs.dll
VPIC.dll
(VPIC.dll)  // only if VTK_USE_PARALLEL is set to on
vtkalglib.dll
vtkalglib.dll
vtkCharts.dll
vtkCharts.dll
Line 277: Line 283:
vtkGraphics.dll
vtkGraphics.dll
vtkhdf5.dll
vtkhdf5.dll
vtkhdf5_hl.dll
(vtkhdf5_hl.dll)  // only if HDF5_BUILD_HL_LIB is set to on
vtkHybrid.dll
vtkHybrid.dll
vtkImaging.dll
vtkImaging.dll
Line 302: Line 308:
<p></p>
<p></p>


<h2>Configure and build gccxml</h2>
==Configure and build gccxml==
 
<p>gccxml source should be downloaded from the current CVS trunk (http://www.gccxml.org/HTML/Download.html)</p>
<pre>
cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login
cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml
</pre>


<p>Run CMake and select your gccxml source path and define a path for the binaries. Click Configure. The only thing you may want to adjust is the path where gccxml is going to be installed:</p>
<p>Then run CMake and select your gccxml source path and define a path for the binaries. Click Configure. The only thing you may want to adjust is the path where gccxml is going to be installed:</p>


<table border="1" style="width: 100%; margin-top: 25px;">
<table border="1" style="width: 100%; margin-top: 25px;">
Line 322: Line 334:


<p>As a final step you must configure your gccxml installation with <strong>gccxml_vcconfig.bat</strong>. This batch file is located in the bin
<p>As a final step you must configure your gccxml installation with <strong>gccxml_vcconfig.bat</strong>. This batch file is located in the bin
folder of your installation folder (e.g. C:\Program Files\gccxml\bin). Open a cmd shell as an administrator in the bin folder and run gccxml_vcconfig.bat.</p>
folder of your installation folder (e.g. C:\Program Files\gccxml\bin). Open a cmd shell as an administrator in the bin folder and run gccxml_vcconfig.bat. Note that if you receive errors finding the "VC9\Include" directory, that indicates you have not run the cmd shell as administrator.</p>
 
 


<p></p>
<p></p>
Line 337: Line 351:
<p>(for instance: jk.mummy.Runtime.snk).</p>
<p>(for instance: jk.mummy.Runtime.snk).</p>


<p>Now that we have a signing key we must tell our compiler to use this key and
<p>Now that we have a signing key we must tell Cmake to use this key and
where to find it. Insert the following statement into
where to find it. Insert the following statement into
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder
Line 346: Line 360:


<p>During the configuration run you may want to verify the content of
<p>During the configuration run you may want to verify the content of
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p>
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p>
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre>
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre>


<p>Also you may ask yourself where to enter these statements in cmakelist.txt.
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p>
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p>
<pre># Echo selected CMake/configuration settings:</pre>
<pre># Echo selected CMake/configuration settings:</pre>


<p>This line can be found near line # 140.</p>
<p>The line can be found near line # 140.</p>


<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and
Line 362: Line 376:
</p>
</p>


<p>1. add some more lines to cmakelist.txt:</p>
<p>1. add these lines mummy/CMakeLists.txt</p>
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
IF(MSVC80)
IF(MSVC80)
Line 370: Line 384:
   SET(gccxml_compiler "msvc9")
   SET(gccxml_compiler "msvc9")
ENDIF(MSVC90)
ENDIF(MSVC90)
IF(MSVC10)
  SET(gccxml_compiler "msvc10")
ENDIF(MSVC10)
#SET(gccxml_compiler "msvc8")
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre>
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre>


<p>Note:</p>
<p>Note:</p>
<ul>
<ul>
  <li>This must be at the top of the file or else the variable GCCXML_EXTRA_D_ARGS will not be set for CMakeLists.txt. Best to add after CMAKE_MINIMUM_REQUIRED line.</li>
   <li>gccxml don't understand <strong>cl</strong> as the compiler name, but
   <li>gccxml don't understand <strong>cl</strong> as the compiler name, but
     that's the content of ${CMAKE_CXX_COMPILER}.<br />
     "cl" is the content of ${CMAKE_CXX_COMPILER}.<br />
     If you ommit the first 10 lines you'get the following error message:<br />
     If you ommit the first 7 lines you'get the following warning:<br />
     <span style="font-family: Courier New,Courier,monospace; font-size: small;">
     <span style="font-family: Courier New,Courier,monospace; font-size: small;">
     Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br />
     Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br />
Line 397: Line 409:


<p></p>
<p></p>
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p>
<p>2. edit CMakeLists.txt in mummy subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p>


<p>Find the following paragraph (near line # 82):<strong></strong></p>
<p>Find the following paragraph (near line # 82):<strong></strong></p>
Line 416: Line 428:


<p>and replace it with:</p>
<p>and replace it with:</p>
<pre>ADD_CUSTOM_COMMAND(
<pre>  
ADD_CUSTOM_COMMAND(
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
       COMMAND ${gccxml_EXECUTABLE}
       COMMAND ${gccxml_EXECUTABLE}
Line 430: Line 443:
         ${header_fullpath}
         ${header_fullpath}
         ${gccxml_EXECUTABLE}
         ${gccxml_EXECUTABLE}
       )</pre>
       )
</pre>
 


<p>Having the examples for mummy you can verify mummy has been properly build and installed and is working the way it should prior to the installation of ActiViz. Sounds like a good idea to me.</p>
<p>Having the examples for mummy you can verify mummy has been properly build and installed and is working the way it should prior to the installation of ActiViz. Sounds like a good idea to me.</p>
Line 436: Line 451:
<p>Note: </p>
<p>Note: </p>
<ul>
<ul>
   <li>During the Cmake configuration run a CableSwig source tree is checked out. It should not be necessary to mention you must be online. :D</li>
   <li>During the Cmake configuration run a CableSwig source tree is checked out. It should not be necessary to mention to be online. :D</li>
</ul>
</ul>
<ul>
<ul>
Line 455: Line 470:
<p>Caution: You cannot use the same signing key file used for mummy!</p>
<p>Caution: You cannot use the same signing key file used for mummy!</p>


<p>Now that we have a signing key we must tell our compiler to use this key and where to find it. Find the following paragraph in cmakelist.txt (the one in the root folder of your activizdotnet sourcetree, for instance C:\VTK\ActiViz\activizdotnet\cmakelist.txt):</p>
<p>Now that we have a signing key we must tell CMake to use this key and where to find it. Find the following paragraph in cmakelist.txt (the one in the root folder of your activizdotnet sourcetree, for instance C:\VTK\ActiViz\activizdotnet\cmakelist.txt):</p>


<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)
Line 483: Line 498:
</p>
</p>


<p>Insert the following line right below the found paragraph:</p>
<p>Insert the following line right''' below''' the found paragraph:</p>


<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre>
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre>
Line 525: Line 540:
</p>
</p>


<p>Okay, now we are ready to perform our first CMake configure run.</p>
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p>
<pre>      # Add extra utility DLLs the kit DLLs depend on:
</pre>
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p>
<pre>      SET(vtkListOfDLLs ${vtkListOfDLLs}
        LSDyna
        Cosmo
        VPIC
        vtkhdf5_hl
        vtkalglib
        vtkDICOMParser
        vtkexoIIc
        vtkftgl
        vtkhdf5
        vtkmetaio
        vtkNetCDF
        vtkNetCDF_cxx
        vtksys
        vtkverdict
      )
</pre>
<p>Note:<ul>
<li>In case you compiled vtk while setting VTK_USE_PARALLEL to OFF remove VPIC too.</li>
<li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl and vtkhdf5 too.</li>
<li>Cosmo can be removed as well.</li>
<li>I'm pretty quite sure that other libs can be removed as well, depending on particular vtk cmake settings. You may have to experiment with it.</li>
</ul></p>  


<p>When finished you see a bunch of entries.</p>
 
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p>


<p></p>
<p></p>
Line 544: Line 586:
     </tr>
     </tr>
     <tr>
     <tr>
       <td style="width: 25%;">PYTHON_EXECTUABLE</td>
       <td style="width: 25%;">PYTHON_EXECUTABLE</td>
       <td style="width: 40%;">C:/Program Files/Python26/python.exe</td>
       <td style="width: 40%;">C:/Program Files/Python26/python.exe</td>
       <td></td>
       <td></td>
Line 561: Line 603:
       <td style="width: 25%;">CVSCOMMAND</td>
       <td style="width: 25%;">CVSCOMMAND</td>
       <td style="width: 40%;">C:/Windows/cvs.exe</td>
       <td style="width: 40%;">C:/Windows/cvs.exe</td>
       <td>whereever you copied cvs.exe to (folder must be set in environment
       <td>wherever you copied cvs.exe to (folder must be set in environment
         variable PATH)</td>
         variable PATH)</td>
     </tr>
     </tr>
Line 578: Line 620:
       <td
       <td
       style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td>
       style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td>
      <td></td>
    </tr>
    <tr>
      <td style="width: 25%;">VTK_DIR</td>
      <td
      style="width: 40%;">C:/VTK/vtk-5.8.0-build</td>
       <td></td>
       <td></td>
     </tr>
     </tr>
Line 587: Line 635:
       <td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td>
       <td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td>
       <td style="width: 40%;">OFF</td>
       <td style="width: 40%;">OFF</td>
       <td>I've never tried to set in to ON (feel free to try out)</td>
       <td>switch it to on in case you want to debug ActiViz</td>
     </tr>
     </tr>
</table>
</table>
Line 615: Line 663:
you've defined above.</p>
you've defined above.</p>


<p>That's it folks.</p>
<p>That's all folks.</p>

Latest revision as of 15:26, 25 October 2013

Current Status

There is an updated version of the wrappers under review for VTK6 with new modular source base: http://www.vtk.org/Wiki/VTK/CSharp/ComingSoon

See this related message on the status of gccxml: http://public.kitware.com/pipermail/gccxml/2010-November/001435.html

Build ActiViz.NET with Visual Studio Express C++ 2008

Preface: There's no need to build ActiViz.NET. You can download precompiled, ready to install versions (32-bit and 64-bit Windows XP and later) here:[1]
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.

Prerequisites to build ActiViz.NET

CMake (the cross-platform, open-source build system)

you can download it from: http://www.cmake.org

Concurrent Versions System (CVS)

It's a command line tool required at mummy configure time because it retrieves a snapshot of CableSwig for the source code to the cable libraries.

For windows you can download it from http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains nothing but a executable)

Once downloaded unzip the archive and copy the executable to a folder which is defined in the PATH environment variable.

Git client

A git client is needed to download the latest mummy and ActiViz sources.

you can download it from: http://msysgit.github.com/

Source control software (SVN)

(I'm not sure whether it's really necessary because I had it installed already and never tried to build vtk and ActiViz without svn.exe). You probably get an error message or a warning in case it will be necessary.

you can download it from: http://tortoisesvn.net/

Make sure you install the command line client tools during setup

Python

Python is required at ActiViz .NET build time to convert VTK tcl tests to C#.

you can download it from: http://www.python.org/getit/windows/

XML output extension to the C++ front-end of GCC

Check out the latest develop version:

cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login

(just press enter when prompted for a password)

Follow this command by checking out the source code:

cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml

vtk 5.8.0 source

you can download it from: http://www.vtk.org/VTK/resources/software.html#previous

mummy

Needed to wrap unmanaged c++ dlls with managed dlls.

Use git to retrieve mummy source code:

git clone git://public.kitware.com/mummy.git

ActiViz.NET source

Use git to retrieve ActiViz.NET source code:

git clone git://public.kitware.com/activizdotnet.git

Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)

A signing key to produce "strong name signed" .NET Framework binaries.

If you don't have your own strong name signing key, you can disable strong name validation on the machine that you want to build and test it on. However, to install your unsigned build on another machine, they will also have to disable strong name validation. It's a good idea to sign your .NET binaries if you're going to be re-distributing them.

Documentation tools

Doxygen

you can download it from: http://www.stack.nl/~dimitri/doxygen/

GraphViz

you can download it from: http://www.graphviz.org/

Directory structure

This directory structure is only intended as a suggestion:

VTK CSharp ActiViz Build FolderStructure.png

Configure and build vtk

Define where to search for the source code of vtk and where to build the binaries for vtk.

VTK CSharp ActiViz Build Cmake01.png

Click Configure. In the following dialog choose the compiler. Select for instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.

VTK CSharp ActiViz Build Cmake02.png

Click Finish.

Click Configure. CMake first check your compiler capabilities, then trying to find the required tools and gather other informations. This may take a while.

When finished you see a bunch of entries.

Verify and adjust following entries
CMAKE_INSTALL_PREFIX C:/VTK/VTK-5.8.0-install Where binaries are installed
CVSCOMMAND C:/Windows/cvs.exe Wherever you copied cvs.exe to (folder must be set in environment variable PATH)
GITCOMMAND C:/Program Files/Git/bin/git.exe
PYTHON_EXECTUABLE C:/Program Files/Python26/python.exe
SPC_COMMAND C:/Program Files/Git/bin/scp.exe
SVN_COMMAND C:/Program Files/TortoiseSVN/bin/svn.exe
VTK_DATA_ROOT C:/VTK/vtkdata Needed for final tests
VTK_LARGE_DATA_ROOT C:/VTK/vtkdata/VTKLargeData Not necessarily needed

Enable following entries
BUILD_SHARED_LIBS ON Necessary
VTK_USE_PARALLEL ON Not necessarily needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)

Useful settings, but not necessarily needed
BUILD_DOCUMENTATION ON
BUILD_EXAMPLES ON
BUILD_TESTING ON
HDF5_BUILD_HL_LIB ON Not necessarily needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)

Click Configure again.

Having VTK_USE_PARALLEL set to on only one line should be marked in red color after this Configure run:

VTK_USE_MPI

If MPI isn't installed on your machine or you just don't want to use it leave this entry unchecked, and click Configure again.

In case everything seems to be configured properly (nothing is marked in red) click Generate.

Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open VTK.sln with Visual Studio C++ 2008. Select Release as your solution configuration, in solution explorer right click on ALL_BUILD and choose Build. Relax and take a cup of tea or coffee. The build process may take a while.

When the build has been successful you should find the following dlls in your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):

Cosmo.dll
MapReduceMPI.dll
mpistubs.dll
(VPIC.dll)  // only if VTK_USE_PARALLEL is set to on
vtkalglib.dll
vtkCharts.dll
vtkCommon.dll
vtkDICOMParser.dll
vtkexoIIc.dll
vtkexpat.dll
vtkFiltering.dll
vtkfreetype.dll
vtkftgl.dll
vtkGenericFiltering.dll
vtkGeovis.dll
vtkGraphics.dll
vtkhdf5.dll
(vtkhdf5_hl.dll)  // only if HDF5_BUILD_HL_LIB is set to on
vtkHybrid.dll
vtkImaging.dll
vtkInfovis.dll
vtkIO.dll
vtkjpeg.dll
vtklibxml2.dll
vtkmetaio.dll
vtkNetCDF.dll
vtkNetCDF_cxx.dll
vtkParallel.dll
vtkpng.dll
vtkproj4.dll
vtkRendering.dll
vtksys.dll
vtktiff.dll
vtkverdict.dll
vtkViews.dll
vtkVolumeRendering.dll
vtkWidgets.dll
vtkzlib.dll

Configure and build gccxml

gccxml source should be downloaded from the current CVS trunk (http://www.gccxml.org/HTML/Download.html)

cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login
cvs -d :pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml

Then run CMake and select your gccxml source path and define a path for the binaries. Click Configure. The only thing you may want to adjust is the path where gccxml is going to be installed:

Adjust following entries
CMAKE_INSTALL_PREFIX C:/Program Files/gccxml

Click Generate.

Goto to your Build folder and open gccxml.sln with Visual Studio C++ 2008. Select Release as your solution configuration, in solution explorer right click on ALL_BUILD and choose Build.

After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.

As a final step you must configure your gccxml installation with gccxml_vcconfig.bat. This batch file is located in the bin folder of your installation folder (e.g. C:\Program Files\gccxml\bin). Open a cmd shell as an administrator in the bin folder and run gccxml_vcconfig.bat. Note that if you receive errors finding the "VC9\Include" directory, that indicates you have not run the cmd shell as administrator.


Configure and build Mummy

First of all you should create a signing key to produce "strong name signed" .NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk prompt, and type

sn -k WhateverNameYouWant.snk

(for instance: jk.mummy.Runtime.snk).

Now that we have a signing key we must tell Cmake to use this key and where to find it. Insert the following statement into cmakelist.txt, located in the root of your mummy source folder (on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):

GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)

Make sure the snk file can be found at this location.

During the configuration run you may want to verify the content of ${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:

Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")

Also you may ask yourself where to enter these statements in cmakelist.txt. Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage of ${Mummy_SNKEYFILE}.
I put it right before the line

# Echo selected CMake/configuration settings:

The line can be found near line # 140.

This configuration should be good enough to build Kitware.mummy.Runtime.dll and Kitware.mummy.Runtime.Unmanaged.dll successful, which in fact are the only two files we will need for ActiViz to work properly.

In case you want the mummy-examples to be build successful as well you must

1. add these lines mummy/CMakeLists.txt

SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
IF(MSVC80)
  SET(gccxml_compiler "msvc8")
ENDIF(MSVC80)
IF(MSVC90)
  SET(gccxml_compiler "msvc9")
ENDIF(MSVC90)
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")

Note:

  • This must be at the top of the file or else the variable GCCXML_EXTRA_D_ARGS will not be set for CMakeLists.txt. Best to add after CMAKE_MINIMUM_REQUIRED line.
  • gccxml don't understand cl as the compiler name, but "cl" is the content of ${CMAKE_CXX_COMPILER}.
    If you ommit the first 7 lines you'get the following warning:
    Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.
    Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.
    Using MSVC 9 because it was used to build GCC-XML.
  • If you ommit the last line you'll get a bunch of following nice error messages:
    C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'
    C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous definition of 'struct std::tr1::_Result_of1<_Rx (_Arg0::*)(), _Farg0&>'

2. edit CMakeLists.txt in mummy subfolder Examples\Vehicles\wrappers\csharpmummy:

Find the following paragraph (near line # 82):

ADD_CUSTOM_COMMAND(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
      COMMAND ${gccxml_EXECUTABLE}
      ARGS
        -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
        -fxml-start=_cable_
        ${gccxml_include_args} -DCABLE_CONFIGURATION
        --gccxml-compiler ${CMAKE_CXX_COMPILER}
        ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
      DEPENDS
        ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
        ${header_fullpath}
        ${gccxml_EXECUTABLE}
      )

and replace it with:

   
ADD_CUSTOM_COMMAND(
      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
      COMMAND ${gccxml_EXECUTABLE}
      ARGS
        -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
        -fxml-start=_cable_
        ${gccxml_include_args} -DCABLE_CONFIGURATION
        --gccxml-compiler ${gccxml_compiler}
        ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
        -D${GCCXML_EXTRA_D_ARGS}
      DEPENDS
        ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
        ${header_fullpath}
        ${gccxml_EXECUTABLE}
      )


Having the examples for mummy you can verify mummy has been properly build and installed and is working the way it should prior to the installation of ActiViz. Sounds like a good idea to me.

Note:

  • During the Cmake configuration run a CableSwig source tree is checked out. It should not be necessary to mention to be online. :D
  • If the parent directory is named exactly "ActiViz" then the external source trees are created as siblings of "ActiViz" - otherwise they are created as siblings of mummys source directory.

Configure and build ActiViz.NET

First of all you should create a signing key to produce "strong name signed" .NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk prompt, and type

sn -k WhateverNameYouWant.snk

(for instance: jk.VTK.snk).

Caution: You cannot use the same signing key file used for mummy!

Now that we have a signing key we must tell CMake to use this key and where to find it. Find the following paragraph in cmakelist.txt (the one in the root folder of your activizdotnet sourcetree, for instance C:\VTK\ActiViz\activizdotnet\cmakelist.txt):

IF(NOT DEFINED AVDN_SNKEYFILE)
  GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)
ENDIF(NOT DEFINED AVDN_SNKEYFILE)

and insert the following line above the found paragraph:

GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)

Don't forget to replace jk.VTK.snk with the name of your snk file and ensure your snk file can be found at this location.

Again we must make some adjustments to the gccxml command. Search the following paragraph:

SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
IF(MSVC80)
  SET(gccxml_compiler "msvc8")
ENDIF(MSVC80)
IF(MSVC90)
  SET(gccxml_compiler "msvc9")
ENDIF(MSVC90)
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")

Insert the following line right below the found paragraph:

SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")

Now find the following paragraph:

        ADD_CUSTOM_COMMAND(
          OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
          COMMAND ${gccxml_EXECUTABLE}
          ARGS
            -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
            -fxml-start=_cable_
            ${gccxml_include_args} -DCABLE_CONFIGURATION
            --gccxml-compiler ${gccxml_compiler}
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
          DEPENDS
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
            ${header}
            ${gccxml_EXECUTABLE}
        )

and replace it with

        ADD_CUSTOM_COMMAND(
          OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
          COMMAND ${gccxml_EXECUTABLE}
          ARGS
            -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
            -fxml-start=_cable_
            ${gccxml_include_args} -DCABLE_CONFIGURATION
            --gccxml-compiler ${gccxml_compiler}
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
            -D${GCCXML_EXTRA_D_ARGS}
          DEPENDS
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
            ${header}
            ${gccxml_EXECUTABLE}
        )

As a last adjustment we have to remove a reference to LsDyna.dll. Find the line

      # Add extra utility DLLs the kit DLLs depend on:

Then remove LsDyna from the following statement (comes right after the found line)

      SET(vtkListOfDLLs ${vtkListOfDLLs}
        LSDyna
        Cosmo
        VPIC
        vtkhdf5_hl
        vtkalglib
        vtkDICOMParser
        vtkexoIIc
        vtkftgl
        vtkhdf5
        vtkmetaio
        vtkNetCDF
        vtkNetCDF_cxx
        vtksys
        vtkverdict
      )

Note:

  • In case you compiled vtk while setting VTK_USE_PARALLEL to OFF remove VPIC too.
  • In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl and vtkhdf5 too.
  • Cosmo can be removed as well.
  • I'm pretty quite sure that other libs can be removed as well, depending on particular vtk cmake settings. You may have to experiment with it.


Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.

Verify and adjust following entries
AVDN_INSTALL_PREFIX c:/VTK/ActiViz/activiz-install where binaries are installed during the INSTALL build
GITCOMMAND C:/Program Files/Git/bin/git.exe
PYTHON_EXECUTABLE C:/Program Files/Python26/python.exe
SPC_COMMAND C:/Program Files/Git/bin/scp.exe
SVN_COMMAND C:/Program Files/TortoiseSVN/bin/svn.exe
CVSCOMMAND C:/Windows/cvs.exe wherever you copied cvs.exe to (folder must be set in environment variable PATH)
gccxml_EXECUTABLE C:/Program Files/gccxml/bin/gccxml.exe
mummy_DIR C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2
mummy_EXECUTABLE C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe
VTK_DIR C:/VTK/vtk-5.8.0-build

Enable/Disable following entries
AVDN_BUILD_CSHARP_DEBUG OFF switch it to on in case you want to debug ActiViz

useful settings, but not necessarely needed
GENERATE_DOXYGEN ON create doxygen documentation
BUILD_TESTING ON create test applications

Configure and generate.

Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++ 2008. Select Release as your solution configuration, in solution explorer right click on ALL_BUILD and choose Build. After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.

That's all folks.