scipy: BUG: 1.12.0rc1: build failure on windows due to macro collision in boost
It looks like boost is using an unfortunate choice of template variable name on windows, which conflicts with a macro:
In file included from ..\scipy\_lib\boost_math\include\boost/math/policies/policy.hpp:11:
..\scipy\_lib\boost_math\include\boost/math/tools/mp.hpp(171,34): error: expected parameter declarator
171 | template<typename L, std::size_t I>
| ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\complex.h(63,20): note: expanded from macro 'I'
63 | #define I _Complex_I
| ^
C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\complex.h(62,29): note: expanded from macro '_Complex_I'
62 | #define _Complex_I _FCbuild(0.0F, 1.0F)
| ^
From https://github.com/conda-forge/scipy-feedstock/pull/262, using the vendored boost.
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 32 (31 by maintainers)
I have a workaround here: https://github.com/boostorg/math/pull/1060 that’s not unlike our protection for MINMAX.
The working draft of the C++ ISO updated the wording to:
The header <complex.h> behaves as if it simply includes the header <complex>
so this looks like an MSVC STL bug.The distinction between language and standard library is important. We can use C++17 as a language version (fully supported by every compiler we use), as long as we don’t use the small handful of not-universally-implemented stdlib features.
So with the following changes, SciPy 1.12.0rc1 builds fine and passes the tests in conda-forge:
-Dcpp_std=c++17
Tolerances patch
Your logic looks correct to me so I think removing support on windows is the best bet.
See: https://github.com/scipy/scipy/pull/19761