Petsc4py not found when installing dolfinx 0.7.0

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?

Please add the output of building the C++ core as well.

When I run

PETSC_ARCH=linux-gnu-complex-32 cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX/dolfinx-complex -DCMAKE_BUILD_TYPE=${DOLFINX_CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${DOLFINX_CMAKE_CXX_FLAGS} ../cpp

it gives;

-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/ee331/gcc-12.3/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/ee331/gcc-12.3/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found MPI_C: /home/ee331/Dev/Venvs/v070/installation/openmpi/lib/libmpi.so (found suitable version "3.1", minimum required is "3") 
-- Found MPI_CXX: /home/ee331/Dev/Venvs/v070/installation/openmpi/lib/libmpi.so (found suitable version "3.1", minimum required is "3") 
-- Found MPI: TRUE (found suitable version "3.1", minimum required is "3")  
-- Performing Test HAVE_PIPE
-- Performing Test HAVE_PIPE - Success
-- Performing Test HAVE_PEDANTIC
-- Performing Test HAVE_PEDANTIC - Success
-- Performing Test HAVE_DEBUG
-- Performing Test HAVE_DEBUG - Success
-- Performing Test HAVE_O2_OPTIMISATION
-- Performing Test HAVE_O2_OPTIMISATION - Success
-- Found Boost 1.71.0 at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0
--   Requested configuration: QUIET REQUIRED COMPONENTS timer
-- 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: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.70") found components: timer 
-- Checking for basix hints with /home/ee331/Dev/Venvs/v070/bin/python3
-- Adding /home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/basix to Basix search hints
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for one of the modules 'PETSc>=3.15;petsc>=3.15'
-- Looking for PETSC_USE_COMPLEX
-- Looking for PETSC_USE_COMPLEX - found
-- Found PETSc version 3.20.0, prefix: /home/ee331/Dev/Venvs/v070/installation/petsc/linux-gnu-complex-32
-- 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: RelWithDebInfo;RELWITHDEBINFO;RELEASE;DEBUG;RELEASE
-- Selected imported configuration: RELEASE
-- Found HDF5: hdf5-shared (found version "1.14.2") found components: C 
-- 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
-- Found Python3: /home/ee331/Dev/Venvs/v070/bin/python3 (found version "3.8.10") found components: Interpreter 
-- Asking Python module FFCx for location of UFC... (Python executable: /home/ee331/Dev/Venvs/v070/bin/python3)
-- Found UFCx: /home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/ffcx/codegeneration (found suitable version "0.7.0", minimum required is "0.7") 
-- Found MPI_C: /home/ee331/Dev/Venvs/v070/installation/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI_CXX: /home/ee331/Dev/Venvs/v070/installation/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found ADIOS2: /home/ee331/Dev/Venvs/v070/installation/adios2/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.9.1", minimum required is "2.8.1") found components: C CXX MPI 
-- Checking for one of the modules 'slepc>=3.15'
-- Found SLEPc version 3.20.0, prefix: /home/ee331/Dev/Venvs/v070/installation/slepc/linux-gnu-complex-32
-- Checking for package 'SCOTCH-PT'
-- Found SCOTCH (version 7.0.3)
-- Performing test SCOTCH_TEST_RUNS
-- Performing test SCOTCH_TEST_RUNS - Success
-- Found SCOTCH: /home/ee331/Dev/Venvs/v070/installation/petsc/linux-gnu-complex-32/lib/libptscotch.a;/home/ee331/Dev/Venvs/v070/installation/petsc/linux-gnu-complex-32/lib/libscotch.a;/home/ee331/Dev/Venvs/v070/installation/petsc/linux-gnu-complex-32/lib/libptscotcherr.a  
-- ParMETIS could not be found/configured. (missing: PARMETIS_TEST_RUNS PARMETIS_INCLUDE_DIRS PARMETIS_VERSION PARMETIS_VERSION_OK) (Required is at least version "4.0.2")
-- The following features have been enabled:

 * BUILD_SHARED_LIBS, Build DOLFINx with shared libraries.
 * CMAKE_INSTALL_RPATH_USE_LINK_PATH, Add paths to linker search and installed rpath.
 * DOLFINX_UFCX_PYTHON, Enable UFCx discovery using Python. Disable if UFCx should be found using a CMake config file.

-- The following OPTIONAL packages have been found:

 * ADIOS2 (required version >= 2.8.1), Adaptable Input/Output (I/O) System., <https://adios2.readthedocs.io/en/latest/>
   IO, including in parallel
 * SCOTCH, Programs and libraries for graph, mesh and hypergraph partitioning, <https://www.labri.fr/perso/pelegrin/scotch>
   Parallel graph partitioning

-- The following RECOMMENDED packages have been found:

 * SLEPc, Scalable Library for Eigenvalue Problem Computations, <http://slepc.upv.es/>
   Eigenvalue computation

-- The following REQUIRED packages have been found:

 * pugixml
 * boost_chrono (required version == 1.71.0)
 * boost_headers (required version == 1.71.0)
 * boost_timer (required version == 1.71.0)
 * Boost (required version >= 1.70), Boost C++ libraries, <http://www.boost.org>
 * Basix (required version >= 0.7)
 * PETSc, Portable, Extensible Toolkit for Scientific Computation (PETSc), <https://www.mcs.anl.gov/petsc/>
   PETSc linear algebra backend
 * HDF5, Hierarchical Data Format 5 (HDF5), <https://www.hdfgroup.org/HDF5>
 * Python3
 * UFCx (required version >= 0.7), Interface for form-compilers (part of FFCx), <https://github.com/fenics/ffcx>
 * MPI
 * PkgConfig

-- The following features have been disabled:

 * DOLFINX_SKIP_BUILD_TESTS, Skip build tests for testing usability of dependency packages.

-- The following RECOMMENDED packages have not been found:

 * ParMETIS (required version >= 4.0.2), Parallel Graph Partitioning and Fill-reducing Matrix Ordering, <http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview>
   Parallel graph partitioning

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ee331/Dev/Venvs/v070/repos/src/dolfinx/build-complex

and

ninja install

gives

-- Install configuration: "RelWithDebInfo"
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/libdolfinx.so.0.7.0
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/libdolfinx.so.0.7
-- Set runtime path of "/home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/libdolfinx.so.0.7.0" to "/home/ee331/Dev/Venvs/v070/installation/basix/lib:/home/ee331/Dev/Venvs/v070/installation/hdf5/lib:/home/ee331/Dev/Venvs/v070/installation/adios2/lib:/home/ee331/Dev/Venvs/v070/installation/openmpi/lib:/home/ee331/Dev/Venvs/v070/installation/slepc/linux-gnu-complex-32/lib:/home/ee331/Dev/Venvs/v070/installation/petsc/linux-gnu-complex-32/lib"
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/libdolfinx.so
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXTargets.cmake
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXTargets-relwithdebinfo.cmake
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/defines.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/dolfinx_common.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/dolfinx_doc.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/IndexMap.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/log.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/loguru.hpp
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/sort.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/types.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/math.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/MPI.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/Scatterer.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/Table.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/Timer.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/TimeLogger.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/TimeLogManager.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/timing.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/Constant.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/CoordinateElement.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/DirichletBC.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/DofMap.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/ElementDofLayout.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/Expression.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/FiniteElement.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/Form.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/Function.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/FunctionSpace.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/assembler.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/assemble_matrix_impl.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/assemble_scalar_impl.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/assemble_vector_impl.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/discreteoperators.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/dofmapbuilder.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/dolfinx_fem.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/interpolate.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/petsc.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/sparsitybuild.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/fem/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/geometry/BoundingBoxTree.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/geometry/gjk.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/geometry/dolfinx_geometry.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/geometry/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/graph/AdjacencyList.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/graph/dolfinx_graph.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/graph/ordering.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/graph/partitioners.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/graph/partition.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/dolfinx_io.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/ADIOS2Writers.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/cells.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/HDF5Interface.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/vtk_utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/VTKFile.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/XDMFFile.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/xdmf_function.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/xdmf_mesh.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/io/xdmf_utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/dolfinx_la.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/MatrixCSR.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/matrix_csr_impl.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/SparsityPattern.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/Vector.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/petsc.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/la/slepc.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/dolfinx_mesh.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/Mesh.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/Geometry.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/Topology.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/MeshTags.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/cell_types.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/generation.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/graphbuild.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/permutationcomputation.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/topologycomputation.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/mesh/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/nls/dolfinx_nls.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/nls/NewtonSolver.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/refinement/dolfinx_refinement.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/refinement/plaza.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/refinement/refine.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/refinement/utils.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/include/dolfinx/common/version.h
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXConfig.cmake
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXConfigVersion.cmake
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/pkgconfig/dolfinx.pc
-- Installing: /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/dolfinx/dolfinx.conf
----------------------------------------------------------------------------
DOLFINx has now been installed in

    /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex

and demo programs have been installed in

    /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/share/dolfinx/demo

Don't forget to update your environment variables. This can be done
easily using the helper file 'dolfinx.conf' which sets the appropriate
variables (for users of the Bash shell).

To update your environment variables, run the following command:

    source /home/ee331/Dev/Venvs/v070/installation/dolfinx-complex/lib/dolfinx/dolfinx.conf

Could you call:
python3 -c "import petsc4py; print(petsc4py.get_include())"
and which pip3 and python3 -m pip list

Sure;

(v070) ee331@darcy:~/Dev/Venvs/v070/repos/src/dolfinx/python$ python3 -c "import petsc4py; print(petsc4py.get_include())"
/home/ee331/Dev/Venvs/v070/lib/python3.8/site-packages/petsc4py/include
(v070) ee331@darcy:~/Dev/Venvs/v070/repos/src/dolfinx/python$ which pip3
/home/ee331/Dev/Venvs/v070/bin/pip3
(v070) ee331@darcy:~/Dev/Venvs/v070/repos/src/dolfinx/python$ python3 -m pip list
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

is rather strange, as it executes what i suggested above https://github.com/FEniCS/dolfinx/blob/v0.7.0/python/CMakeLists.txt#L89
I would try removing the ERROR_QUIET from
https://github.com/FEniCS/dolfinx/blob/v0.7.0/python/CMakeLists.txt#L92
or add an error file to inspect the output: execute_process — CMake 3.28.0-rc5 Documentation

The problem should be here. For some reason, cmake pulls local python’s libraries instead of the libraries I just installed. Is there a way of setting DPython_LIBRARIES as an environmental variable?

I made a seperate directory for dolfinx dependencies up until petsc

Then I generate a virtual environment. Within that environment, I install the dependencies starting from petsc and then

  • slepc
  • python packages

and so on.

It is important to note that installing cython at the beginning caused an issue during the installation of petsc4py and slepc4py.