-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.h not found when building with uv
but found when using pip and a virtual env
#10052
Comments
I also had a similar outcome. I haven't really looked at the documentation or the recommended ways to build it, but it's interesting that it does work with build isolation with ~ uv pip install petsc4py==3.22.1
Resolved 3 packages in 3m 17s
× Failed to build `petsc4py==3.22.1`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)
[stdout]
running bdist_wheel
running build
running build_src
using Cython 3.0.11
cythonizing 'petsc4py/PETSc.pyx' -> 'petsc4py/PETSc.c'
running build_py
creating build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/__init__.py -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/PETSc.py -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/typing.py -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/__main__.py -> build/lib.linux-x86_64-cpython-312/petsc4py
creating build/lib.linux-x86_64-cpython-312/petsc4py/lib
copying src/petsc4py/lib/__init__.py -> build/lib.linux-x86_64-cpython-312/petsc4py/lib
copying src/petsc4py/__init__.pyi -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/__main__.pyi -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/py.typed -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/PETSc.pxd -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/PETSc.h -> build/lib.linux-x86_64-cpython-312/petsc4py
copying src/petsc4py/PETSc_api.h -> build/lib.linux-x86_64-cpython-312/petsc4py
creating build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/include/petsc4py/pyscalar.h -> build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/include/petsc4py/pybuffer.h -> build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/include/petsc4py/numpy.h -> build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/include/petsc4py/petsc4py.h -> build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/include/petsc4py/petsc4py.i -> build/lib.linux-x86_64-cpython-312/petsc4py/include/petsc4py
copying src/petsc4py/lib/__init__.pyi -> build/lib.linux-x86_64-cpython-312/petsc4py/lib
copying src/petsc4py/lib/__init__.pyi -> build/lib.linux-x86_64-cpython-312/petsc4py/lib
copying src/petsc4py/lib/petsc.cfg -> build/lib.linux-x86_64-cpython-312/petsc4py/lib
running build_ext
PETSC_DIR: /root/.cache/uv/builds-v0/.tmpYkB4Yy/lib/python3.12/site-packages/petsc
PETSC_ARCH:
version: 3.22.1 release
integer-size: 32-bit
scalar-type: real
precision: double
language: CONLY
compiler: clang
linker: clang
building 'PETSc' extension
creating build/temp.linux-x86_64-cpython-312/src/petsc4py
clang -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion
-Wno-implicit-float-conversion -fstack-protector -Qunused-arguments -Wall -Wwrite-strings
-Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion
-fstack-protector -Qunused-arguments -g -O3 -fPIC -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3
-Wall -DMPICH_SKIP_MPICXX=1 -DOMPI_SKIP_MPICXX=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -Isrc
-Isrc/petsc4py/include -I/root/.cache/uv/builds-v0/.tmpYkB4Yy/lib/python3.12/site-packages/numpy/_core/include
-I/root/.cache/uv/sdists-v6/pypi/petsc/3.22.1/hJkKH1sasJwoixz03FvId/src/build/bdist.linux-x86_64/wheel/petsc/include
-I/root/.cache/uv/builds-v0/.tmpYkB4Yy/include -I/usr/local/include/python3.12 -c src/petsc4py/PETSc.c -o
build/temp.linux-x86_64-cpython-312/src/petsc4py/PETSc.o
[stderr]
src/petsc4py/PETSc.c:1222:10: fatal error: 'petsc.h' file not found
#include <petsc.h>
^~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
hint: This error likely indicates that you need to install a library that provides "petsc.h" for
`[email protected]` |
Looking at their setup.py I notice they leverage TL;DR try setting CC @konstin |
I'll have a try when I'm back from holidays. Thanks! |
I am trying to install the package
petsc4py
. When trying to build using uv I have the error:On the other hand, using
pip install --use-pep517 --force-reinstall --no-cache petsc4py
in a python 3.12 environment works just fine:My system is:
The text was updated successfully, but these errors were encountered: