[Insight-developers] itkFactoryTestLib.cxx & Sun CC

Luis Ibanez luis.ibanez at kitware.com
Fri Apr 3 15:52:03 EDT 2009


Hi Tom,

I'm still making changes in the Sun build.
Probably won't be able to finish before the Dashboar rollup tonight.
I'll continue with this tomorrow.

It is almost tempting to simply create a class deriving from the std::allocator
and to implement the destroy() method on it...

BTW, In the process I came across some VXL symbols:

grep -r SUNPRO * | grep ALL


~/src/Insight/Utilities/vxl
vcl/vcl_compiler.h:# define VCL_SUNPRO_ALLOCATOR_HACK(T) T
VCL_SUNPRO_CLASS_SCOPE_HACK(std::allocator<T >)
vcl/vcl_compiler.h:# define VCL_SUNPRO_ALLOCATOR_HACK(T) T // FIXME
vcl/sunpro/vcl_map.h:// this avoids the VCL_SUNPRO_ALLOCATOR_HACK
vcl/sunpro/vcl_vector.h:// this avoids the VCL_SUNPRO_ALLOCATOR_HACK
vcl/emulation/vcl_hashtable.h:  typedef
vcl_vector<VCL_SUNPRO_ALLOCATOR_HACK(node*) > buckets_type;


that lead to suspect that the VXL project may have already
dealt with this problem... (not sure if that's the case).


       Luis

-------------------------------------------------------------
On Fri, Apr 3, 2009 at 2:52 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> Hi Tom
>
> Here is what I have found so far:
>
> A) Using the -D_RWSTD_ALLOCATOR
>     symbol resulted in other compilation errors.
>
>
> B) Using the compiler flag:
>
>                 -library=stlport4
>
>  seems to work fine, but it requires that we add
>  a couple of standard includes in several files.
>  ( #include <string.h>, <stdlib.h>...)
>
>  This doesn't seem to be much of a problem...
>
>  Attached is the patch so far...
>
>  It is still compiling in this Sun station...
>  once it finishes, I'll try the patch on Linux,
>  and if clean, will commit it.
>
>
>       Luis
>
>
>
> ---------------------------
> On Fri, Apr 3, 2009 at 10:26 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Hi Tom,
>>
>> Thanks for tracking the error in the dashboard.
>>
>> From what I understand from the forum post that
>> you found, it seems that adding the compiler flag:
>>
>>            -D_RWSTD_ALLOCATOR
>>
>> would be the best option.
>>
>> Normally we avoid adding this type of defines in the
>> compiler command line, and we rather set the #defines
>> in the file.
>>
>>                         itkConfigure.h.in
>>
>> With a line similar to:
>>
>>       #cmakedefine   _RWSTD_ALLOCATOR
>>
>> Let me try doing this change in this Sun machine (it is at Kitware),
>> and will report later on how it goes.
>>
>>
>>     Thanks,
>>
>>
>>          Luis
>>
>>
>> ----------------------------------
>> On Fri, Apr 3, 2009 at 9:06 AM, Tom Vercauteren <tom.vercauteren at m4x.org> wrote:
>>> Hi,
>>>
>>> I am going to need help on that one:
>>> http://www.cdash.org/CDash/viewBuildError.php?buildid=305373
>>>
>>> Sun cc compiler seems to not like the std::allocator :(
>>>
>>> I should be able to fix the "Cannot assign void* to XXX*" easily by
>>> simply adding an explicit static_cast.
>>>
>>> However I don't know how to handle the "destroy is not a member of
>>> std::allocator" issue. The only interesting information I found is
>>> here:
>>>  http://forums.sun.com/thread.jspa?threadID=5317335
>>> where two possible compiler options are proposed to fix the problem:
>>>  -library=stlport4
>>> or
>>>  -D_RWSTD_ALLOCATOR
>>>
>>> Having absolutely no experience of sun, I have no clue whether any of
>>> those options seems reasonable for ITK.
>>>
>>> Another option of course would be to drop the use of std::allocator
>>> either entirely or only for sun within that unit test. However I do
>>> think that this std::allocator provides a nice example on how to
>>> extend ITK.
>>>
>>> Thoughts?
>>>
>>> Tom
>>>
>>> On Thu, Apr 2, 2009 at 19:53, Tom Vercauteren <tom.vercauteren at m4x.org> wrote:
>>>> Thanks Bill,
>>>>
>>>> Even though, on that page
>>>>  http://msdn.microsoft.com/en-us/library/723te7k3.aspx
>>>> the prototype of allocate is shown as requiring 2 arguments, the
>>>> example provided on the same page only uses one.
>>>>
>>>> Also, MSVC 2003 has a default argument for the second argument:
>>>>  http://msdn.microsoft.com/en-us/library/723te7k3(VS.71).aspx
>>>>
>>>> Anyhow, let's see how it goes.
>>>>
>>>> Tom
>>>>
>>>> On Thu, Apr 2, 2009 at 19:42, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>>>> It's not just VS6. See for example:
>>>>> http://msdn.microsoft.com/en-us/library/723te7k3.aspx
>>>>> which is for VS 2008.
>>>>>
>>>>> Your fix should be portable.
>>>>>
>>>>> Bil
>>>>>
>>>>> On Thu, Apr 2, 2009 at 10:35 AM, Tom Vercauteren
>>>>> <tom.vercauteren at m4x.org> wrote:
>>>>>> Hey Luis,
>>>>>>
>>>>>> It seems that this is a known msvc 6.0 bug. See chapter 11 of
>>>>>> http://www.acceleratedcpp.com/details/msbugs.html
>>>>>>
>>>>>> I'll try with adding a dummy second argument (null pointer). I hope it
>>>>>> won't make other platforms fail...
>>>>>> http://www.itk.org/cgi-bin/viewcvs.cgi/Testing/Code/Common/itkFactoryTestLib.cxx?root=Insight&r1=1.5&r2=1.6&sortby=date
>>>>>>
>>>>>> Tom
>>>>>>
>>>>>> On Thu, Apr 2, 2009 at 18:42, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>>>>>>>
>>>>>>> Hi Tom,
>>>>>>>
>>>>>>> It seems that Visual Studio 6.0 has difficulty
>>>>>>> with the changes in itkFactoryTestLib.cxx:
>>>>>>>
>>>>>>> http://www.cdash.org/CDash/viewBuildError.php?buildid=304766
>>>>>>>
>>>>>>>
>>>>>>> Compiling...
>>>>>>> itkFactoryTestLib.cxx
>>>>>>>
>>>>>>> c:\Dashboards\My
>>>>>>> Tests\InsightContinuous\Testing\Code\Common\itkFactoryTestLib.cxx(68) :
>>>>>>> error C2660: 'allocate' : function does not take 1 parameters
>>>>>>>
>>>>>>>        c:\Dashboards\My
>>>>>>> Tests\InsightContinuous\Testing\Code\Common\itkFactoryTestLib.cxx(59) :
>>>>>>> while compiling class-template member function 'short *__thiscall
>>>>>>> TestImportImageContainer<unsigned long,short>::AllocateElements(unsigned
>>>>>>> long) const'
>>>>>>>
>>>>>>>
>>>>>>>  Any suggestions ?
>>>>>>>
>>>>>>>
>>>>>>>     Thanks
>>>>>>>
>>>>>>>
>>>>>>>         Luis
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> 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 ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>>>>>>
>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>>>>
>>>>>
>>>>
>>>
>>
>


More information about the Insight-developers mailing list