From: Laflen, B. (GE G. Research) <la...@ge...> - 2011-04-01 15:58:10
|
My particular problem is coming from ITK's "use" of VNL (I am not explicitly declaring long long types in my real application). ITK has modified some (all?) of VNL to support long long, at least for its own use case. (64-bit integer support is a good thing for ITK applications, especially for data that is larger than 4 GB.) ITK will compile/build fine in 64-bit with their own VNL version, but the build fails when the ITK_USE_SYSTEM_VXL CMake flag is set, because then it attempts to build against the non-specialized VNL in VXL. So, why not just build on ITK, with its own version of VNL? In my application, I am using some other parts of VXL. And, the ITK version of VNL is incompatible with the most recent VXL version (I posted about this a few months back). I guess this may also be considered an ITK bug... Thanks, Brandon -----Original Message----- From: Ian Scott [mailto:sc...@im...] Sent: Friday, April 01, 2011 9:38 AM Cc: Vxl-Users Subject: [Vxl-users] Fwd: Re: vxl, long long, and 64-bit VS10 On 31/03/2011 16:53, Laflen, Brandon (GE Global Research) wrote: > Dear vxl-users, > > I am having difficulty compiling 64-bit code that uses the "long long" > data type. The problem appears to be arising from insufficient > support either in vcl or vnl. This problem occurs on a 64-bit > Windows 7 platform, with Visual Studio 2010. > > I have posted a generic example of the issue below. Is this a problem > with vxl support for VS2010, or vxl support for "long long" in general? VXL support for long long is not complete. VNL appears to be a particular problem. I think vil support for long long on MSVC is fairly complete (vxl_int_64 is a typedef for long long) It isn't that hard to add locally. I'd added some of the missing stuff in a few minutes ... see below. It may be trickier to add it properly to VNL in a good enough form to commit, since the code will have to handle different compilers where long long is a distinct type from long, vxl_int_64 on all relevent compilers. (bear in mind that long long is a C99 or C++0x feature, and not a part of the C++98 standard) Ian. Add to vnl_numeric_limits.h > > VCL_DEFINE_SPECIALIZATION > class vnl_numeric_traits<long long> > { > public: > //: Additive identity > static const long long zero VCL_STATIC_CONST_INIT_INT_DECL(0); > //: Multiplicative identity > static const long long one VCL_STATIC_CONST_INIT_INT_DECL(1); > //: Maximum value which this type can assume > static const long long maxval; // = 0x7fffffff; > //: Return value of abs() > typedef long long abs_t; > //: Name of a type twice as long as this one for accumulators and products. > typedef long long double_t; > //: Name of type which results from multiplying this type with a double > typedef double real_t; > }; > > #if !VCL_CANNOT_SPECIALIZE_CV > VCL_DEFINE_SPECIALIZATION > class vnl_numeric_traits<long long const> : public vnl_numeric_traits<long long> {}; > #endif Add to vnl_numeric_traits.cxx > const long long vnl_numeric_traits<long long>::maxval = sizeof(long > long)==(vxl_uint_64)(-1); > Add to vnl_complex_traits.cxx > VCL_DEFINE_SPECIALIZATION struct vnl_complex_traits<long long> { > enum { isreal = true }; > static long long conjugate(long long x) { return x; } > static vcl_complex<long long> complexify(long long x) { return > vcl_complex<long long >(x, (long long)0); } }; > > Add to vnl_math.h > inline long long vnl_math_squared_magnitude(long long x) { return x*x; > } Add to vnl_c_vector+long_long-.cxx > #include <vnl/vnl_c_vector.txx> > > VNL_C_VECTOR_INSTANTIATE_ordered(long long); ------------------------------------------------------------------------ ------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Vxl-users mailing list Vxl...@li... https://lists.sourceforge.net/lists/listinfo/vxl-users |