Compilation error from including headers on
Submitted by Zsbán Ambrus
Assigned to Nobody
Link to original bugzilla bug (#1363)
Version: 3.3 (current stable)
Operating system: Windows
Description
Created attachment 759
complete error output and hello world executable
I'm trying to compile a hello world program with gcc to windows x86_64. I get a thousand line's worth of compilation errors from just including <Eigen/Core>.
The first error message is:
In file included from ../eigen3/Eigen/Core:362:0,
from droppipe.cpp:1:
../eigen3/Eigen/src/Core/arch/AVX/PacketMath.h:120:108: error: 'Packet Eigen::internal::pset1(const typename Eigen::internal::unpacket_traits<Packet>::type&) [with Packet = __vector(8) float; typename Eigen::internal::unpacket_traits<Packet>::type = float]' conflicts with a previous declaration
template<> EIGEN_STRONG_INLINE Packet8f pset1<Packet8f>(const float& from) { return _mm256_set1_ps(from); }
^
In file included from ../eigen3/Eigen/Core:359:0,
from droppipe.cpp:1:
../eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:178:41: note: previous declaration 'Packet Eigen::internal::pset1(const typename Eigen::internal::unpacket_traits<Packet>::type&) [with Packet = __vector(4) float; typename Eigen::internal::unpacket_traits<Packet>::type = float]'
template<> EIGEN_STRONG_INLINE Packet4f pset1<Packet4f>(const float& from) { return _mm_set_ps1(from); }
^
In file included from ../eigen3/Eigen/Core:362:0,
from droppipe.cpp:1:
../eigen3/Eigen/src/Core/arch/AVX/PacketMath.h:120:41: note: -fabi-version=6 (or =0) avoids this error with a change in mangling
template<> EIGEN_STRONG_INLINE Packet8f pset1<Packet8f>(const float& from) { return _mm256_set1_ps(from); }
^
The compiler is windows gcc 4.8.3 targetting windows x86_64 with AVX instructions. The compiler installation binary comes from win-builds 1.5.0 x86_64 windows (see "http://win-builds.org/doku.php"). Note though that win-builds contains multiple versions of gcc, including ones targetting MSYS and Cygwin. This is the one that "C:\Win-builds\bin\c++.exe" starts. The complete command line is
wib g++ -std=c++1y -mtune=corei7-avx -mavx -fno-math-errno -Wall -Wextra -O2 -I ../eigen3 -pthread -o droppipe droppipe.cpp
where wib is a simple wrapper batch file that does set PATH=C:\Win-builds\bin;%PATH% so that the compiler can load its dynamic libraries.
ChriSopht says the errors are because in this c++ mangling with gcc, __m128 and __m256 types are indistinguishable, but Eigen is supposed to have a workaround for this.
You can find the complete error output and the hello world source file in the attachment.
Attachment 759, "complete error output and hello world executable":
errors.txt