[Insight-users] Building ITK 3 on AMD Win64 with VC2005

Reinhold Füreder R.Fureder at exeter.ac.uk
Wed Nov 29 07:10:38 EST 2006


Hi,

My goal is to "port" our Win32 application that is based on ITK and VTK
among others to Win64 (Microsoft Windows Server 2003, Enterprise x64
Edition, Service Pack1, Dual Core AMD Opteron) by means of VC2005.

As a first naive (?) attempt I just took and installed the prebuilt
latest CMake release 2.4.4 (a Win32 application). Utilising its "Visual
Studio 8 2005 Win64" generator seemingly allowed to build VTK (5.0.2)
without problem, but building ITK (3.0.0) leads to this kind of errors:
-----
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(160) :
error C4235: nonstandard extension used : '_asm' keyword not supported
on this architecture
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(162) :
error C2065: 'fld' : undeclared identifier
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(162) :
error C2146: syntax error : missing ';' before identifier 'flt'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(162) :
error C2146: syntax error : missing ';' before identifier 'fistp'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(163) :
error C2065: 'fistp' : undeclared identifier
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(163) :
error C2146: syntax error : missing ';' before identifier 'intgr'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(163) :
error C2143: syntax error : missing ';' before '}'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(170) :
error C4235: nonstandard extension used : '_asm' keyword not supported
on this architecture
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(172) :
error C2146: syntax error : missing ';' before identifier 'flt'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(172) :
error C2146: syntax error : missing ';' before identifier 'fistp'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(173) :
error C2146: syntax error : missing ';' before identifier 'intgr'
4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_math.h(173) :
error C2143: syntax error : missing ';' before '}'
-----

These errors are repeating a couple of times, but assuming that the
compiler does not omit too much code after this error, this really seems
to be the only problem. According to MSDN "inline asm on 64bit
development is not a supported scenario by VC2005. What I would suggest
is keep the inline asm for 32bit development under an ifdef but use the
64bit intrinsics when compiling for 64bit." I am wondering if this is
really the (only) problem and solution, or if I miss something.

In fact these two functions are actually introduced by:
-----
 // Win32 doesn't seem to have these functions.
 // Therefore implement inline versions of these functions here.
-----

Reasons that make me think that I may miss something are:
(a) There are other sometimes quite recent postings if this Win64 build
scenario is supported without answer.
(b) There was an older message
(http://public.kitware.com/pipermail/cmake/2005-December/007693.html)
saying that one should build CMake from sources to have a 64bit Cmake.
However, there the problem was already in utilising CMake itself.
(c) The project properties include the compiler flag preprocessor
defintion /DWIN32.
(d) ITK's subproject itkpng also seems to use inline assembler, but its
usage is guarded by 
Special ifdefs and the corresponding lib is built successfully.

Thanks in advance for your help/advise,
	Reinhold



More information about the Insight-users mailing list