pythran: Pip install Scipy fails on FreeBSD 13.1

I am trying to install Scipy in a virtualenv on FreeBSD 13.1, but the build fails with an error related to Pythran when doing compilation.

Steps to reproduce (in a Python repo):

mkdir venv
python3.9 -m venv ./venv/py39
. ./venv/bin/py39/activate
pip install scipy

The versions for various software:

  • FreeBSD 13.1-RELEASE-p3
  • LLVM clang version 9.0.1
  • openblas-0.3.20,1
  • GNU Fortran (FreeBSD Ports Collection) 12.2.0
  • Python 3.9.16
  • pip 22.0.4

The relevant error is here:

      [825/1620] Compiling C++ object scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o
      FAILED: scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o
      c++ -Iscipy/stats/_stats_pythran.cpython-39.so.p -Iscipy/stats -I../../scipy/stats -I/tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran -I/tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/numpy/core/include -I/usr/local/include/python3.9 -fvisibility=hidden -fvisibility-inlines-hidden -fcolor-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O2 -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -Wno-cpp -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-int-in-bool-context -MD -MQ scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o -MF scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o.d -o scipy/stats/_stats_pythran.cpython-39.so.p/meson-generated_..__stats_pythran.cpp.o -c scipy/stats/_stats_pythran.cpp
      In file included from scipy/stats/_stats_pythran.cpp:34:
      In file included from /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/pythonic/include/numpy/ceil.hpp:8:
      In file included from /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/xsimd/xsimd.hpp:55:
      /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:447:16: error: no member named 'exp10f' in the global namespace; did you mean 'exp10'?
              return ::exp10f(x);
                     ^~~~~~~~
                     exp10
      /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:445:18: note: 'exp10' declared here
          inline float exp10(const float& x) noexcept
                       ^
      /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:451:16: error: no member named 'exp10' in the global namespace; did you mean simply 'exp10'?
              return ::exp10(x);
                     ^~~~~~~
                     exp10
      /tmp/pip-build-env-i5rkurrm/overlay/lib/python3.9/site-packages/pythran/xsimd/arch/xsimd_scalar.hpp:449:19: note: 'exp10' declared here
          inline double exp10(const double& x) noexcept
                        ^
      2 errors generated.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@peterhil I submitted a slightly different (and simpler ?) patch to xsimd: https://github.com/xtensor-stack/xsimd/pull/895 can you give it a try?

Can you try the following patch ?

index 41a630261..c121ab4f1 100644
--- a/third_party/xsimd/arch/xsimd_scalar.hpp
+++ b/third_party/xsimd/arch/xsimd_scalar.hpp
@@ -441,7 +441,8 @@ namespace xsimd
         return !(x0 == x1);
     }
 
-#if defined(_GNU_SOURCE) && !defined(__APPLE__) && !defined(__MINGW32__) && !defined(__ANDROID__)
+    // FIXME: there must be a better way :-/
+#if defined(_GNU_SOURCE) && !defined(__APPLE__) && !defined(__MINGW32__) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
     inline float exp10(const float& x) noexcept
     {
         return ::exp10f(x);

Looks like an xsimd issue. I’ll try to provide a patch (and will ask you to test it 😃) and if that patch works, I’ll backport it to xsimd.