On Thu, Jan 30, 2025 at 11:25:32AM +0100, Stéphane Glondu wrote:
> Source: plplot
> Version: 5.15.0+dfsg2-12
> Severity: serious
> Tags: ftbfs
> User: debian-ocaml-ma...@lists.debian.org
> Usertags: ocaml-5.3.0-transition
> 
> Dear Maintainer,
> 
> plplot FTBFS on all architectures:
> 
>   https://buildd.debian.org/status/package.php?p=plplot
> 
> Note that a binNMU was triggered as part of the OCaml transition, but
> the failure seems unrelated to OCaml (rather related to numpy).

Attached is a fix for the initial error.

But it fails later with the next error (also numpy related):

...
Generate python results for svg device
cd /tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/examples && env 
EXAMPLES_PREFIX=/tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/examples 
SRC_EXAMPLES_PREFIX=/tmp/plplot-5.15.0+dfsg2/examples 
OUTPUT_DIR=/tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/examples/test_examples_output_dir
 /bin/bash 
/tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/plplot_test/plplot-test.sh 
--verbose --front-end=python --device=svg
Testing front-end python
x00
x01
x02
x03
x04
x05
x06
x07
x08
Traceback (most recent call last):
  File "/tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/examples/python/x08", 
line 37, in <module>
    x08.main(w)
    ~~~~~~~~^^^
  File "/tmp/plplot-5.15.0+dfsg2/obj-x86_64-linux-gnu/examples/python/x08.py", 
line 107, in main
    square_root = sqrt(1. - min(1., ((double(i) - x0)/a)**2))
                            ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py", line 3302, 
in min
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
                          keepdims=keepdims, initial=initial, where=where)
  File "/usr/lib/python3/dist-packages/numpy/_core/fromnumeric.py", line 86, in 
_wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'numpy.float64' object cannot be interpreted as an integer
make[5]: *** [examples/CMakeFiles/test_python_svg.dir/build.make:440: 
examples/test_examples_output_dir/x00p01.svg] Error 1


> Cheers,

cu
Adrian
Description: Fix includes for numpy 2
Author: Adrian Bunk <b...@debian.org>
Bug-Debian: https://bugs.debian.org/1094696

--- plplot-5.15.0+dfsg2.orig/bindings/python/Pltk_init.i
+++ plplot-5.15.0+dfsg2/bindings/python/Pltk_init.i
@@ -24,7 +24,7 @@
 %{
 #define NPY_NO_DEPRECATED_API    NPY_1_7_API_VERSION
 #include <Python.h>
-#include <arrayobject.h>
+#include <numpy/arrayobject.h>
 #include "plplot.h"
 #include "plplotP.h"
 
--- plplot-5.15.0+dfsg2.orig/bindings/python/plplotc.i
+++ plplot-5.15.0+dfsg2/bindings/python/plplotc.i
@@ -46,7 +46,7 @@
 
 %{
 #define NPY_NO_DEPRECATED_API    NPY_1_7_API_VERSION
-#include <arrayobject.h>
+#include <numpy/arrayobject.h>
 #include "plplot.h"
 #include "plplotP.h"
 
--- plplot-5.15.0+dfsg2.orig/cmake/modules/python.cmake
+++ plplot-5.15.0+dfsg2/cmake/modules/python.cmake
@@ -118,8 +118,8 @@ if(ENABLE_python)
       # Double-check that all is well with that choice.
       find_path(
 	NUMPY_INCLUDE_PATH
-	arrayobject.h
-	${NUMPY_INCLUDE_PATH_PARENT}/numpy
+	numpy/arrayobject.h
+	${NUMPY_INCLUDE_PATH_PARENT}
 	)
     endif(NUMPY_ERR)
 

Reply via email to