[Insight-developers] SimpleITK dashboard

Dan Mueller dan.muel at gmail.com
Wed Jul 27 16:01:22 EDT 2011


Hi Brad,

Found an issue which solves about 1/2 of the C# failing tests, see
diff file below/attached.

Cheers, Dan Mueller

=======================================
diff --git a/Testing/Unit/CSharpImageFilterTestTemplate.cs.in
b/Testing/Unit/CSharpImageFilterTestTemplate.cs.in
index 17f946b..c6ce58e 100644
--- a/Testing/Unit/CSharpImageFilterTestTemplate.cs.in
+++ b/Testing/Unit/CSharpImageFilterTestTemplate.cs.in
@@ -57,8 +57,7 @@ $(if parameter == "SeedList" then
                 filter.ClearSeeds();
 $(for i=1,#value do OUT=OUT .. "\
                 {\
-                int[] v = " .. value[i] .. ";\
-                VectorUInt32 idx = new VectorUInt32( v );\
+                VectorUInt32 idx = new VectorUInt32( new uint[] " ..
value[i] .. " );\
                 filter.AddSeed( idx );\
                 }\
 " end)]]
@@ -66,58 +65,39 @@ elseif dim_vec == 1 then
                 OUT=[[
                 {
                 $(if type == "bool" then
-                    OUT="Boolean"
+                    OUT="VectorBool idx = new VectorBool( new bool[]
$(if csharp_value then OUT='${csharp_value}' else OUT='${value}' end)
);"
                 elseif type == "unsigned int" then
-                    OUT="int"
-                elseif type == "unsigned long" then
-                    OUT="long"
-                elseif type == "unsigned short" then
-                    OUT="short"
-                elseif type == "uint8_t" then
-                    OUT="short"
-                elseif type == "uint16_t" then
-                    OUT="short"
-                elseif type == "uint32_t" then
-                    OUT="int"
-                elseif type == "uint64_t" then
-                    OUT="long"
-                else
-                    OUT="${type}"
-                end)[] v = $(if csharp_value then
OUT='${csharp_value}' else OUT='${value}' end);
-                $(if type == "bool" then
-                    OUT="VectorBool idx = new VectorBool( v );"
-                elseif type == "unsigned int" then
-                    OUT="VectorUInt32 idx = new VectorUInt32( v );"
+                    OUT="VectorUInt32 idx = new VectorUInt32( new
uint[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "int" then
-                    OUT="VectorInt32 idx = new VectorInt32( v );"
+                    OUT="VectorInt32 idx = new VectorInt32( new int[]
$(if csharp_value then OUT='${csharp_value}' else OUT='${value}' end)
);"
                 elseif type == "unsigned long" then
-                    OUT="VectorULong idx = new VectorULong( v );"
+                    OUT="VectorULong idx = new VectorULong( new
ulong[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "long" then
-                    OUT="VectorLong idx = new VectorLong( v );"
+                    OUT="VectorLong idx = new VectorLong( new long[]
$(if csharp_value then OUT='${csharp_value}' else OUT='${value}' end)
);"
                 elseif type == "unsigned short" then
-                    OUT="VectorUShort idx = new VectorUShort( v );"
+                    OUT="VectorUShort idx = new VectorUShort( new
ushort[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "short" then
-                    OUT="VectorShort idx = new VectorShort( v );"
+                    OUT="VectorShort idx = new VectorShort( new
short[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "float" then
-                    OUT="VectorFloat idx = new VectorFloat( v );"
+                    OUT="VectorFloat idx = new VectorFloat( new
float[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "double" then
-                    OUT="VectorDouble idx = new VectorDouble( v );"
+                    OUT="VectorDouble idx = new VectorDouble( new
double[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "uint8_t" then
-                    OUT="VectorUInt16 idx = new VectorUInt16( v );"
+                    OUT="VectorUInt8 idx = new VectorUInt8( new
byte[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "uint16_t" then
-                    OUT="VectorUInt16 idx = new VectorUInt16( v );"
+                    OUT="VectorUInt16 idx = new VectorUInt16( new
ushort[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "uint32_t" then
-                    OUT="VectorUInt32 idx = new VectorUInt32( v );"
+                    OUT="VectorUInt32 idx = new VectorUInt32( new
uint[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "uint64_t" then
-                    OUT="VectorUInt64 idx = new VectorUInt64( v );"
+                    OUT="VectorUInt64 idx = new VectorUInt64( new
ulong[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "int8_t" then
-                    OUT="VectorInt16 idx = new VectorInt16( v );"
+                    OUT="VectorInt8 idx = new VectorInt8( new sbyte[]
$(if csharp_value then OUT='${csharp_value}' else OUT='${value}' end)
);"
                 elseif type == "int16_t" then
-                    OUT="VectorInt16 idx = new VectorInt16( v );"
+                    OUT="VectorInt16 idx = new VectorInt16( new
short[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 elseif type == "int32_t" then
-                    OUT="VectorInt32 idx = new VectorInt32( v );"
+                    OUT="VectorInt32 idx = new VectorInt32( new int[]
$(if csharp_value then OUT='${csharp_value}' else OUT='${value}' end)
);"
                 elseif type == "int64_t" then
-                    OUT="VectorInt64 idx = new VectorInt63( v );"
+                    OUT="VectorInt64 idx = new VectorInt64( new
long[] $(if csharp_value then OUT='${csharp_value}' else
OUT='${value}' end) );"
                 end)
                 filter.Set${parameter}( idx );
                 }]]
diff --git a/Testing/Unit/JavaImageFilterTestTemplate.java.in
b/Testing/Unit/JavaImageFilterTestTemplate.java.in
index d3feac9..3ba7ecc 100644
--- a/Testing/Unit/JavaImageFilterTestTemplate.java.in
+++ b/Testing/Unit/JavaImageFilterTestTemplate.java.in
@@ -119,7 +119,7 @@ elseif dim_vec == 1 then
         elseif type == "int32_t" then
           OUT="VectorInt32 idx = new VectorInt32( inputA.getDimension() );"
         elseif type == "int64_t" then
-          OUT="VectorInt64 idx = new VectorInt63( inputA.getDimension() );"
+          OUT="VectorInt64 idx = new VectorInt64( inputA.getDimension() );"
         end)

         for (int i = 0; i < inputA.getDimension( ); i++) {
=======================================

On 26 July 2011 17:11, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
> Dan,
>
> Thanks for your work in getting C# to automatically build and test with SimpleITK. We have accomplished a lot getting as far as we have.
>
> To address the difficulties of getting a stable version of ITK with simpleITK we have begun migrating to a SuperBuild system. One benefit of this is that it enables us to specify a specific version of ITK to build, and then build SimpleITK against. That version is specified in ITK_TAG_COMMAND variable in the file here:
>
> https://github.com/SimpleITK/SimpleITK/blob/master/SuperBuild/External_ITKv4.cmake
>
> to use the superbuild cmake just point cmake to "SimpleITK/SuperBuild" and configure. That being said, there are still some major changes that are pending with the super build system, that should make it more configurable from the top level. Currently, you need to run the super build cmake, build, then rerun cmake on the SimpleITK-build sub-directory, to configure SimpleITK as one wishes. This does currently simplify, the problem of which version of ITK should I use.
>
> The min5.nlm system, ( non-super ) is build against the nightly ITK, which needs a pending patch to get it to compile again.
>
> Dan Blezek is in change of the mayo machines.
>
> There are a few failing tests for the C#, they all appear to have a similar problem:
>
> http://www.cdash.org/CDash/testDetails.php?test=105562409&build=1367178
>
> My guess is there is some type issue with the code generated for certain array types for the tests. Have you been able to reproduce these? I very much would like to merge this topic into master tomorrow, and it would just be awesome if there were no related failing tests.
>
> Thanks,
> Brad
>
> On Jul 26, 2011, at 10:42 AM, Dan Mueller wrote:
>
>> Hi Brad,
>>
>> The SimpleITK dashboard is looking good this morning :D (At least for
>> Linux and Win32 builds.) Out of interest, what branch are these
>> machines using? I am using remote stage/next, but still get the
>> DIRECTIONCOLLAPSETOIDENTITY errors...
>>
>> Also, are you in charge of the Linux box mi3c-qbert.mayo.edu? I'm just
>> wondering if it would be possible to install Mono so that C# wrapping
>> on Linux is covered (unfortunately I don't have access to a Linux
>> machine for submitting builds at the moment). If you tell me the Linux
>> flavour, I can provide the few commands needed to install the 2 or 3
>> Mono-related packages.
>>
>> Cheers, Dan Mueller
>>
>> On 25 July 2011 15:49, Bradley Lowekamp <blowekamp at mail.nih.gov> wrote:
>>> I agree that is starting to be concerning with the size of the library. I am
>>> still amazed with how much it shrinks when the wrapped language library is
>>> made. There should be something we can do about this.
>>> That is great you found a solution. The attached diff is fine. I will place
>>> it onto the end of the current topic. And hopefully, it'll be ready for
>>> merging into master!
>>> Brad
>>>
>>> On Jul 25, 2011, at 1:13 AM, Dan Mueller wrote:
>>>
>>> Hi Brad,
>>>
>>> Debug builds on windows 32-bit systems may not be supported. The library
>>> just gets too big. You should try to build a release.
>>>
>>> Thanks for the info regarding the release build -- I do not encounter
>>> the "can not seek" error in release mode. However, I notice that
>>> SimpleITKBasicFilters.lib comes to 700MB, which is getting close to
>>> 1GB; perhaps something to watch for in the future as SimpleITK grows.
>>>
>>> This morning I located the issue with the SimpleITK C# Visual Studio
>>> 2008 build: it seems VS9 can not handle source dependencies specified
>>> using a wildcard. I have changed
>>> Wrapping/CSharpModules/UseCSharp.cmake to glob any wildcard
>>> expressions (as well as a minor bug fix for FindCSharp when using
>>> outside of SimpleITK). I have tested the changes using VS9, VS10, and
>>> make on Unbuntu. Please find the corrected files attached and diff
>>> below. What is your preferred way of working? Do I push the patch to
>>> Gerrit?
>>>
>>> Cheers, Dan Mueller
>>>
>>> ===================================
>>> diff --git a/Wrapping/CSharpModules/FindCSharp.cmake
>>> b/Wrapping/CSharpModules/FindCSharp.cmake
>>> index 690c86e..97551ac 100644
>>> --- a/Wrapping/CSharpModules/FindCSharp.cmake
>>> +++ b/Wrapping/CSharpModules/FindCSharp.cmake
>>> @@ -15,6 +15,9 @@
>>>
>>> # TODO: ADD ABILITY TO SELECT WHICH C# COMPILER eg. .NET or Mono (if
>>> both exist). For the moment, .NET is selected above Mono.
>>>
>>> +# Make sure find package macros are included
>>> +include( FindPackageHandleStandardArgs )
>>> +
>>> unset( CSHARP_COMPILER CACHE )
>>> unset( CSHARP_INTERPRETER CACHE )
>>> unset( CSHARP_TYPE CACHE )
>>> ===================================
>>> diff --git a/Wrapping/CSharpModules/UseCSharp.cmake
>>> b/Wrapping/CSharpModules/UseCSharp.cmake
>>> index 9bb8e29..90fefdd 100644
>>> --- a/Wrapping/CSharpModules/UseCSharp.cmake
>>> +++ b/Wrapping/CSharpModules/UseCSharp.cmake
>>> @@ -64,29 +64,43 @@ macro( CSHARP_ADD_PROJECT type name )
>>>   set( refs /reference:System.dll )
>>>   set( sources )
>>>   set( sources_dep )
>>> +
>>>   if( ${type} MATCHES "library" )
>>>     set( output "dll" )
>>>   elseif( ${type} MATCHES "exe" )
>>>     set( output "exe" )
>>>   endif( ${type} MATCHES "library" )
>>> +
>>> +  # Step through each argument
>>>   foreach( it ${ARGN} )
>>>     if( ${it} MATCHES "(.*)(dll)" )
>>> +       # Argument is a dll, add reference
>>>        set( refs ${refs} /reference:${it} )
>>> -    else( ${it} MATCHES "(.*)(dll)" )
>>> +    else( )
>>> +      # Argument is a source file
>>>       if( EXISTS ${it} )
>>>         set( sources ${it} ${sources} )
>>>         set( sources_dep ${it} ${sources_dep} )
>>> -      else( EXISTS ${it} )
>>> -        if( EXISTS ${CSHARP_SOURCE_DIRECTORY}/${it} )
>>> -          set( sources ${CSHARP_SOURCE_DIRECTORY}/${it} ${sources} )
>>> -          set( sources_dep ${CSHARP_SOURCE_DIRECTORY}/${it} ${sources_dep}
>>> )
>>> -        else( EXISTS ${CSHARP_SOURCE_DIRECTORY}/${it} )
>>> -          set( sources ${it} ${sources} )
>>> -        endif( EXISTS ${CSHARP_SOURCE_DIRECTORY}/${it} )
>>> -      endif( EXISTS ${it} )
>>> -    endif ( ${it} MATCHES "(.*)(dll)" )
>>> -  endforeach( it )
>>> +      elseif( EXISTS ${CSHARP_SOURCE_DIRECTORY}/${it} )
>>> +        set( sources ${CSHARP_SOURCE_DIRECTORY}/${it} ${sources} )
>>> +        set( sources_dep ${CSHARP_SOURCE_DIRECTORY}/${it} ${sources_dep} )
>>> +      elseif( ${it} MATCHES "[*]" )
>>> +        # For dependencies, we need to expand wildcards
>>> +        FILE( GLOB it_glob ${it} )
>>> +        set( sources ${it} ${sources} )
>>> +        set( sources_dep ${it_glob} ${sources_dep} )
>>> +      endif( )
>>> +    endif ( )
>>> +  endforeach( )
>>> +
>>> +  # Check we have at least one source
>>> +  list( LENGTH sources_dep sources_length )
>>> +  if ( ${sources_length} LESS 1 )
>>> +    MESSAGE( SEND_ERROR "No C# sources were specified for ${type} ${name}"
>>> )
>>> +  endif ()
>>> +  list( SORT sources_dep ${sources_dep} )
>>>
>>> +  # Perform platform specific actions
>>>   set( csharp_compiler_safe ${CSHARP_COMPILER} )
>>>   if (WIN32)
>>>     string( REPLACE "/" "\\" sources ${sources} )
>>> @@ -97,15 +111,18 @@ macro( CSHARP_ADD_PROJECT type name )
>>>     string( REPLACE "\\" "/" sources ${sources} )
>>>   endif (WIN32)
>>>
>>> +  # Add custom target and command
>>>   add_custom_command(
>>>     COMMENT "Compiling C# ${type} ${name}"
>>>     OUTPUT ${name}.${output}
>>>     COMMAND ${csharp_compiler_safe}
>>>     ARGS /t:${type} /out:${name}.${output}
>>> /platform:${CSHARP_PLATFORM} ${refs} ${sources}
>>>     WORKING_DIRECTORY ${CSHARP_BINARY_DIRECTORY}
>>> -    DEPENDS "${sources_dep}"
>>> +    DEPENDS ${sources_dep}
>>>   )
>>> -  add_custom_target( ${name} ALL
>>> -    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.${output}
>>> +  add_custom_target(
>>> +    ${name} ALL
>>> +    DEPENDS ${name}.${output}
>>> +    SOURCES ${sources_dep}
>>>   )
>>> endmacro( CSHARP_ADD_PROJECT )
>>> ===================================
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.patch
Type: text/x-patch
Size: 6790 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110727/003513a9/attachment.bin>


More information about the Insight-developers mailing list