https://public.kitware.com/Wiki/api.php?action=feedcontributions&user=Jochen&feedformat=atomKitwarePublic - User contributions [en]2024-03-28T18:29:32ZUser contributionsMediaWiki 1.38.6https://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48240VTK/CSharp/ActiViz/Build2012-06-27T21:02:42Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>ActiViz.NET source</h3><br />
<p>Use git to retrieve ActiViz.NET source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz (see section 1.5 Configure and build ActiViz.NET)</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>Having VTK_USE_PARALLEL set to on only one line should be marked in red color after this Configure run: </p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
(VPIC.dll) // only if VTK_USE_PARALLEL is set to on<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
(vtkhdf5_hl.dll) // only if HDF5_BUILD_HL_LIB is set to on<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 7 lines you'get the following warning:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><br />
<li>In case you compiled vtk while setting VTK_USE_PARALLEL to OFF remove VPIC too.</li><br />
<li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li><br />
<li>I'm pretty quite sure that other libs can be removed as well, depended on particular vtk cmake settings. You may have to experiment with it.</li><br />
</ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DIR</td><br />
<td<br />
style="width: 40%;">C:/VTK/vtk-5.8.0-build</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>switch it to on in case you want to debug ActiViz</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48239VTK/CSharp/ActiViz/Build2012-06-27T20:48:50Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>ActiViz.NET source</h3><br />
<p>Use git to retrieve ActiViz.NET source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 7 lines you'get the following warning:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DIR</td><br />
<td<br />
style="width: 40%;">C:/VTK/vtk-5.8.0-build</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>switch it to on in case you want to debug ActiViz</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48238VTK/CSharp/ActiViz/Build2012-06-27T20:41:13Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>ActiViz.NET source</h3><br />
<p>Use git to retrieve ActiViz.NET source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 7 lines you'get the following warning:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DIR</td><br />
<td<br />
style="width: 40%;">C:/VTK/vtk-5.8.0-build</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48220VTK/CSharp/ActiViz/Build2012-06-26T17:05:25Z<p>Jochen: added ActiViz-CMake config entry for VTK_DIR</p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>ActiViz.NET source</h3><br />
<p>Use git to retrieve ActiViz.NET source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DIR</td><br />
<td<br />
style="width: 40%;">C:/VTK/vtk-5.8.0-build</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_PolyData_ContoursFromPolyData.png&diff=48210File:VTK Examples CSharp PolyData ContoursFromPolyData.png2012-06-26T12:35:04Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_PolyData_VectorFieldNonZeroExtraction.png&diff=48193File:VTK Examples CSharp PolyData VectorFieldNonZeroExtraction.png2012-06-25T14:53:54Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_PolyData_TestShrinkPolyData.png&diff=48189File:VTK Examples CSharp PolyData TestShrinkPolyData.png2012-06-25T11:00:28Z<p>Jochen: uploaded a new version of &quot;File:VTK Examples CSharp PolyData TestShrinkPolyData.png&quot;</p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_PolyData_TestShrinkPolyData.png&diff=48188File:VTK Examples CSharp PolyData TestShrinkPolyData.png2012-06-25T10:58:35Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_ImplicitFunctions_TestMarchingSquares.png&diff=48180File:VTK Examples CSharp ImplicitFunctions TestMarchingSquares.png2012-06-25T10:25:23Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_ImplicitFunctions_TestIsoContours.png&diff=48169File:VTK Examples CSharp ImplicitFunctions TestIsoContours.png2012-06-25T08:48:01Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_vtkImageActor_With_Overlayed_Renderer.png&diff=48142File:VTK Examples CSharp vtkImageActor With Overlayed Renderer.png2012-06-24T09:11:56Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48141VTK/CSharp/ActiViz/Build2012-06-23T18:54:39Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>ActiViz.NET source</h3><br />
<p>Use git to retrieve ActiViz.NET source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz.NET&diff=48132VTK/CSharp/ActiViz.NET2012-06-22T18:57:05Z<p>Jochen: corrected section "Setup a Console Application utilizing ActiViz.NET"</p>
<hr />
<div>Visualization in C# language using VTK potential can be implemented using Activiz .NET library, which is a package containing .NET wrappers for all VTK objects.<br /><br />
Activiz .NET is Open source and [http://www.kitware.com/products/activiz.html free to download]. It's easy to install thanks to intuitive install manager, just follow its instructions.<br />
<br />
After the installation process is done, open MS Visual Studio and start existing (or create new) Windows Forms Application project. First we have to provide access to Activiz .NET library by providing library references. <br />
<br />
One of the easiest ways how to manage library references is to let [http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c NuGet Package Manager] to do it for us. (Installing an extension is only possible with the full version of Visual Studio).<br />
After installation of this extension, right click on the name of your solution in Solution Explorer and select Manage NuGet Packages for Solution. <br />
In opened dialog window you should be now able to see Kitware Activiz.NET library ready to be installed to your project. <br />
Click on the Install button, select projects of solution where to add references to and finish the process.<br />
<br />
<br />
== Installation of ActiViz.NET for Visual Studio Express Editions ==<br />
With Visual Studio Express Editions you can use ActiViz.NET as well.<br />
<br />
<h3>Setup a Windows Forms Application utilizing ActiViz.NET</h3><br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" Windows Forms Application.<br />
<h4>Your first ActiViz.NET Windows Forms Application</h4><br />
<ul><br />
<li>Create a new "Windows Forms Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll". Click OK</li><br />
<li>Open Form1.cs in Designmode and drag the RenderWindowControl from the toolbox onto your form.</li><br />
<li>For now we set the property Dock of renderWindowControl1 to Fill.</li><br />
<li>Double click on the renderWindowControl1 creates an OnLoad Event Handler named "renderWindowControl1_Load" in file Form1.cs.<br/><br />
Stay in Form1.cs and add the following "using statement" at the top of Form1.cs (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
</li><br />
<li>Go back to the body of method renderWindowControl1_Load and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// source object<br />
vtkSphereSource SphereSource = vtkSphereSource.New();<br />
SphereSource.SetRadius(0.5);<br />
// mapper<br />
vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New();<br />
SphereMapper.SetInputConnection(SphereSource.GetOutputPort());<br />
// actor<br />
vtkActor SphereActor = vtkActor.New();<br />
SphereActor.SetMapper(SphereMapper);<br />
// get a reference to the renderwindow of our renderWindowControl1<br />
vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow;<br />
// get a reference to the renderer<br />
vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer();<br />
// set background color<br />
Renderer.SetBackground(0.2, 0.3, 0.4);<br />
// add actor to the renderer<br />
Renderer.AddActor(SphereActor);<br />
// ensure all actors are visible (in this example not necessarely needed,<br />
// but in case more than one actor needs to be shown it might be a good idea)<br />
Renderer.ResetCamera();<br />
</source></li></ul><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br /><br /><br />
<br />
<h3>Setup a Console Application utilizing ActiViz.NET</h3><br />
<ul><br />
<li>There's nothing special to do. :-)</li><br />
</ul><br />
Let's start to develop a first "Hello World" console application.<br />
<br />
<h4>Your first ActiViz.NET Console Application</h4> <br />
<ul><br />
<li>Create a new "Console Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll" and "Kitware.VTK.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll" and "Kitware.VTK.dll". Click OK</li><br />
<li>Open Program.cs and add the following "using statement" at the top the file (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
</li><br />
<li>Goto the main function and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// Create a sphere<br />
vtkSphereSource sphereSource = vtkSphereSource.New();<br />
sphereSource.Update();<br />
<br />
vtkFeatureEdges featureEdges = vtkFeatureEdges.New();<br />
featureEdges.FeatureEdgesOff();<br />
featureEdges.BoundaryEdgesOn();<br />
featureEdges.NonManifoldEdgesOn();<br />
featureEdges.SetInputConnection(sphereSource.GetOutputPort());<br />
featureEdges.Update();<br />
<br />
int numberOfOpenEdges = featureEdges.GetOutput().GetNumberOfCells();<br />
<br />
if(numberOfOpenEdges > 0) {<br />
Console.WriteLine("Surface is not closed");<br />
}<br />
else {<br />
Console.WriteLine("Surface is closed");<br />
}<br />
// nothing to show graphically<br />
Console.WriteLine("\nPress any key to continue...");<br />
Console.ReadKey();<br />
</source></li></ul><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br />
<p></p><br />
== VTK/Examples/CSharp ==<br />
Here you will find examples: [[http://www.vtk.org/Wiki/VTK/Examples/CSharp ActiViz.NET examples]]<br />
<br />
<br />
== Build ActiViz.NET with Visual Studio Express C++ 2008 ==<br />
Here you will find a detailed tutorial how to build the ActiViz.NET control with Visual Studio C++ 2008:<br />
[[http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build Build ActiViz.NET with Visual Studio Express C++ 2008]]</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_Meshes_TestSubdivision.png&diff=48128File:VTK Examples CSharp Meshes TestSubdivision.png2012-06-22T15:28:12Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48109VTK/CSharp/ActiViz/Build2012-06-21T15:04:02Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk while setting HDF5_BUILD_HL_LIB to OFF remove vtkhdf5_hl too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48105VTK/CSharp/ActiViz/Build2012-06-21T12:00:23Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk without vtkhdf5_hl remove this entry too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48104VTK/CSharp/ActiViz/Build2012-06-21T11:59:04Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note:<ul><li>In case you compiled vtk in step 2 without vtkhdf5_hl remove this entry too.</li></ul></p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configuration run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48103VTK/CSharp/ActiViz/Build2012-06-21T11:56:42Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the following statement (comes right after the found line)</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note: In case you compiled vtk in step 2 without vtkhdf5_hl remove this entry too.</p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48102VTK/CSharp/ActiViz/Build2012-06-21T11:54:44Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the the following statement</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>Note: In case you compiled vtk in step 2 without vtkhdf5_hl remove this entry too.</p> <br />
<br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run. When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48101VTK/CSharp/ActiViz/Build2012-06-21T11:53:33Z<p>Jochen: added instruction to handle LsDyna:dll</p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>As a last adjustment we have to remove a reference to LsDyna.dll. Find the line</p><br />
<pre> # Add extra utility DLLs the kit DLLs depend on:<br />
</pre><br />
<p>Then '''remove LsDyna''' from the the following statement</p><br />
<pre> SET(vtkListOfDLLs ${vtkListOfDLLs}<br />
LSDyna<br />
Cosmo<br />
VPIC<br />
vtkhdf5_hl<br />
vtkalglib<br />
vtkDICOMParser<br />
vtkexoIIc<br />
vtkftgl<br />
vtkhdf5<br />
vtkmetaio<br />
vtkNetCDF<br />
vtkNetCDF_cxx<br />
vtksys<br />
vtkverdict<br />
)<br />
</pre><br />
<p>In case you compiled vtk in step 2 without vtkhdf5_hl remove this entry too.</p> <br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48100VTK/CSharp/ActiViz/Build2012-06-21T11:26:56Z<p>Jochen: corrected some misspelled words</p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell Cmake to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR} with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
"cl" is the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48099VTK/CSharp/ActiViz/Build2012-06-21T11:17:26Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the required tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line</p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>The line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right''' below''' the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>wherever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to switch it to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's all folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz.NET&diff=48098VTK/CSharp/ActiViz.NET2012-06-21T10:24:06Z<p>Jochen: added a section for console applications</p>
<hr />
<div>Visualization in C# language using VTK potential can be implemented using Activiz .NET library, which is a package containing .NET wrappers for all VTK objects.<br /><br />
Activiz .NET is Open source and [http://www.kitware.com/products/avdownload.php free to download]. It's easy to install thanks to intuitive install manager, just follow its instructions.<br />
<br />
After the installation process is done, open MS Visual Studio and start existing (or create new) Windows Forms Application project. First we have to provide access to Activiz .NET library by providing library references. <br />
<br />
One of the easiest ways how to manage library references is to let [http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c NuGet Package Manager] to do it for us. (Installing an extension is only possible with the full version of Visual Studio).<br />
After installation of this extension, right click on the name of your solution in Solution Explorer and select Manage NuGet Packages for Solution. <br />
In opened dialog window you should be now able to see Kitware Activiz.NET library ready to be installed to your project. <br />
Click on the Install button, select projects of solution where to add references to and finish the process.<br />
<br />
<br />
== Installation of ActiViz.NET for Visual Studio Express Editions ==<br />
With Visual Studio Express Editions you can use ActiViz.NET as well.<br />
<br />
<h3>Setup a Windows Forms Application utilizing ActiViz.NET</h3><br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" Windows Forms Application.<br />
<h4>Your first ActiViz.NET Windows Forms Application</h4><br />
<ul><br />
<li>Create a new "Windows Forms Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll". Click OK</li><br />
<li>Open Form1.cs in Designmode and drag the RenderWindowControl from the toolbox onto your form.</li><br />
<li>For now we set the property Dock of renderWindowControl1 to Fill.</li><br />
<li>Double click on the renderWindowControl1 creates an OnLoad Event Handler named "renderWindowControl1_Load" in file Form1.cs.<br/><br />
Stay in Form1.cs and add the following "using statement" at the top of Form1.cs (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
</li><br />
<li>Go back to the body of method renderWindowControl1_Load and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// source object<br />
vtkSphereSource SphereSource = vtkSphereSource.New();<br />
SphereSource.SetRadius(0.5);<br />
// mapper<br />
vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New();<br />
SphereMapper.SetInputConnection(SphereSource.GetOutputPort());<br />
// actor<br />
vtkActor SphereActor = vtkActor.New();<br />
SphereActor.SetMapper(SphereMapper);<br />
// get a reference to the renderwindow of our renderWindowControl1<br />
vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow;<br />
// get a reference to the renderer<br />
vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer();<br />
// set background color<br />
Renderer.SetBackground(0.2, 0.3, 0.4);<br />
// add actor to the renderer<br />
Renderer.AddActor(SphereActor);<br />
// ensure all actors are visible (in this example not necessarely needed,<br />
// but in case more than one actor needs to be shown it might be a good idea)<br />
Renderer.ResetCamera();<br />
</source></li></ul><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br /><br /><br />
<br />
<h3>Setup a Console Application utilizing ActiViz.NET</h3><br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" console application.<br />
<br />
<h4>Your first ActiViz.NET Console Application</h4> <br />
<ul><br />
<li>Create a new "Console Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll" and "Kitware.VTK.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll" and "Kitware.VTK.dll". Click OK</li><br />
<li>Open Program.cs and add the following "using statement" at the top the file (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
</li><br />
<li>Goto the main function and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// Create a sphere<br />
vtkSphereSource sphereSource = vtkSphereSource.New();<br />
sphereSource.Update();<br />
<br />
vtkFeatureEdges featureEdges = vtkFeatureEdges.New();<br />
featureEdges.FeatureEdgesOff();<br />
featureEdges.BoundaryEdgesOn();<br />
featureEdges.NonManifoldEdgesOn();<br />
featureEdges.SetInputConnection(sphereSource.GetOutputPort());<br />
featureEdges.Update();<br />
<br />
int numberOfOpenEdges = featureEdges.GetOutput().GetNumberOfCells();<br />
<br />
if(numberOfOpenEdges > 0) {<br />
Console.WriteLine("Surface is not closed");<br />
}<br />
else {<br />
Console.WriteLine("Surface is closed");<br />
}<br />
// nothing to show graphically<br />
Console.WriteLine("\nPress any key to continue...");<br />
Console.ReadKey();<br />
</source></li></ul><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br />
<p></p><br />
== VTK/Examples/CSharp ==<br />
Here you will find examples: [[http://www.vtk.org/Wiki/VTK/Examples/CSharp ActiViz.NET examples]]<br />
<br />
<br />
== Build ActiViz.NET with Visual Studio Express C++ 2008 ==<br />
Here you will find a detailed tutorial how to build the ActiViz.NET control with Visual Studio C++ 2008:<br />
[[http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build Build ActiViz.NET with Visual Studio Express C++ 2008]]</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48089VTK/CSharp/ActiViz/Build2012-06-21T06:11:40Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then here you are at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48088VTK/CSharp/ActiViz/Build2012-06-21T06:09:42Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
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 /><br />
In case you would like to build your own ActiViz.NET control from scratch then you're here at the right place.<br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48087VTK/CSharp/ActiViz/Build2012-06-21T05:39:53Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48086VTK/CSharp/ActiViz/Build2012-06-21T05:30:15Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>vtk 5.8.0 source</h3><br />
<p>you can download it from: http://www.vtk.org/VTK/resources/software.html#previous</p><br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Activiz.NET source</h3><br />
<p>Use git to retrieve mummy source code:</p><br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/activizdotnet.git</span></p><br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
IF(MSVC10)<br />
SET(gccxml_compiler "msvc10")<br />
ENDIF(MSVC10)<br />
#SET(gccxml_compiler "msvc8")<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48085VTK/CSharp/ActiViz/Build2012-06-21T05:21:36Z<p>Jochen: </p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http://www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
IF(MSVC10)<br />
SET(gccxml_compiler "msvc10")<br />
ENDIF(MSVC10)<br />
#SET(gccxml_compiler "msvc8")<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz/Build&diff=48084VTK/CSharp/ActiViz/Build2012-06-21T05:17:55Z<p>Jochen: initial creation</p>
<hr />
<div><h1>Build ActiViz.NET with Visual Studio Express C++ 2008</h1><br />
<br />
<h2>Prerequisites to build ActiViz.NET</h2><br />
<br />
<h3>CMake (the cross-platform, open-source build system)</h3><br />
<br />
<p>you can download it from: http;//www.cmake.org</p><br />
<br />
<p></p><br />
<br />
<h3>Concurrent Versions System (CVS)</h3><br />
<br />
<p>It's a command line tool required at mummy configure time because it<br />
retrieves a snapshot of CableSwig for the source code to the cable<br />
libraries.</p><br />
<br />
<p>For windows you can download it from<br />
http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip (contains<br />
nothing but a executable)</p><br />
<br />
<p>Once downloaded unzip the archive and copy the executable to a folder which<br />
is defined in the PATH environment variable.</p><br />
<br />
<p></p><br />
<br />
<h3>Git client</h3><br />
<br />
<p>A git client is needed to download the latest mummy and ActiViz sources.</p><br />
<br />
<p>you can download it from: http://msysgit.github.com/</p><br />
<br />
<p></p><br />
<br />
<h3>Source control software (SVN)</h3><br />
<br />
<p>(I'm not sure whether it's really necessary because I had it installed<br />
already and never tried to build vtk and ActiViz without svn.exe). You probably<br />
get an error message or a warning in case it will be necessary.</p><br />
<br />
<p>you can download it from: http://tortoisesvn.net/</p><br />
<br />
<p>Make sure you install the command line client tools during setup</p><br />
<br />
<p></p><br />
<br />
<h3>Python</h3><br />
<br />
<p>Python is required at ActiViz .NET build time to convert VTK tcl tests to<br />
C#.</p><br />
<br />
<p>you can download it from: http://www.python.org/getit/windows/</p><br />
<br />
<p></p><br />
<br />
<h3>XML output extension to the C++ front-end of GCC</h3><br />
<br />
<p>Check out the latest develop version:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML login</span></p><br />
<br />
<p>(just press enter when prompted for a password)</p><br />
<br />
<p>Follow this command by checking out the source code:</p><br />
<br />
<p><span style="font-style: italic;">cvs -d:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML co gccxml </span></p><br />
<br />
<p></p><br />
<br />
<h3>mummy</h3><br />
<br />
<p>Needed to wrap unmanaged c++ dlls with managed dlls.</p><br />
<br />
<p>Use git to retrieve mummy source code:</p><br />
<br />
<p><span style="font-style: italic;">git clone git://public.kitware.com/mummy.git</span></p><br />
<br />
<p></p><br />
<br />
<h3>Visual Studio 2005 or 2008 (gccxml does not yet work with Visual Studio 2010)</h3><br />
<br />
<p></p><br />
<br />
<h3>A signing key to produce "strong name signed" .NET Framework<br />
binaries.</h3><br />
<br />
<p>If you don't have your own strong name signing key, you can disable strong<br />
name validation on the machine that you want to build and test it on. However,<br />
to install your unsigned build on another machine, they will also have to<br />
disable strong name validation. It's a good idea to sign your .NET binaries if<br />
you're going to be re-distributing them.</p><br />
<br />
<p></p><br />
<br />
<h3>Documentation tools</h3><br />
<br />
<h4>Doxygen</h4><br />
<br />
<p>you can download it from: http://www.stack.nl/~dimitri/doxygen/</p><br />
<br />
<h4>GraphViz</h4><br />
<br />
<p>you can download it from: http://www.graphviz.org/</p><br />
<br />
<p></p><br />
<br />
<h3>Directory structure</h3><br />
<br />
<p>This directory structure is only intended as a suggestion:</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_FolderStructure.png]]<br />
</p><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build vtk</h2><br />
<br />
<p>Define where to search for the source code of vtk and where to build the binaries for vtk.</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake01.png]]<br />
</p><br />
<br />
<p>Click Configure. In the following dialog choose the compiler. Select for<br />
instance Visual Studio 9 2008. Note: If you want to build ActiViz with Visual<br />
Studio choose either Visual Studio 8 2005 or Visual Studio 9 2008. ActiViz<br />
cannot be build with Visual Studio 10 since gccxml.exe does not yet work with Visual Studio 2010</p><br />
<br />
<p><br />
[[File:VTK_CSharp_ActiViz_Build_Cmake02.png]]<br />
</p><br />
<br />
<p>Click Finish.</p><br />
<br />
<p>Click Configure. CMake first check your compiler capabilities, then trying<br />
to find the prerequisite tools and gather other informations. This may take a<br />
while.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/VTK/VTK-5.8.0-install</td><br />
<td>where binaries are installed</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 30%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 30%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 30%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata</td><br />
<td>needed for final tests</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_LARGE_DATA_ROOT</td><br />
<td style="width: 30%;">C:/VTK/vtkdata/VTKLargeData</td><br />
<td>not necessarely needed</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable following entries</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_SHARED_LIBS</td><br />
<td style="width: 30%;">ON</td><br />
<td>necessary</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">VTK_USE_PARALLEL</td><br />
<td style="width: 30%;">ON</td><br />
<td>needed for ActiViz (it needs VPIC.dll, which is only being build when<br />
VTK_USE_PARALLEL is checked)</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">BUILD_DOCUMENTATION</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_EXAMPLES</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 30%;">ON</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">HDF5_BUILD_HL_LIB</td><br />
<td style="width: 30%;">ON</td><br />
<td>not necessarely needed, but then you must change a line in cmakelist.txt when building ActiViz</td><br />
</tr><br />
</table><br />
<br />
<p>Click Configure again.</p><br />
<br />
<p>After this Configure run only one line should be marked in red color<br />
anymore</p><br />
<br />
<p>VTK_USE_MPI</p><br />
<br />
<p>If MPI isn't installed on your machine or you just don't want to use it<br />
leave this entry unchecked, and click Configure again.</p><br />
<br />
<p>In case everything seems to be configured properly (nothing is marked in<br />
red) click Generate.</p><br />
<br />
<p>Now goto your build folder (in this example c:\vtk\vtk-5.8.0-build) and open<br />
<strong>VTK.sln</strong> with Visual Studio C++ 2008. Select Release as your<br />
solution configuration, in solution explorer right click on ALL_BUILD and<br />
choose Build. Relax and take a cup of tea or coffee. The build process may take<br />
a while.</p><br />
<br />
<p>When the build has been successful you should find the following dlls in<br />
your bin folder (for this example c:\vtk\vtk-5.8.0-build\bin\Release):</p><br />
<br />
<pre>Cosmo.dll<br />
MapReduceMPI.dll<br />
mpistubs.dll<br />
VPIC.dll<br />
vtkalglib.dll<br />
vtkCharts.dll<br />
vtkCommon.dll<br />
vtkDICOMParser.dll<br />
vtkexoIIc.dll<br />
vtkexpat.dll<br />
vtkFiltering.dll<br />
vtkfreetype.dll<br />
vtkftgl.dll<br />
vtkGenericFiltering.dll<br />
vtkGeovis.dll<br />
vtkGraphics.dll<br />
vtkhdf5.dll<br />
vtkhdf5_hl.dll<br />
vtkHybrid.dll<br />
vtkImaging.dll<br />
vtkInfovis.dll<br />
vtkIO.dll<br />
vtkjpeg.dll<br />
vtklibxml2.dll<br />
vtkmetaio.dll<br />
vtkNetCDF.dll<br />
vtkNetCDF_cxx.dll<br />
vtkParallel.dll<br />
vtkpng.dll<br />
vtkproj4.dll<br />
vtkRendering.dll<br />
vtksys.dll<br />
vtktiff.dll<br />
vtkverdict.dll<br />
vtkViews.dll<br />
vtkVolumeRendering.dll<br />
vtkWidgets.dll<br />
vtkzlib.dll</pre><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build gccxml</h2><br />
<br />
<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><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">CMAKE_INSTALL_PREFIX</td><br />
<td style="width: 30%;">C:/Program Files/gccxml</td><br />
<td></td><br />
</tr><br />
</table><br />
<br />
<p>Click Generate.</p><br />
<br />
<p>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.</p><br />
<br />
<p>After the binaries have been build right click on INSTALL in solution explorer to install the binaries into the folder you've defined above.</p><br />
<br />
<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<br />
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><br />
<br />
<p></p><br />
<p></p><br />
<br />
<h2>Configure and build Mummy</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.mummy.Runtime.snk).</p><br />
<br />
<p>Now that we have a signing key we must tell our compiler to use this key and<br />
where to find it. Insert the following statement into<br />
<strong>cmakelist.txt</strong>, located in the root of your mummy source folder<br />
(on my machine it's located at c:\VTK\ActiViz\mummy\cmakelist.txt):</p><br />
<p><span style="font-family: Courier New,Courier,monospace; font-size: smaller;"><pre>GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Runtime/jk.mummy.Runtime.snk" ABSOLUTE)</pre></span></p><br />
<br />
<p>Make sure the snk file can be found at this location.</p><br />
<br />
<p>During the configuration run you may want to verify the content of<br />
${CMAKE_CURRENT_SOURCE_DIR}with the following line in cmakelist.txt:</p><br />
<pre>Message(STATUS "current source dir : '${CMAKE_CURRENT_SOURCE_DIR}'...")</pre><br />
<br />
<p>Also you may ask yourself where to enter these statements in cmakelist.txt.<br />
Somewhere between the definition of ${CMAKE_CURRENT_SOURCE_DIR} and first usage<br />
of ${Mummy_SNKEYFILE}.<br /> I put it right before the line </p><br />
<pre># Echo selected CMake/configuration settings:</pre><br />
<br />
<p>This line can be found near line # 140.</p><br />
<br />
<p>This configuration should be good enough to build <strong>Kitware.mummy.Runtime.dll</strong> and<br />
<strong>Kitware.mummy.Runtime.Unmanaged.dll</strong> successful, which in fact are the only two files we will need for ActiViz to work properly.</p><br />
<br />
<p>In case you want the mummy-examples to be build successful as well you must<br />
</p><br />
<br />
<p>1. add some more lines to cmakelist.txt:</p><br />
<pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
IF(MSVC10)<br />
SET(gccxml_compiler "msvc10")<br />
ENDIF(MSVC10)<br />
#SET(gccxml_compiler "msvc8")<br />
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
<br />
<p>Note:</p><br />
<ul><br />
<li>gccxml don't understand <strong>cl</strong> as the compiler name, but<br />
that's the content of ${CMAKE_CXX_COMPILER}.<br /><br />
If you ommit the first 10 lines you'get the following error message:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;"><br />
Compiler "cl" specified, but more than one of MSVC 6, 7, 7.1, 8, 9, and 10 are installed.<br /><br />
Please specify "msvc6", "msvc7", "msvc71", "msvc8", "msvc8ex", "msvc9", or "msvc10" for the GCCXML_COMPILER setting.<br /><br />
Using MSVC 9 because it was used to build GCC-XML.</span><br />
</li><br />
<li>If you ommit the last line you'll get a bunch of following nice error messages:<br /><br />
<span style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program Files/Microsoft Visual Studio 9.0/VC/include/xxresult:102: error: redefinition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(), _Farg0&amp;&gt;'</span><br /><br />
<span<br />
style="font-family: Courier New,Courier,monospace; font-size: small;">C:/Program<br />
Files/Microsoft Visual Studio 9.0/VC/include/xxresult:94: error: previous<br />
definition of 'struct std::tr1::_Result_of1&lt;_Rx (_Arg0::*)(),<br />
_Farg0&amp;&gt;'</span><br /><br />
</li><br />
</ul><br />
<br />
<p></p><br />
<p>2. edit another cmakelist.txt in mummys subfolder <strong>Examples\Vehicles\wrappers\csharpmummy</strong>:</p><br />
<br />
<p>Find the following paragraph (near line # 82):<strong></strong></p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${CMAKE_CXX_COMPILER}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<p>and replace it with:</p><br />
<pre>ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${<strong>gccxml_compiler</strong>}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
-D${GCCXML_EXTRA_D_ARGS}<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header_fullpath}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
<br />
<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><br />
<br />
<p>Note: </p><br />
<ul><br />
<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><br />
</ul><br />
<ul><br />
<li>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.</li><br />
</ul><br />
<p></p><br />
<p></p><br />
<h2>Configure and build ActiViz.NET</h2><br />
<br />
<p>First of all you should create a signing key to produce "strong name signed"<br />
.NET Framework binaries. Assuming Windows SDK is installed, open a windows sdk<br />
prompt, and type </p><br />
<br />
<p><span style="font-style: italic;">sn -k WhateverNameYouWant.snk</span> </p><br />
<br />
<p>(for instance: jk.VTK.snk).</p><br />
<br />
<p>Caution: You cannot use the same signing key file used for mummy!</p><br />
<br />
<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><br />
<br />
<p><pre>IF(NOT DEFINED AVDN_SNKEYFILE)<br />
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)<br />
ENDIF(NOT DEFINED AVDN_SNKEYFILE)</pre><br />
</p><br />
<br />
<p>and insert the following line <strong>above</strong> the found paragraph:</p><br />
<br />
<p><pre>GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/jk.VTK.snk" ABSOLUTE)</pre><br />
</p><br />
<br />
<p>Don't forget to replace <em>jk.VTK.snk</em> with the name of your snk file<br />
and ensure your snk file can be found at this location.</p><br />
<br />
<p>Again we must make some adjustments to the gccxml command. Search the<br />
following paragraph:</p><br />
<br />
<p><pre>SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")<br />
IF(MSVC80)<br />
SET(gccxml_compiler "msvc8")<br />
ENDIF(MSVC80)<br />
IF(MSVC90)<br />
SET(gccxml_compiler "msvc9")<br />
ENDIF(MSVC90)<br />
MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")</pre><br />
</p><br />
<br />
<p>Insert the following line right below the found paragraph:</p><br />
<br />
<p><pre>SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")</pre><br />
</p><br />
<br />
<p>Now find the following paragraph:</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>and replace it with (changes in bold):</p><br />
<br />
<p><pre> ADD_CUSTOM_COMMAND(<br />
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
COMMAND ${gccxml_EXECUTABLE}<br />
ARGS<br />
-fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml<br />
-fxml-start=_cable_<br />
${gccxml_include_args} -DCABLE_CONFIGURATION<br />
--gccxml-compiler ${gccxml_compiler}<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
<strong>-D${GCCXML_EXTRA_D_ARGS}</strong><br />
DEPENDS<br />
${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx<br />
${header}<br />
${gccxml_EXECUTABLE}<br />
)</pre><br />
</p><br />
<br />
<p>Okay, now we are ready to perform our first CMake configure run.</p><br />
<br />
<p>When finished you see a bunch of entries.</p><br />
<br />
<p></p><br />
<br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Verify and adjust following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_INSTALL_PREFIX</td><br />
<td style="width: 40%;">c:/VTK/ActiViz/activiz-install</td><br />
<td>where binaries are installed during the INSTALL build</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">GITCOMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/git.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">PYTHON_EXECTUABLE</td><br />
<td style="width: 40%;">C:/Program Files/Python26/python.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SPC_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/Git/bin/scp.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">SVN_COMMAND</td><br />
<td style="width: 40%;">C:/Program Files/TortoiseSVN/bin/svn.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">CVSCOMMAND</td><br />
<td style="width: 40%;">C:/Windows/cvs.exe</td><br />
<td>whereever you copied cvs.exe to (folder must be set in environment<br />
variable PATH)</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">gccxml_EXECUTABLE</td><br />
<td style="width: 40%;">C:/Program Files/gccxml/bin/gccxml.exe</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_DIR</td><br />
<td style="width: 40%;">C:/VTK/ActiViz/mummy-build/share/mummy-1.0.2</td><br />
<td></td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">mummy_EXECUTABLE</td><br />
<td<br />
style="width: 40%;">C:/VTK/ActiViz/mummy-build/bin/Release/mummy.exe</td><br />
<td></td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>Enable/Disable following entries</caption><br />
<tr><br />
<td style="width: 25%;">AVDN_BUILD_CSHARP_DEBUG</td><br />
<td style="width: 40%;">OFF</td><br />
<td>I've never tried to set in to ON (feel free to try out)</td><br />
</tr><br />
</table><br />
<p></p><br />
<table border="1" style="width: 100%; margin-top: 25px;"><br />
<caption>useful settings, but not necessarely needed</caption><br />
<tr><br />
<td style="width: 25%;">GENERATE_DOXYGEN</td><br />
<td style="width: 40%;">ON</td><br />
<td>create doxygen documentation</td><br />
</tr><br />
<tr><br />
<td style="width: 25%;">BUILD_TESTING</td><br />
<td style="width: 40%;">ON</td><br />
<td>create test applications</td><br />
</tr><br />
</table><br />
<br />
<p></p><br />
<br />
<p>Configure and generate.</p><br />
<br />
<p>Goto to your Build folder and open ActiVizDotNet.sln with Visual Studio C++<br />
2008. Select Release as your solution configuration, in solution explorer right<br />
click on ALL_BUILD and choose Build. After the binaries have been build right<br />
click on INSTALL in solution explorer to install the binaries into the folder<br />
you've defined above.</p><br />
<br />
<p>That's it folks.</p></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_CSharp_ActiViz_Build_FolderStructure.png&diff=48083File:VTK CSharp ActiViz Build FolderStructure.png2012-06-21T05:03:44Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_CSharp_ActiViz_Build_Cmake02.png&diff=48082File:VTK CSharp ActiViz Build Cmake02.png2012-06-21T05:02:54Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_CSharp_ActiViz_Build_Cmake01.png&diff=48081File:VTK CSharp ActiViz Build Cmake01.png2012-06-21T05:02:23Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz.NET&diff=48080VTK/CSharp/ActiViz.NET2012-06-21T04:12:33Z<p>Jochen: /* Build ActiViz.NET with Visual Studio Express C++ 2008 */</p>
<hr />
<div>Visualization in C# language using VTK potential can be implemented using Activiz .NET library, which is a package containing .NET wrappers for all VTK objects.<br /><br />
Activiz .NET is Open source and [http://www.kitware.com/products/avdownload.php free to download]. It's easy to install thanks to intuitive install manager, just follow its instructions.<br />
<br />
After the installation process is done, open MS Visual Studio and start existing (or create new) Windows Forms Application project. First we have to provide access to Activiz .NET library by providing library references. <br />
<br />
One of the easiest ways how to manage library references is to let [http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c NuGet Package Manager] to do it for us. (Installing an extension is only possible with the full version of Visual Studio).<br />
After installation of this extension, right click on the name of your solution in Solution Explorer and select Manage NuGet Packages for Solution. <br />
In opened dialog window you should be now able to see Kitware Activiz.NET library ready to be installed to your project. <br />
Click on the Install button, select projects of solution where to add references to and finish the process.<br />
<br />
<br />
== Installation of ActiViz.NET for Visual Studio Express Editions ==<br />
With Visual Studio Express Editions you can use ActiViz.NET as well. <br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" application.<br />
<br />
<br />
== Your first ActiViz.NET application ==<br />
<ul><br />
<li>Create a new "Windows Forms Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll". Click OK</li><br />
<li>Open Form1.cs in Designmode and drag the RenderWindowControl from the toolbox onto your form.</li><br />
<li>For now we set the property Dock of renderWindowControl1 to Fill.</li><br />
<li>Double click on the renderWindowControl1 creates an OnLoad Event Handler named "renderWindowControl1_Load" in file Form1.cs.<br/><br />
Stay in Form1.cs and add the following "using statement" at the top of Form1.cs (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
<li>Go back to the body of method renderWindowControl1_Load and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// source object<br />
vtkSphereSource SphereSource = vtkSphereSource.New();<br />
SphereSource.SetRadius(0.5);<br />
// mapper<br />
vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New();<br />
SphereMapper.SetInputConnection(SphereSource.GetOutputPort());<br />
// actor<br />
vtkActor SphereActor = vtkActor.New();<br />
SphereActor.SetMapper(SphereMapper);<br />
// get a reference to the renderwindow of our renderWindowControl1<br />
vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow;<br />
// get a reference to the renderer<br />
vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer();<br />
// set background color<br />
Renderer.SetBackground(0.2, 0.3, 0.4);<br />
// add actor to the renderer<br />
Renderer.AddActor(SphereActor);<br />
// ensure all actors are visible (in this example not necessarely needed,<br />
// but in case more than one actor needs to be shown it might be a good idea)<br />
Renderer.ResetCamera();<br />
</source><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br /><br /><br />
<br />
<br />
== VTK/Examples/CSharp ==<br />
Here you will find examples: [[http://www.vtk.org/Wiki/VTK/Examples/CSharp ActiViz.NET examples]]<br />
<br />
<br />
== Build ActiViz.NET with Visual Studio Express C++ 2008 ==<br />
Here you will find a detailed tutorial how to build the ActiViz.NET control with Visual Studio C++ 2008:<br />
[[http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build Build ActiViz.NET with Visual Studio Express C++ 2008]]</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz.NET&diff=48079VTK/CSharp/ActiViz.NET2012-06-21T04:03:22Z<p>Jochen: /* Build ActiViz.NET with Visual Studio Express C++ 2008 */</p>
<hr />
<div>Visualization in C# language using VTK potential can be implemented using Activiz .NET library, which is a package containing .NET wrappers for all VTK objects.<br /><br />
Activiz .NET is Open source and [http://www.kitware.com/products/avdownload.php free to download]. It's easy to install thanks to intuitive install manager, just follow its instructions.<br />
<br />
After the installation process is done, open MS Visual Studio and start existing (or create new) Windows Forms Application project. First we have to provide access to Activiz .NET library by providing library references. <br />
<br />
One of the easiest ways how to manage library references is to let [http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c NuGet Package Manager] to do it for us. (Installing an extension is only possible with the full version of Visual Studio).<br />
After installation of this extension, right click on the name of your solution in Solution Explorer and select Manage NuGet Packages for Solution. <br />
In opened dialog window you should be now able to see Kitware Activiz.NET library ready to be installed to your project. <br />
Click on the Install button, select projects of solution where to add references to and finish the process.<br />
<br />
<br />
== Installation of ActiViz.NET for Visual Studio Express Editions ==<br />
With Visual Studio Express Editions you can use ActiViz.NET as well. <br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" application.<br />
<br />
<br />
== Your first ActiViz.NET application ==<br />
<ul><br />
<li>Create a new "Windows Forms Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll". Click OK</li><br />
<li>Open Form1.cs in Designmode and drag the RenderWindowControl from the toolbox onto your form.</li><br />
<li>For now we set the property Dock of renderWindowControl1 to Fill.</li><br />
<li>Double click on the renderWindowControl1 creates an OnLoad Event Handler named "renderWindowControl1_Load" in file Form1.cs.<br/><br />
Stay in Form1.cs and add the following "using statement" at the top of Form1.cs (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
<li>Go back to the body of method renderWindowControl1_Load and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// source object<br />
vtkSphereSource SphereSource = vtkSphereSource.New();<br />
SphereSource.SetRadius(0.5);<br />
// mapper<br />
vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New();<br />
SphereMapper.SetInputConnection(SphereSource.GetOutputPort());<br />
// actor<br />
vtkActor SphereActor = vtkActor.New();<br />
SphereActor.SetMapper(SphereMapper);<br />
// get a reference to the renderwindow of our renderWindowControl1<br />
vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow;<br />
// get a reference to the renderer<br />
vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer();<br />
// set background color<br />
Renderer.SetBackground(0.2, 0.3, 0.4);<br />
// add actor to the renderer<br />
Renderer.AddActor(SphereActor);<br />
// ensure all actors are visible (in this example not necessarely needed,<br />
// but in case more than one actor needs to be shown it might be a good idea)<br />
Renderer.ResetCamera();<br />
</source><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br /><br /><br />
<br />
<br />
== VTK/Examples/CSharp ==<br />
Here you will find examples: [[http://www.vtk.org/Wiki/VTK/Examples/CSharp ActiViz.NET examples]]<br />
<br />
<br />
== Build ActiViz.NET with Visual Studio Express C++ 2008 ==<br />
Here you will find a detailed tutorial how to build the ActiViz.NET control with Visual Studio C++ 2008:<br />
[[http://www.vtk.org/Wiki/VTK/BuildActiViz Build ActiViz.NET with Visual Studio Express C++ 2008]]</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=VTK/CSharp/ActiViz.NET&diff=48078VTK/CSharp/ActiViz.NET2012-06-21T03:59:56Z<p>Jochen: added a link to a tutorial on how to build ActiViz.NET with VS C++ 2008</p>
<hr />
<div>Visualization in C# language using VTK potential can be implemented using Activiz .NET library, which is a package containing .NET wrappers for all VTK objects.<br /><br />
Activiz .NET is Open source and [http://www.kitware.com/products/avdownload.php free to download]. It's easy to install thanks to intuitive install manager, just follow its instructions.<br />
<br />
After the installation process is done, open MS Visual Studio and start existing (or create new) Windows Forms Application project. First we have to provide access to Activiz .NET library by providing library references. <br />
<br />
One of the easiest ways how to manage library references is to let [http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c NuGet Package Manager] to do it for us. (Installing an extension is only possible with the full version of Visual Studio).<br />
After installation of this extension, right click on the name of your solution in Solution Explorer and select Manage NuGet Packages for Solution. <br />
In opened dialog window you should be now able to see Kitware Activiz.NET library ready to be installed to your project. <br />
Click on the Install button, select projects of solution where to add references to and finish the process.<br />
<br />
<br />
== Installation of ActiViz.NET for Visual Studio Express Editions ==<br />
With Visual Studio Express Editions you can use ActiViz.NET as well. <br />
<ul><br />
<li>Having ActiViz.NET installed, open Visual Studio, goto Toolbox,<br />
right click on any tab and invoke "Add tab" to add a new panel and give it a name (e.g. "VTK 5.8 ActiViz.NET").</li><br />
<br />
<li>Then invoke "Choose Items..." and in the following dialog click on button "Browse...", navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.VTK.dll".<br /><br />
Click OK. Now you should see in your ToolBox a new control named RenderWindowControl.</li><br />
</ul><br />
Let's start to develop a first "Hello World" application.<br />
<br />
<br />
== Your first ActiViz.NET application ==<br />
<ul><br />
<li>Create a new "Windows Forms Application" project.</li><br />
<li>Add a reference to "Kitware.mummy.Runtime.dll":<br />In your Solution Explorer, right click "References" and choose "Add reference...", click Browse tab, navigate to your ActiViz.NET installation folder, browse to /bin folder, select "Kitware.mummy.Runtime.dll". Click OK</li><br />
<li>Open Form1.cs in Designmode and drag the RenderWindowControl from the toolbox onto your form.</li><br />
<li>For now we set the property Dock of renderWindowControl1 to Fill.</li><br />
<li>Double click on the renderWindowControl1 creates an OnLoad Event Handler named "renderWindowControl1_Load" in file Form1.cs.<br/><br />
Stay in Form1.cs and add the following "using statement" at the top of Form1.cs (comparable with an #include statement for those of you coming from a c/c++ background):<br /><br />
<source lang="csharp"><br />
using Kitware.VTK;<br />
</source><br />
<li>Go back to the body of method renderWindowControl1_Load and enter the following code snippet:<br /><br />
<source lang="csharp"><br />
// source object<br />
vtkSphereSource SphereSource = vtkSphereSource.New();<br />
SphereSource.SetRadius(0.5);<br />
// mapper<br />
vtkPolyDataMapper SphereMapper = vtkPolyDataMapper.New();<br />
SphereMapper.SetInputConnection(SphereSource.GetOutputPort());<br />
// actor<br />
vtkActor SphereActor = vtkActor.New();<br />
SphereActor.SetMapper(SphereMapper);<br />
// get a reference to the renderwindow of our renderWindowControl1<br />
vtkRenderWindow RenderWindow = renderWindowControl1.RenderWindow;<br />
// get a reference to the renderer<br />
vtkRenderer Renderer = RenderWindow.GetRenderers().GetFirstRenderer();<br />
// set background color<br />
Renderer.SetBackground(0.2, 0.3, 0.4);<br />
// add actor to the renderer<br />
Renderer.AddActor(SphereActor);<br />
// ensure all actors are visible (in this example not necessarely needed,<br />
// but in case more than one actor needs to be shown it might be a good idea)<br />
Renderer.ResetCamera();<br />
</source><br />
<br />
That's it.<br /><br />
Press F5 to run the application.<br /><br /><br />
<br />
<br />
== VTK/Examples/CSharp ==<br />
Here you will find examples: [[http://www.vtk.org/Wiki/VTK/Examples/CSharp ActiViz.NET examples]]<br />
<br />
<br />
== Build ActiViz.NET with Visual Studio Express C++ 2008 ==<br />
Here you will find a detailed tutorial how to build the ActiViz.NET control with Visual Studio C++ 2008</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_StandardFormats_Input_DicomTestImages.zip&diff=47859File:VTK Examples StandardFormats Input DicomTestImages.zip2012-06-13T11:05:51Z<p>Jochen: </p>
<hr />
<div>dicom test images serie ( 20 slices, 256*256 pixel, Bitdepth: 16, Color: grayscale )</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_StandardFormats_Input_DicomTestImages.zip&diff=47858File:VTK Examples StandardFormats Input DicomTestImages.zip2012-06-13T10:49:07Z<p>Jochen: uploaded a new version of &quot;File:VTK Examples StandardFormats Input DicomTestImages.zip&quot;: new, legal dicom images series with proper metadata</p>
<hr />
<div>dicom test images serie ( 40 slices )</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_Meshes_MatrixMathFilter.png&diff=47742File:VTK Examples CSharp Meshes MatrixMathFilter.png2012-06-12T04:31:36Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_ParametricObjects_Demo.png&diff=47734File:VTK Examples CSharp ParametricObjects Demo.png2012-06-12T03:32:49Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Demo.png&diff=47722File:VTK Examples CSharp GeometricObjects Demo.png2012-06-11T23:52:51Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Polygon.png&diff=47706File:VTK Examples CSharp GeometricObjects Polygon.png2012-06-11T21:58:55Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Cylinder.png&diff=47693File:VTK Examples CSharp GeometricObjects Cylinder.png2012-06-11T21:29:32Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Cube.png&diff=47691File:VTK Examples CSharp GeometricObjects Cube.png2012-06-11T21:25:22Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_ColoredLines.png&diff=47688File:VTK Examples CSharp GeometricObjects ColoredLines.png2012-06-11T21:17:03Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Axes.png&diff=47685File:VTK Examples CSharp GeometricObjects Axes.png2012-06-11T21:11:04Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_CSharp_GeometricObjects_Arrow.png&diff=47683File:VTK Examples CSharp GeometricObjects Arrow.png2012-06-11T21:04:38Z<p>Jochen: </p>
<hr />
<div></div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_Baseline_IO_TestWriteJPEG.png&diff=47675File:VTK Examples Baseline IO TestWriteJPEG.png2012-06-11T20:37:07Z<p>Jochen: produced with TestWriteJPEG.cxx or TestWriteJPEG.cs</p>
<hr />
<div>produced with TestWriteJPEG.cxx or TestWriteJPEG.cs</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_Baseline_IO_TestWriteBMP.png&diff=47673File:VTK Examples Baseline IO TestWriteBMP.png2012-06-11T20:31:27Z<p>Jochen: BMP produced with TestWriteBmp.cxx, TestWriteBmp.cs</p>
<hr />
<div>BMP produced with TestWriteBmp.cxx, TestWriteBmp.cs</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_Baseline_IO_TestMetaImageReader.png&diff=47656File:VTK Examples Baseline IO TestMetaImageReader.png2012-06-11T03:32:01Z<p>Jochen: uploaded a new version of &quot;File:VTK Examples Baseline IO TestMetaImageReader.png&quot;: rotated (180 degree)</p>
<hr />
<div>New baseline added</div>Jochenhttps://public.kitware.com/Wiki/index.php?title=File:VTK_Examples_Baseline_IO_TestReadPNM.png&diff=47653File:VTK Examples Baseline IO TestReadPNM.png2012-06-11T03:24:57Z<p>Jochen: uploaded a new version of &quot;File:VTK Examples Baseline IO TestReadPNM.png&quot;: resized to fit the layout</p>
<hr />
<div>New baseline added</div>Jochen