Hi Luis,<br><br>I tried it again today, with a current checkout (commit hash 6ebd49640341277bdc6fc3c3ce77f85eb3150026) on Windows, using Visual Studio 2008. I can try with GCC on Linux too, though I don't think this is platform-dependent.<br>
<br>This problem exists here too. I have VNL_CONFIG_ENABLE_SSE2:BOOL=ON and VNL_CONFIG_ENABLE_SSE2_ROUNDING:BOOL=ON.<br><br>I don't think the rest of the config flags mean anything. There are explicit template specializations of vnl_sse<T> that are enabled when VNL_CONFIG_ENABLE_SSE2 is on (#if VNL_CONFIG_ENABLE_SSE2). If I turn it off, it works correctly. Interestingly, vnl_sse doesn't seem dependent on this variable. Only the float and double specializations are enabled/disabled using this flag.<br>
<br>For now, I'm just turning SSE2 off.<br><br>Thanks,<br>Shash<br><br><div class="gmail_quote">On Sun, May 22, 2011 at 12:55 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Shashwath<br>
<br>
1) How recent is your checkout of ITK ?<br>
<br>
2) Did you purposely enabled any SSE options,<br>
when configuring with CMake ?<br>
<br>
3) Here are the SSE related flag in my working<br>
build of ITK on Linux:<br>
<br>
CMakeCache.txt:VNL_CONFIG_ENABLE_SSE2:BOOL=OFF<br>
CMakeCache.txt:VNL_CONFIG_ENABLE_SSE2_ROUNDING:BOOL=ON<br>
CMakeCache.txt://Have include HAVE_ASSERT_H<br>
CMakeCache.txt:HAVE_ASSERT_H:INTERNAL=1<br>
CMakeCache.txt://Test ITK_COMPILER_DOES_NOT_NEED_MSSE2_FLAG<br>
CMakeCache.txt:ITK_COMPILER_DOES_NOT_NEED_MSSE2_FLAG:INTERNAL=1<br>
CMakeCache.txt://Test ITK_COMPILER_SUPPORTS_SSE2_32<br>
CMakeCache.txt:ITK_COMPILER_SUPPORTS_SSE2_32:INTERNAL=1<br>
CMakeCache.txt://Test ITK_COMPILER_SUPPORTS_SSE2_64<br>
CMakeCache.txt:ITK_COMPILER_SUPPORTS_SSE2_64:INTERNAL=1<br>
CMakeCache.txt:VCL_CXX_HAS_HEADER_CASSERT:INTERNAL=1<br>
CMakeCache.txt://ADVANCED property for variable: VNL_CONFIG_ENABLE_SSE2<br>
CMakeCache.txt:VNL_CONFIG_ENABLE_SSE2-ADVANCED:INTERNAL=1<br>
CMakeCache.txt://ADVANCED property for variable: VNL_CONFIG_ENABLE_SSE2_ROUNDING<br>
CMakeCache.txt:VNL_CONFIG_ENABLE_SSE2_ROUNDING-ADVANCED:INTERNAL=1<br>
CMakeCache.txt:VXL_HAS_SSE2_HARDWARE_SUPPORT:INTERNAL=1<br>
CMakeCache.txt:VXL_HAS_SSE2_HARDWARE_SUPPORT_COMPILED:INTERNAL=TRUE<br>
<br>
<br>
<br>
Luis<br>
<br>
<br>
--------------------------------------<br>
<div><div></div><div class="h5">On Tue, May 17, 2011 at 4:28 AM, Shashwath T.R. <<a href="mailto:trshash@gmail.com">trshash@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> While compiling ITK master, I ran into this error:<br>
><br>
> 1>D:\itk\ITK\Modules\ThirdParty\VNL\src\vxl\core\vnl/vnl_c_vector.txx(261) :<br>
> error C2039: 'arg_max' : is not a member of 'vnl_sse<double>'<br>
> 1> D:\itk\ITK\Modules\ThirdParty\VNL\src\vxl\core\vnl/vnl_sse.h(261)<br>
> : see declaration of 'vnl_sse<double>'<br>
> 1><br>
> D:\itk\ITK\Modules\ThirdParty\VNL\src\vxl\core\vnl/vnl_c_vector.txx(259) :<br>
> while compiling class template member function 'unsigned int<br>
> vnl_c_vector<T>::arg_max(const T *,unsigned int)'<br>
> 1> with<br>
> 1> [<br>
> 1> T=double<br>
> 1> ]<br>
> 1><br>
> ..\..\..\..\..\..\..\..\ITK\Modules\ThirdParty\VNL\src\vxl\core\vnl\Templates\vnl_c_vector+double-.cxx(3)<br>
> : see reference to class template instantiation 'vnl_c_vector<T>' being<br>
> compiled<br>
> 1> with<br>
> 1> [<br>
> 1> T=double<br>
> 1> ]<br>
><br>
> Apparently, vnl_sse<float> and vnl_sse<double> are missing the methods<br>
> arg_min and arg_max. Adding them proved to be very simple - I simply copied<br>
> over the generic implementation and specialized it. I'm attaching my patch<br>
> below.<br>
><br>
> Could someone take a look and see if this is OK?<br>
><br>
> Regards,<br>
> Shash<br>
><br>
> diff --git a/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_sse.h<br>
> b/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_sse.h<br>
> index 5af0f7c..94138a5 100644<br>
> -- a/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_sse.h<br>
> ++ b/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_sse.h<br>
> @@ -543,6 +543,27 @@ class vnl_sse<double><br>
> _mm_store_sd(&ret,min);<br>
> return ret;<br>
> }<br>
> static VNL_SSE_FORCE_INLINE unsigned arg_max(const double* v, unsigned n)<br>
> {<br>
> if (n==0) return unsigned(-1); // the maximum of an empty set is<br>
> undefined<br>
> double tmp = *v;<br>
> unsigned idx = 0;<br>
> for (unsigned i=1; i<n; ++i)<br>
> if (*++v > tmp)<br>
> tmp = *v, idx = i;<br>
> return idx;<br>
> }<br>
><br>
> static VNL_SSE_FORCE_INLINE unsigned arg_min(const double* v, unsigned n)<br>
> {<br>
> if (n==0) return unsigned(-1); // the minimum of an empty set is<br>
> undefined<br>
> double tmp = *v;<br>
> unsigned idx = 0;<br>
> for (unsigned i=1; i<n; ++i)<br>
> if (*++v < tmp)<br>
> tmp = *v, idx = i;<br>
> return idx;<br>
> }<br>
> };<br>
><br>
> //: SSE2 implementation for single precision floating point (32 bit)<br>
> @@ -880,6 +901,27 @@ class vnl_sse<float><br>
><br>
> return ret;<br>
> }<br>
> static VNL_SSE_FORCE_INLINE unsigned arg_max(const float* v, unsigned n)<br>
> {<br>
> if (n==0) return unsigned(-1); // the maximum of an empty set is<br>
> undefined<br>
> float tmp = *v;<br>
> unsigned idx = 0;<br>
> for (unsigned i=1; i<n; ++i)<br>
> if (*++v > tmp)<br>
> tmp = *v, idx = i;<br>
> return idx;<br>
> }<br>
><br>
> static VNL_SSE_FORCE_INLINE unsigned arg_min(const float* v, unsigned n)<br>
> {<br>
> if (n==0) return unsigned(-1); // the minimum of an empty set is<br>
> undefined<br>
> float tmp = *v;<br>
> unsigned idx = 0;<br>
> for (unsigned i=1; i<n; ++i)<br>
> if (*++v < tmp)<br>
> tmp = *v, idx = i;<br>
> return idx;<br>
> }<br>
> };<br>
><br>
> #endif // VNL_CONFIG_ENABLE_SSE2<br>
><br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
><br>
</blockquote></div><br>