Eigen 3.4-rc1 fails with mingw gcc 4.9.3
Summary
I was running Eigen 3.4-rc1 through Stan's test suite and it looks like there's an error with IntegralConstant.hpp
when working with mingw's gcc 4.9.3. This is most likely due to mingw being mingw and gcc 4.9.3 only having partial support for C++14. And these tests run fine on my local linux setup and our linux/mac test machines.
(link to the github job) https://github.com/stan-dev/math/pull/2475/checks?check_run_id=2402814670
In file included from lib/eigen_3.4_rc1/Eigen/Core:167:0,
from lib/eigen_3.4_rc1/Eigen/Dense:1,
from ./stan/math/prim/fun/Eigen.hpp:22,
from ./stan/math/prim/meta/append_return_type.hpp:4,
from ./stan/math/prim/meta.hpp:176,
from ./stan/math/fwd/core/fvar.hpp:4,
from ./stan/math/fwd/core.hpp:4,
from ./stan/math/mix/meta.hpp:6,
from ./stan/math/mix.hpp:8,
from ./test/unit/math/test_ad.hpp:4,
from test/unit/math/mix/fun/abs_test.cpp:1:
lib/eigen_3.4_rc1/Eigen/src/Core/util/IntegralConstant.h:189:36: error: template declaration of 'const Eigen::internal::FixedInt<N> Eigen::fix'
static const internal::FixedInt<N> fix{};
Environment
- Operating System : Windows, virtual env specs
Current runner version: '2.277.1'
Operating System
Microsoft Windows Server 2019
10.0.17763
Datacenter
Virtual Environment
Environment: windows-2019
Version: 20210411.1
Included Software: https://github.com/actions/virtual-environments/blob/win19/20210411.1/images/win/Windows2019-Readme.md
Image Release: https://github.com/actions/virtual-environments/releases/tag/win19%2F20210411.1
- Architecture : I actually dunno what github job's use as an architecture but idt that's a thing here
- Eigen Version : 3.4-rc1
- Compiler Version : mingw gcc 4.9.3
-
Compile Flags :
-std=c++1y -m64 -O3 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes
- Vector Extension : Dunno
Full call:
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I lib/tbb_2020.3/include -O3 -I . -I lib/eigen_3.4_rc1 -I lib/boost_1.75.0 -I lib/sundials_5.7.0/include -I lib/benchmark_1.5.1/googletest/googletest/include -I lib/benchmark_1.5.1/googletest/googletest -I lib/benchmark_1.5.1/googletest/googletest/include -I lib/benchmark_1.5.1/googletest/googletest -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -DGTEST_HAS_PTHREAD=0 -DGTEST_HAS_PTHREAD=0 -c -o test/unit/math/mix/fun/abs_test.o test/unit/math/mix/fun/abs_test.cpp
Minimal Example
I don't have access to a windows computer to make a reproducible example, but posted the github job above and am asking someone on my team with a windows computer to try this out.
Steps to reproduce
If I'm right it's any file that includes Eigen and uses mingw
What is the current bug behavior?
Fails to compile
What is the expected correct behavior?
Compiles
Anything else that might help
Is the minimum std version for 3.4 11 or 14?
If it's 14 then I think the answer is to just turn fix
into an alias like
template <int N>
using fix = internal::FixedInt<N>;
-
Have a plan to fix this issue.