[Insight-developers] [Insight-users] Compiling ITK4 in 32 bit mode on 64 bit linux

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Feb 18 09:05:09 EST 2011


Hello Andriy,

Did you run cmake, then edit the with GUI  to add the "-m32" flag?

That is just a guess. If you did you you try starting with a clean directory setting you environment variables CFLAGS, and CXXFLAGS to include "-m32". And let us know if the issue is still there. If this is the case it would explain why we did not detect this bug with the nightly dashboard. If you can to know more about how this configuration occurs look at the CMake/CheckSupportForSSERounding.cmake file.

On Feb 17, 2011, at 2:31 PM, Andriy Fedorov wrote:

> Hi,
> 
> In short:
> 
> 1) is there a set of specific instructions on building ITK4 on 32 bit
> platform? (I haven't found any, and I have problems compiling it, see
> below)
> 
> 2) are there any 32-bit machines on ITK4 dashboard?
> 
> The long story is below ... All I wanted to do is to test some
> functionality of 3D Slicer, since we found some issues on 32-bit
> build.
> 
> 
> I am trying to compile current checkout of ITK4 on Ubuntu 10.04 x64 in
> 32-bit mode.
> 
> To do this, I installed gcc-multilib support, and specified -m32 flag
> for CC and CXX.
> 
> My first attempt to compile resulted in the following error:
> 
> In file included from /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:42,
>                 from /home/andrey/local/src/ITK/Code/Common/itkMath.h:32,
>                 from /home/andrey/local/src/ITK/Code/Common/itkIndex.h:23,
>                 from /home/andrey/local/src/ITK/Code/Common/itkPath.h:22,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.cxx:18:
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/emmintrin.h:32:3: error:
> #error "SSE2 instruction set not enabled"
> 
> Following some advice from google, I added flags -msse2 and -msse4.
> This resulted in the following error:
> 
> In file included from /home/andrey/local/src/ITK/Code/Common/itkMath.h:32,
>                 from
> /home/andrey/local/src/ITK/Testing/Code/Common/itkMathTest.cxx:22:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int64_t itk::Math::Detail::RoundHalfIntegerToEven_64(double)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:280: error:
> ‘_mm_cvtsd_si64’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int64_t itk::Math::Detail::RoundHalfIntegerToEven_64(float)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:288: error:
> ‘_mm_cvtss_si64’ was not declared in this scope
> 
> Next I found this post:
> http://old.nabble.com/Problems-building-itk-3.18-with-review-td28655590.html,
> and tried to turn off VNL_CONFIG_ENABLE_SSE2_ROUNDING as suggested by
> Bradley Lowekamp, still errors (similar errors no matter if I include
> or exclude -msse2 and -msse4 flags):
> 
> In file included from /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:42,
>                 from /home/andrey/local/src/ITK/Code/Common/itkMath.h:32,
>                 from /home/andrey/local/src/ITK/Code/Common/itkIndex.h:23,
>                 from /home/andrey/local/src/ITK/Code/Common/itkPath.h:22,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.cxx:18:
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/emmintrin.h:32:3: error:
> #error "SSE2 instruction set not enabled"
> In file included from /home/andrey/local/src/ITK/Code/Common/itkMath.h:32,
>                 from /home/andrey/local/src/ITK/Code/Common/itkIndex.h:23,
>                 from /home/andrey/local/src/ITK/Code/Common/itkPath.h:22,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.h:21,
>                 from
> /home/andrey/local/src/ITK/Code/Common/itkChainCodePath2D.cxx:18:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int32_t itk::Math::Detail::RoundHalfIntegerToEven_32(double)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:176: error:
> ‘_mm_set_sd’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:176: error:
> ‘_mm_cvtsd_si32’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int32_t itk::Math::Detail::RoundHalfIntegerToEven_32(float)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:184: error:
> ‘_mm_set_ss’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:184: error:
> ‘_mm_cvtss_si32’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int64_t itk::Math::Detail::RoundHalfIntegerToEven_64(double)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:280: error:
> ‘_mm_set_sd’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:280: error:
> ‘_mm_cvtsd_si64’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h: In function
> ‘itk::int64_t itk::Math::Detail::RoundHalfIntegerToEven_64(float)’:
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:288: error:
> ‘_mm_set_ss’ was not declared in this scope
> /home/andrey/local/src/ITK/Code/Common/itkMathDetail.h:288: error:
> ‘_mm_cvtss_si64’ was not declared in this scope
> 
> 
> In addition to the errors, there is this somewhat bothering warning:
> 
> In file included from /usr/include/string.h:640,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/Common/gdcmTrace.h:27,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/Common/gdcmLegacyMacro.h:23,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/Common/gdcmTypes.h:20,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/Common/gdcmObject.h:18,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/DataStructureAndEncodingDefinition/gdcmFile.h:18,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/MediaStorageAndFileFormat/gdcmPrinter.h:47,
>                 from
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx:15:
> In function ‘void* memcpy(void*, const void*, size_t)’,
>    inlined from ‘void gdcm::PrintValue(const gdcm::VR::VRType&, const
> gdcm::VM&, const gdcm::Value&)’ at
> /home/andrey/local/src/ITK/Utilities/gdcm/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx:420:
> /usr/include/bits/string3.h:52: warning: call to void*
> __builtin___memcpy_chk(void*, const void*, unsigned int, unsigned int)
> will always overflow destination buffer
> 
> My system information:
> 
> * Ubuntu 10.04
> 
> * 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 x86_64 GNU/Linux
> 
> * gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
> 
> Once these issues are resolved, I will be happy to contribute results
> of ctesting on my working build to the ITK4 dashboard.
> 
> thanks
> 
> --
> Andriy Fedorov, Ph.D.
> 
> Research Fellow
> Brigham and Women's Hospital
> Harvard Medical School
> 75 Francis Street
> Boston, MA 02115 USA
> fedorov at bwh.harvard.edu
> (617) 525-6258 (office)
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.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-users

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110218/635d677b/attachment-0001.htm>


More information about the Insight-developers mailing list