Unidata / netcdf4-python

netcdf4-python: python/numpy interface to the netCDF C library
http://unidata.github.io/netcdf4-python
MIT License
752 stars 263 forks source link

1.7.0 fails to build (cc1: fatal error: external/nc_complex/src/nc_complex.c: No such file or directory) #1331

Closed sebastic closed 3 months ago

sebastic commented 3 months ago

The Debian package build for 1.7.0 failed to build due to missing generated source files:

I: pybuild plugin_pyproject:129: Building wheel for python3.12 with "build" module
I: pybuild base:311: python3.12 -m build --skip-dependency-check --no-isolation --wheel --outdir /build/netcdf4-python/.pybuild/cpython3_3.12  
* Building wheel...
-L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf
reading from setup.cfg...
using nc-config...
checking /usr/include...
hdf5 headers not found in /usr/include
checking /usr/include/hdf5/serial...
HDF5 library version: 1.10.10 headers found in /usr/include/hdf5/serial
using netcdf library version b'4.9.2'
using Cython to compile netCDF4.pyx...
netcdf lib does not have parallel functions
NETCDF_PLUGIN_DIR not set, no netcdf compression plugins installed
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-312
creating build/lib.linux-x86_64-cpython-312/netCDF4
copying src/netCDF4/utils.py -> build/lib.linux-x86_64-cpython-312/netCDF4
copying src/netCDF4/__init__.py -> build/lib.linux-x86_64-cpython-312/netCDF4
running egg_info
creating src/netCDF4.egg-info
writing src/netCDF4.egg-info/PKG-INFO
writing dependency_links to src/netCDF4.egg-info/dependency_links.txt
writing entry points to src/netCDF4.egg-info/entry_points.txt
writing requirements to src/netCDF4.egg-info/requires.txt
writing top-level names to src/netCDF4.egg-info/top_level.txt
writing manifest file 'src/netCDF4.egg-info/SOURCES.txt'
reading manifest file 'src/netCDF4.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'examples/data'
warning: no previously-included files found matching 'src/netCDF4/_netCDF4.c'
adding license file 'LICENSE'
writing manifest file 'src/netCDF4.egg-info/SOURCES.txt'
copying src/netCDF4/_netCDF4.pyx -> build/lib.linux-x86_64-cpython-312/netCDF4
creating build/lib.linux-x86_64-cpython-312/netCDF4/plugins
copying src/netCDF4/plugins/empty.txt -> build/lib.linux-x86_64-cpython-312/netCDF4/plugins
running build_ext
Compiling src/netCDF4/_netCDF4.pyx because it changed.
[1/1] Cythonizing src/netCDF4/_netCDF4.pyx
building 'netCDF4._netCDF4' extension
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/external
creating build/temp.linux-x86_64-cpython-312/external/nc_complex
creating build/temp.linux-x86_64-cpython-312/external/nc_complex/src
creating build/temp.linux-x86_64-cpython-312/src
creating build/temp.linux-x86_64-cpython-312/src/netCDF4
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/netcdf4-python=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -DNC_COMPLEX_NO_EXPORT=1 -I/usr/include -I/usr/include/hdf5/serial -I/usr/lib/python3/dist-packages/numpy/core/include -Iinclude -Iexternal/nc_complex/include -Iexternal/nc_complex/include/generated_fallbacks -I/usr/include/python3.12 -c external/nc_complex/src/nc_complex.c -o build/temp.linux-x86_64-cpython-312/external/nc_complex/src/nc_complex.o
cc1: fatal error: external/nc_complex/src/nc_complex.c: No such file or directory
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

ERROR Backend subprocess exited when trying to invoke build_wheel

Full buildlog: netcdf4-python.log

ocefpaf commented 3 months ago

That part is added a submodules. You will need to use the git source and for now and do git submodule update --init. However, we should include that in the sdist. Working on it...

ocefpaf commented 3 months ago

This is a duplicate of #1329.

sebastic commented 3 months ago

That part is added a submodules. You will need to use the git source and for now and do git submodule update --init. However, we should include that in the sdist. Working on it...

Please don't use submodules, vendor the required files instead.

The GitHub tar.gz archives should include all the sources to build.