[eigen] GCC-4.6 compilation problem + patch |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] GCC-4.6 compilation problem + patch
- From: Anton Gladky <gladky.anton@xxxxxxxxx>
- Date: Wed, 4 May 2011 23:56:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=XbrCwPkAMH9kiYnXiJ97C8/e4y/arIarT9ucwMUEQTs=; b=k9VV1KOt5wSTeGKV1DqKHge0hGkdvAHpVnTqzBApbT5rl5z99DOFK55NibAgNAQ2w2 luOCMvZKSwbQHEzhEZF23zeMcMHF5h3760qtBHLro/dEPBv4M4GA3t1C51ADXmnXMbjx IC9TQzczdLtRAU21TeKSH7Gobp0WqJh76ucts=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=HHQ0UxT5e91/+4Kd+R4qyU+Kx3hoe3JdcohawMxKLuTtp1VjAq5TkXNBgZYEPdMdJu TbcYqx8vVszwPti/VnjskzHtEyCt/xKAwhMS6xUUO4182DIWdGrx6Cn6DEJVyf2CkxdZ V8MyGyL59j9YEMGu5rOAjCcPSiQf6NUnhMKTY=
Hi, all
First of all, thanks for the great library!
But working on package for Debian (gcc-4.6), I found that "make doc"
and "make check" are both failed.
The problem is in using in some places of the code "ptrdiff_t" instead
of "std::ptrdiff_t".
The patch is attached.
Thank you.
Anton Gladky
diff -r d84c8f4660e6 Eigen/src/Core/arch/AltiVec/Complex.h
--- a/Eigen/src/Core/arch/AltiVec/Complex.h Wed May 04 14:28:45 2011 +0100
+++ b/Eigen/src/Core/arch/AltiVec/Complex.h Wed May 04 23:21:40 2011 +0200
@@ -70,7 +70,7 @@
{
Packet2cf res;
/* On AltiVec we cannot load 64-bit registers, so wa have to take care of alignment */
- if((ptrdiff_t(&from) % 16) == 0)
+ if((std::ptrdiff_t(&from) % 16) == 0)
res.v = pload<Packet4f>((const float *)&from);
else
res.v = ploadu<Packet4f>((const float *)&from);
diff -r d84c8f4660e6 Eigen/src/Core/arch/AltiVec/PacketMath.h
--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h Wed May 04 14:28:45 2011 +0100
+++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h Wed May 04 23:21:40 2011 +0200
@@ -296,14 +296,14 @@
template<> EIGEN_STRONG_INLINE Packet4f ploaddup<Packet4f>(const float* from)
{
Packet4f p;
- if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
+ if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4f>(from);
else p = ploadu<Packet4f>(from);
return vec_perm(p, p, p16uc_DUPLICATE);
}
template<> EIGEN_STRONG_INLINE Packet4i ploaddup<Packet4i>(const int* from)
{
Packet4i p;
- if((ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
+ if((std::ptrdiff_t(&from) % 16) == 0) p = pload<Packet4i>(from);
else p = ploadu<Packet4i>(from);
return vec_perm(p, p, p16uc_DUPLICATE);
}
diff -r d84c8f4660e6 Eigen/src/StlSupport/details.h
--- a/Eigen/src/StlSupport/details.h Wed May 04 14:28:45 2011 +0100
+++ b/Eigen/src/StlSupport/details.h Wed May 04 23:21:40 2011 +0200
@@ -38,7 +38,7 @@
{
public:
typedef size_t size_type;
- typedef ptrdiff_t difference_type;
+ typedef std::ptrdiff_t difference_type;
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
diff -r d84c8f4660e6 test/mapstride.cpp
--- a/test/mapstride.cpp Wed May 04 14:28:45 2011 +0100
+++ b/test/mapstride.cpp Wed May 04 23:21:40 2011 +0200
@@ -38,7 +38,7 @@
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
Scalar* array = a_array;
if(Alignment!=Aligned)
- array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
+ array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
{
Map<VectorType, Alignment, InnerStride<3> > map(array, size);
@@ -77,7 +77,7 @@
Scalar* a_array = internal::aligned_new<Scalar>(arraysize+1);
Scalar* array = a_array;
if(Alignment!=Aligned)
- array = (Scalar*)(ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
+ array = (Scalar*)(std::ptrdiff_t(a_array) + (internal::packet_traits<Scalar>::AlignedOnScalar?sizeof(Scalar):sizeof(typename NumTraits<Scalar>::Real)));
// test no inner stride and some dynamic outer stride
{
diff -r d84c8f4660e6 unsupported/Eigen/FFT
--- a/unsupported/Eigen/FFT Wed May 04 14:28:45 2011 +0100
+++ b/unsupported/Eigen/FFT Wed May 04 23:21:40 2011 +0200
@@ -393,7 +393,7 @@
for (int k=0;k<nx;++k)
*x++ *= s;
#else
- if ( ((ptrdiff_t)x) & 15 )
+ if ( ((std::ptrdiff_t)x) & 15 )
Matrix<T_Data, Dynamic, 1>::Map(x,nx) *= s;
else
Matrix<T_Data, Dynamic, 1>::MapAligned(x,nx) *= s;