Hi,
When I install the dolfinx python binding, it can not find the petsc4py although it has installed. I run the code
CXXFLAGS=${DOLFINX_CMAKE_CXX_FLAGS} PETSC_ARCH=linux-gnu-complex-32 pip3 install --target $VENV_DIR/lib/python3.8/dist-packages --no-dependencies --no-cache-dir .
I get;
(v070) ee331@darcy:~/Dev/Venvs/v070/repos/src/dolfinx/python$ CXXFLAGS=${DOLFINX_CMAKE_CXX_FLAGS} PETSC_ARCH=linux-gnu-complex-32 pip3 install --target $VENV_DIR/lib/python3.8/dist-packages --no-dependencies --no-cache-dir .
Processing /home/ee331/Dev/Venvs/v070/repos/src/dolfinx/python
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: fenics-dolfinx
Building wheel for fenics-dolfinx (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for fenics-dolfinx (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [100 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
-- Found Python3: /home/ee331/Dev/Venvs/v070/bin/python3 (found version "3.8.10") found components: Interpreter Development.Module
-- Found pybind11: /tmp/pip-build-env-1uu02u4i/normal/lib/python3.8/site-packages/pybind11/include (found version "2.11.1")
-- Found Boost 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0
-- Requested configuration: QUIET REQUIRED COMPONENTS timer;filesystem
-- Found boost_headers 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_headers-1.71.0
-- Found boost_timer 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_timer-1.71.0
-- [x] libboost_timer.so.1.71.0
-- [ ] libboost_timer.a
-- Adding boost_timer dependencies: chrono;headers
-- Found boost_chrono 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_chrono-1.71.0
-- [x] libboost_chrono.so.1.71.0
-- [ ] libboost_chrono.a
-- Adding boost_chrono dependencies: headers
-- Found boost_filesystem 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/boost_filesystem-1.71.0
-- [x] libboost_filesystem.so.1.71.0
-- [ ] libboost_filesystem.a
-- Adding boost_filesystem dependencies: headers
-- Found Python3: /home/ee331/Dev/Venvs/v070/bin/python3 (found version "3.8.10") found components: Interpreter
-- Found HDF5 at /home/ee331/Dev/Venvs/v070/installation/hdf5/cmake via NO_MODULE. Now trying to extract locations etc.
-- Trying to get properties of target hdf5-shared
-- Found imported configurations: RELEASE
-- Start search through imported configurations in the following order: Release;RELWITHDEBINFO;RELEASE;DEBUG;RELEASE
-- Selected imported configuration: RELEASE
-- HDF5_DIR: /home/ee331/Dev/Venvs/v070/installation/hdf5/cmake
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /home/ee331/Dev/Venvs/v070/installation/hdf5/include
-- HDF5_LIBRARIES: hdf5-shared
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /home/ee331/Dev/Venvs/v070/installation/hdf5/include
-- HDF5_C_LIBRARY: /home/ee331/Dev/Venvs/v070/installation/hdf5/lib/libhdf5.so.310.2.0
-- HDF5_C_LIBRARIES: hdf5-shared
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES:
-- Defined targets (if any):
-- ... hdf5::hdf5
-- ... hdf5-static
-- ... hdf5-shared
-- ... hdf5_hl-static
-- ... hdf5_hl-shared
CMake Error at CMakeLists.txt:99 (message):
petsc4py could not be found.
-- Configuring incomplete, errors occurred!
See also "/home/ee331/Dev/Venvs/v070/repos/src/dolfinx/python/build/temp.linux-x86_64-cpython-38/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "/home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 434, in build_wheel
return self._build_with_temp_dir(
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 507, in run_setup
super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
exec(code, locals())
File "<string>", line 71, in <module>
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
super().run_command(command)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 364, in run
self.run_command("build")
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
super().run_command(command)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
self.run_command(cmd_name)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 989, in run_command
super().run_command(command)
File "/tmp/pip-build-env-1uu02u4i/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "<string>", line 41, in run
File "<string>", line 67, in build_extension
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/ee331/Dev/Venvs/v070/repos/src/dolfinx/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/ee331/Dev/Venvs/v070/repos/src/dolfinx/python/build/lib.linux-x86_64-cpython-38/dolfinx', '-DPython3_EXECUTABLE=/home/ee331/Dev/Venvs/v070/bin/python3', '-DPython3_LIBRARIES=/usr/lib/python3.8', '-DPython3_INCLUDE_DIRS=/usr/include/python3.8', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fenics-dolfinx
Failed to build fenics-dolfinx
ERROR: Could not build wheels for fenics-dolfinx, which is required to install pyproject.toml-based projects
It seems that cmake cannot find the libraries within the virtual python enviroment, because I have installed petsc4py and can successfully call it;
pip3 list
gives
Package Version
----------------------------- ------------
alabaster 0.7.13
asttokens 2.4.0
attrs 23.1.0
Babel 2.13.0
backcall 0.2.0
certifi 2023.7.22
cffi 1.16.0
charset-normalizer 3.3.1
contourpy 1.1.1
cppimport 22.8.2
cycler 0.12.1
Cython 3.0.4
decorator 5.1.1
docutils 0.18.1
exceptiongroup 1.1.3
execnet 2.0.2
executing 2.0.0
fastjsonschema 2.18.1
fenics-basix 0.7.0
fenics-ffcx 0.7.0
fenics-ufl 2023.2.0
filelock 3.12.4
flake8 6.1.0
fonttools 4.43.1
gmsh 4.11.1
idna 3.4
imagesize 1.4.1
importlib-metadata 6.8.0
importlib-resources 6.1.0
iniconfig 2.0.0
ipython 8.12.3
isort 5.12.0
jedi 0.19.1
Jinja2 3.1.2
jsonschema 4.19.1
jsonschema-specifications 2023.7.1
jupyter_core 5.4.0
jupytext 1.15.2
kiwisolver 1.4.5
llvmlite 0.41.1
Mako 1.2.4
markdown-it-py 3.0.0
MarkupSafe 2.1.3
matplotlib 3.7.3
matplotlib-inline 0.1.6
mccabe 0.7.0
mdit-py-plugins 0.4.0
mdurl 0.1.2
mpi4py 3.1.5
mypy 1.6.1
mypy-extensions 1.0.0
myst-parser 2.0.0
nbformat 5.9.2
numba 0.58.1
numpy 1.23.2
packaging 23.2
parso 0.8.3
petsc4py 3.20.0
pexpect 4.8.0
pickleshare 0.7.5
Pillow 10.1.0
pip 23.3.1
pkg_resources 0.0.0
pkgutil_resolve_name 1.3.10
platformdirs 3.11.0
pluggy 1.3.0
prompt-toolkit 3.0.39
ptyprocess 0.7.0
pure-eval 0.2.2
pybind11 2.11.1
pycodestyle 2.11.1
pycparser 2.21
pyflakes 3.1.0
Pygments 2.16.1
pyparsing 3.1.1
pytest 7.4.2
pytest-xdist 3.3.1
python-dateutil 2.8.2
pytz 2023.3.post1
PyYAML 6.0.1
referencing 0.30.2
requests 2.31.0
rpds-py 0.10.6
scipy 1.10.1
setuptools 68.2.2
six 1.16.0
slepc4py 3.20.0
snowballstemmer 2.2.0
Sphinx 7.1.2
sphinx-rtd-theme 1.3.0
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.1
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
stack-data 0.6.3
toml 0.10.2
tomli 2.0.1
traitlets 5.11.2
typing_extensions 4.8.0
urllib3 2.0.7
wcwidth 0.2.8
zipp 3.17.0
At this stage, I do not know what to do?