[vtkusers] Problem building Activiz.NET wrappers

Eric E. Monson emonson at cs.duke.edu
Tue Mar 1 10:08:59 EST 2011


Hey Mathieu,

I finally got it to work after having overlooked that Kitware supplies a public key in the root directory of both mummy/ and activizdotnet/. So, the way it's set up by default the dlls get delay-signed by this public key. The CMakeLists.txt files are set up to see whether you've set a value for AVDN_SNKEYFILE, and if not, it loads the Kitware public one and uses that:

# If a real strong name signing keyfile has not been predefined,
# then use the public key file in the source tree to /delaysign
# .NET assemblies...
#
IF(NOT DEFINED AVDN_SNKEYFILE)
  GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)
ENDIF(NOT DEFINED AVDN_SNKEYFILE)
MESSAGE(STATUS "AVDN_SNKEYFILE='${AVDN_SNKEYFILE}'")

I generated my own keypair by running (in a Windows SDK v7.0 CMD Shell):

sn -k EMonsonVTKKeyPair.snk

and placed a copy of that file in the root source directory of both mummy and activizdotnet. For now I just added this section above the former one in the CMakeLists.txt files:

# Defining own keypair here...
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/EMonsonVTKKeyPair.snk" ABSOLUTE)

As far as I can tell it's working now. I didn't do extensive testing, but I was able to run one of the examples that wouldn't run before. 

I think it would be better to change the CMakeLists.txt files so that there was a real CMake option for setting that AVDN_SNKEYFILE variable during config – maybe that will get changed sometime... It would also be nice to have a real option, if testing is turned off, for not converting the Tcl tests.

Talk to you later,
-Eric


On Feb 28, 2011, at 11:04 AM, Eric E. Monson wrote:

> I'm hoping to get back to that later today. It would be nice to know how Kitware signs their dlls. It looks like they must do it after the dlls are built, maybe with the Assembly Linker, rather than as part of the build process since the csharp AssemblyInfo.cs files don't contain an assembly key file attribute. It seems like it could be made part of the CMake setup to point to the key file and then have it automatically inserted into the correct spots so the assemblies get signed during the build. (But, I barely know what I'm talking about, so don't put too much weight on this yet... :)
> 
> I'll let you know if I get it to work,
> -Eric
> 
> 
> On Feb 28, 2011, at 3:43 AM, Mathieu Malaterre wrote:
> 
>> I am also looking into that signing thing on linux ! Could you share
>> your findings ? For some reason the final dll does not seems to be
>> signed (according to gacutil)
>> 
>> Thanks
>> 
>> On Fri, Feb 25, 2011 at 9:42 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>>> Hey Mathieu,
>>> 
>>> Thanks a lot -- that seems to have done the trick!
>>> 
>>> I'm still trying to figure out the signing stuff so I can actually use the libs, but at least it finished building with no errors...
>>> 
>>> Talk to you later,
>>> -Eric
>>> 
>>> 
>>> On Feb 25, 2011, at 9:04 AM, Mathieu Malaterre wrote:
>>> 
>>>> I have not tried. But I would just remove the class from the wrapping,
>>>> simply select this var in cmake:
>>>> 
>>>> AVDN_EXTRA_EXCLUDE_CLASSES_XML
>>>> 
>>>> And add vtkComputingResources
>>>> 
>>>> HTH
>>>> 
>>>> On Fri, Feb 25, 2011 at 2:57 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>>>>> Hey all,
>>>>> 
>>>>> Yesterday I tried for the first time to build the Activiz.NET wrappers from VTK git master. I got pretty far, but hit a problem at some point in building Kitware.VTK: when compiling vtkComputingResources.cs, "The type or namespace name 'vtkProcessingUnitResource' could not be found".
>>>>> 
>>>>> I'm using VS2008 on Win7 64-bit, but building everything as 32-bit Release mode. Build for VTK went fine. I think the only non-default settings I used were turning ON BUILD_SHARED_LIBS and VTK_USE_PARALLEL (the latter I only figured out when activizdotnet needed VPIC.dll and couldn't find it -- someone should make a note on the instructions page that that VTK_USE_PARALLEL should be ON) and turned OFF BUILD_TESTING and BUILD_EXAMPLES. Builds of gccxml and mummy went fine.
>>>>> 
>>>>> Anyone have any ideas about what could be getting in the way of C# knowing about vtkProcessingUnitResource? Unfortunately, I don't understand enough about the wrapping process or C# compilation to debug it.
>>>>> 
>>>>> Thanks,
>>>>> -Eric
>>>>> 
>>>>> ------------------------------------------------------
>>>>> Eric E Monson
>>>>> Duke Visualization Technology Group
>>>>> 
>>>>> 
>>>>> 18>Building C# library 'Kitware.VTK'...
>>>>> 18>Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.4926
>>>>> 18>for Microsoft (R) .NET Framework version 3.5
>>>>> 18>Copyright (C) Microsoft Corporation. All rights reserved.
>>>>> 18>warning CS1668: Invalid search path 'c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\lib\i386' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
>>>>> 18>warning CS1668: Invalid search path 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
>>>>> 18>csharp\vtkComputingResources.cs(157,11): error CS0246: The type or namespace name 'vtkProcessingUnitResource' could not be found (are you missing a using directive or an assembly reference?)
>>>>> 18>Project : error PRJ0019: A tool returned an error code from "Building C# library 'Kitware.VTK'..."
>>>>> 18>Build log was saved at "file://c:\Users\emonson\Programming\VTK_git\activizdotnet\build2\Kitware.VTK.dir\Release\BuildLog.htm"
>>>>> 18>Kitware.VTK - 2 error(s), 0 warning(s)
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>> 
>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>> 
>>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>> 
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>> 
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Mathieu
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Mathieu
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list