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

Reinhold Füreder R.Fureder at exeter.ac.uk
Thu Dec 7 12:46:40 EST 2006


Hi,

Sorry for my late response ;-) Looking at the actual source code --
thanks to the joy of open source -- points to a pragmatic solution. The
little fix below is not at all perfect: (a) it just falls back to the
explicit definition consisting of several statements and is supposed to
be therefore significantly slower (?), and (b) this fall back is
independent of 32bit vs. 64bit mode although it is not required for
32bit mode. I think improving the latter would currently only (but
luckily easily) possible by means of CMake -- if the chosen generator is
VC2005 64bit then ...

For now we have an explicit source tree for 64bit ITK where the inline
assembler code is guarded by checks that VCL_VC_8 is not defined, line
149:

#elif defined (VCL_VC) && !defined(VCL_VC_8) && !defined(__GCCXML__)

In conclusion this is the most pragmatic temporary solution, but not
ideal.
	Reinhold

> -----Original Message-----
> From: insight-users-bounces+r.fureder=exeter.ac.uk at itk.org 
> [mailto:insight-users-bounces+r.fureder=exeter.ac.uk at itk.org] 
> On Behalf Of Reinhold Füreder
> Sent: Wednesday, November 29, 2006 1:14 PM
> To: insight-users at itk.org
> Subject: [Insight-users] Building ITK 3 on AMD Win64 with VC2005
> 
> 
> 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_mat
> h.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_mat
> h.h(162) :
> error C2065: 'fld' : undeclared identifier
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(162) :
> error C2146: syntax error : missing ';' before identifier 'flt'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(162) :
> error C2146: syntax error : missing ';' before identifier 'fistp'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(163) :
> error C2065: 'fistp' : undeclared identifier
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(163) :
> error C2146: syntax error : missing ';' before identifier 'intgr'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(163) :
> error C2143: syntax error : missing ';' before '}'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.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_mat
> h.h(172) :
> error C2146: syntax error : missing ';' before identifier 'flt'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(172) :
> error C2146: syntax error : missing ';' before identifier 'fistp'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.h(173) :
> error C2146: syntax error : missing ';' before identifier 'intgr'
> 4>D:\SwDev\InsightToolkit-3.0.0\Utilities\vxl\core\vnl/vnl_mat
> h.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
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



More information about the Insight-users mailing list