serge-sans-paille / pythran

Ahead of Time compiler for numeric kernels
https://pythran.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.99k stars 193 forks source link

MSVC throws errors in Pythran code of SciPy #2215

Closed czgdp1807 closed 3 months ago

czgdp1807 commented 3 months ago

Following are the logs,

C:\ProgramData\anaconda3\envs\myenv\Lib\site-packages\pythran\pythonic/include/types/ndarray.hpp(495): error C2559: 'std::enable_if<`anonymous-namespace'::pythonic::types::is_numexpr_arg<F>::value&&std::is_same<bool,F::dtype>::value&&F::value!=1&&!`anonymous-namespace'::pythonic::types::is_pod_array<F>::value,`anonymous-namespace'::pythonic::types::numpy_vexpr<`anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long>>,`anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long>>>>::type `anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long,long>>::operator [](const F &) const': cannot overload a member function without ref-qualifier with a member function with ref-qualifier
C:\ProgramData\anaconda3\envs\myenv\Lib\site-packages\pythran\pythonic/include/types/ndarray.hpp(503): error C2559: 'std::enable_if<`anonymous-namespace'::pythonic::types::is_numexpr_arg<F>::value&&!`anonymous-namespace'::pythonic::types::is_array_index<F>::value&&!std::is_same<bool,F::dtype>::value&&!`anonymous-namespace'::pythonic::types::is_pod_array<F>::value,`anonymous-namespace'::pythonic::types::numpy_vexpr<`anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long,long>>,F>>::type `anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long,long>>::operator [](const F &) const': cannot overload a member function without ref-qualifier with a member function with ref-qualifier
C:\ProgramData\anaconda3\envs\myenv\Lib\site-packages\pythran\pythonic/include/types/ndarray.hpp(479): error C2559: 'std::enable_if<`anonymous-namespace'::pythonic::types::is_numexpr_arg<F>::value&&std::is_same<bool,F::dtype>::value&&F::value==1&&!`anonymous-namespace'::pythonic::types::is_pod_array<F>::value,`anonymous-namespace'::pythonic::types::numpy_vexpr<`anonymous-namespace'::pythonic::types::ndarray<double,`anonymous-namespace'::pythonic::types::pshape<long,long>>,`anonymous-namespace'::pythonic::types::ndarray<long,`anonymous-namespace'::pythonic::types::pshape<long>>>>::type `anonymous-namespace'::pythonic::types::ndarray<double,`anonymous-namespace'::pythonic::types::pshape<long,long>>::operator [](const F &) const': cannot overload a member function without ref-qualifier with a member function with ref-qualifier
C:\ProgramData\anaconda3\envs\myenv\Lib\site-packages\pythran\pythonic/include/types/ndarray.hpp(479): note: the template instantiation context (the oldest one first) is
scipy/stats/_stats_pythran.cp311-win_amd64.pyd.p/_stats_pythran.cpp(1131): note: see reference to class template instantiation '`anonymous-namespace'::__pythran__stats_pythran::_a_ij_Aij_Dij2::type<`anonymous-namespace'::pythonic::types::ndarray<double,`anonymous-namespace'::pythonic::types::pshape<long,long>>>' being compiled
scipy/stats/_stats_pythran.cp311-win_amd64.pyd.p/_stats_pythran.cpp(346): note: see reference to class template instantiation '`anonymous-namespace'::pythonic::types::ndarray<double,`anonymous-namespace'::pythonic::types::pshape<long,long>>' being compiled
C:\ProgramData\anaconda3\envs\myenv\Lib\site-packages\pythran\pythonic/include/types/ndarray.hpp(479): fatal error C1003: error count exceeds 100; stopping compilation
ninja: build stopped: subcommand failed.
Build failed!

Pythran version - 0.16.0 (installed from pip)

rgommers commented 3 months ago

Oh, I knew this already, just forgot. When we introduced Pythran in the SciPy build process, we switched to clang-cl. However, here in the CI job that led to opening this issue we really do want to use MSVC, so it's fine to disable Pythran there.

@serge-sans-paille is this a "wontfix, Pythran will never support MSVC"?

serge-sans-paille commented 3 months ago

Unless msvc learnt to compiled standard c++11 code, I'd say yeah, no chance.

rgommers commented 3 months ago

That's what I thought - @czgdp1807 can you close the issue?