serge-sans-paille / pythran

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

Build errors for scipy 1.11.4 from pythran 0.15.0 with Intel OneAPI compilers 2024.1.0 #2213

Closed climbfuji closed 3 weeks ago

climbfuji commented 1 month ago

I am building scipy (py-scipy in the spack world) with the Intel oneAPI compilers (2024.1.0). I am running into this meson build error when compiling C++ code, and it seems it is triggered by pythran. The pythran version is 0.15.0, the scipy version is 1.11.4, python is 3.10.13. Python and pythran are built by spack.

...
  [1022/1628] Compiling C object scipy/spatial/_qhull.cpython-310-x86_64-linux-gnu.so.p/qhull_src_src_geom_r.c.o
  [1023/1628] Compiling C++ object scipy/stats/_stats_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o
  FAILED: scipy/stats/_stats_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o
  /p/work1/heinzell/oneapi_20240603/spst/spack/lib/spack/env/oneapi/icpx -Iscipy/stats/_stats_pythran.cpython-310-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/pyth
on3.10/site-packages/pythran -I../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-numpy-1.22.3-bl72anl/lib/python3.10/site-packages/numpy/core/include -I/p/work1/heinzell/oneapi_20240603/spst/envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/python-3.10
.13-kxbdtih/include/python3.10 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O3 -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -Wno-cpp -Wno-deprecated-dec
larations -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-int-in-bool-context -MD -MQ scipy/stats/_stats_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o -MF scipy/stats/_stats_pythran.cpython-310-x86_64-l
inux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o.d -o scipy/stats/_stats_pythran.cpython-310-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o -c scipy/stats/_stats_pythran.cpp
  In file included from scipy/stats/_stats_pythran.cpp:1:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/core.hpp:46:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/types/slice.hpp:5:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/types/NoneType.hpp:6:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/builtins/bool_.hpp:6:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/types/tuple.hpp:8:
  In file included from ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/types/ndarray.hpp:4:
  ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/include/types/ndarray.hpp:479:5: error: cannot overload a member function without a ref-qualifier with a member function with ref
-qualifier '&&'
    479 |     operator[](F const &filter) const;
        |     ^
  ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/include/types/ndarray.hpp:438:5: note: previous declaration is here
    438 |     operator[](S const &s) &&;
        |     ^
  ../../../../../envs/ne-oneapi-2024.1.0/install/oneapi/2024.1.0/py-pythran-0.15.0-42uvick/lib/python3.10/site-packages/pythran/pythonic/include/types/ndarray.hpp:495:5: error: cannot overload a member function without a ref-qualifier with a member function with ref
-qualifier '&&'
    495 |     operator[](F const &filter) const;
        |     ^
...

and then there's a lot more of these. I did a quick search in the open and closed issues/PRs, but couldn't find anything. Apologies if I missed it.

climbfuji commented 3 weeks ago

Here is an update on this issue. Intel release a patch release 2024.1.2 for their DPC/DPC++ compilers (icx, icpx) on top of the latest full release of oneAPI 2024.1.0. With that, the errors mentioned above are gone.

I am hesitant closing this issue without the "bad" version of oneAPI being acknowledged, since others may run into the same problem.

serge-sans-paille commented 3 weeks ago

We don't test that compiler, I'd say that I'm very happy that the bug got solved by itself. Scipy compiles fine with gcc and clang, so i'm inclined to think this was indeed an ICE.

climbfuji commented 3 weeks ago

Thanks for your feedback. Feel free to close this issue!