Package: python3-numpy
Version: 1:2.2.3+ds-1
Severity: important

For numpy2 files for building numpy extensions have been moved to
python3-numpy-dev.

As a side effect this has broken f2py.

/usr/lib/python3/dist-packages/numpy/f2py/f2py2e.py l.451 accesses
fortranobject.c amd .h from the src subdir.

But /usr/lib/python3/dist-packages/numpy/f2py/src is empty, so f2py
fails. For instance building petsc4py demo tests (e.g. bratu2d):

gmake[1]: Entering directory 
'/tmp/autopkgtest.t1VGMT/build.x9u/real-tree/test-demos/legacy/bratu2d'
/usr/bin/mpiexec --oversubscribe  python3.12 bratu2d.py -impl python
f2py3.12 --noarch --f90flags='' -DF2PY_REPORT_ON_ARRAY_COPY=1 -c bratu2df90.f90 
-m bratu2df90
The Meson build system
Version: 1.7.0
Source dir: /tmp/tmpfnxvgsik
Build dir: /tmp/tmpfnxvgsik/bbdir
Build type: native build
Project name: bratu2df90
Project version: 0.1
Fortran compiler for the host machine: gfortran (gcc 14.2.0 "GNU Fortran 
(Debian 14.2.0-17) 14.2.0")
Fortran linker for the host machine: gfortran ld.bfd 2.44
C compiler for the host machine: cc (gcc 14.2.0 "cc (Debian 14.2.0-17) 14.2.0")
C linker for the host machine: cc ld.bfd 2.44
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program /usr/bin/python3.12 found: YES (/usr/bin/python3.12)
Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1
Run-time dependency python found: YES 3.12
Library quadmath found: YES

meson.build:37:3: ERROR: File 
/usr/lib/python3/dist-packages/numpy/f2py/src/fortranobject.c does not exist.


Indeed /usr/lib/python3/dist-packages/numpy/f2py/src/fortranobject.c
does not exist. The f2py src files have been moved to python3-numpy-dev at
/usr/lib/x86_64-linux-gnu/python3-numpy/numpy/f2py/src/fortranobject.c

But f2py2e.py l.451 is still trying to find them at
os.path.join(f2pydir, 'src', 'fortranobject.h')

The issue here is in the definition of f2pydir. l.450 defines
    f2pydir = os.path.dirname(os.path.abspath(cfuncs.__file__))

But since the debian build system has moved src over to 
/usr/lib/x86_64-linux-gnu/python3-numpy/numpy/f2py/,
f2py2e.py l.450 will need to be patched to match.

e.g.
import sysconfig
...
    f2pydir = os.path.dirname(os.path.abspath('/usr/lib/' + 
sysconfig.get_config_var('MULTIARCH') + '/python3-numpy/numpy/f2py/')

(or alternatively should the definition of cfuncs be patched?
But I suspect not. Probably cfuncs.py should remain where it is in the
python path. Simpler to just patch f2pydir)


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.13-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-numpy depends on:
ii  libatlas3-base [liblapack.so.3]        3.10.3-14
ii  libblas3 [libblas.so.3]                3.12.1-2
ii  libblis4-openmp [libblas.so.3]         1.1-2
ii  libblis4-pthread [libblas.so.3]        1.1-2
ii  libc6                                  2.40-7
ii  libgcc-s1                              14.2.0-17
ii  liblapack3 [liblapack.so.3]            3.12.1-2
ii  libopenblas0-openmp [liblapack.so.3]   0.3.29+ds-2
ii  libopenblas0-pthread [liblapack.so.3]  0.3.29+ds-2
ii  libstdc++6                             14.2.0-17
ii  python3                                3.13.1-2
ii  python3-numpy-dev                      1:2.2.3+ds-1

python3-numpy recommends no packages.

Versions of packages python3-numpy suggests:
ii  gcc               4:14.2.0-1
ii  gfortran          4:14.2.0-1
ii  python-numpy-doc  1:2.2.3+ds-1
ii  python3-dev       3.13.1-2
ii  python3-pytest    8.3.4-1

-- no debconf information

Reply via email to