Error about installation dolfinx0.5.1 on Ubuntu 18.04

Hello, everyone,

I’m new in FEniCS and I want to install it from source on Ubuntu 18.04. I have firstly installed all the dependencies that dolfinx needs. After that I run ‘cmake …/’ successfully. But while running ‘make install’, I got error shown below

Consolidate compiler generated dependencies of target dolfinx
[ 1%] Building CXX object dolfinx/CMakeFiles/dolfinx.dir/common/defines.cpp.o
In file included from /home/leo/Documents/dolfinx-0.5.1/cpp/dolfinx/common/defines.cpp:8:
/home/leo/Downloads/petsc/include/petscsys.h:93:6: error: #error “PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h”
93 | #error “PETSc was configured with MPICH but now appears to be compiling using a non-MPICH mpi.h”
| ^~~~~
dolfinx/CMakeFiles/dolfinx.dir/build.make:75: recipe for target ‘dolfinx/CMakeFiles/dolfinx.dir/common/defines.cpp.o’ failed
make[2]: *** [dolfinx/CMakeFiles/dolfinx.dir/common/defines.cpp.o] Error 1
CMakeFiles/Makefile2:303: recipe for target ‘dolfinx/CMakeFiles/dolfinx.dir/all’ failed
make[1]: *** [dolfinx/CMakeFiles/dolfinx.dir/all] Error 2
Makefile:135: recipe for target ‘all’ failed
make: *** [all] Error 2

I have no idea how to deal with this error. I installed PETSc by the tutorial from here and configured it by using ‘./configure --download-mpich --download-fblaslapack’ shown in the tutorial. And in order to make sure the ‘cmake …/’ of dolfinx could run successfully, I added PETSC_DIR and PETSC_ARCH in my .bashrc file.

Any kind of help is appreciated!

Lifan

As the error states, you need to make sure you’re consistent with the MPI version you’re using for PETSc and DOLFINx. You can check PETSc’s configure log to see what it’s using, and compare that with, e.g., echo $(which mpicc) and the CMake configuration log of DOLFINx.

Note also the default MPI on Ubuntu is OpenMPI, not mpich. Nate’s instructions will confirm that. You should also be able to see that /usr/bin/mpicc is a symlink pointing to /etc/alternatives/mpi (i.e. it’s managed by the Debian alternatives mechanism), and that that alternative link points at /usr/bin/mpicc.openmpi

So you should have a simpler build if you configure your petsc build without --download-mpich (i.e. let the petsc build system find openmpi itself).

1 Like

Thank you for your advice.

Thank you for your suggestion. Following your advice, I have run make install succesfully. But when I installed Python interface by pip install ., the process was terminated with ‘Failed to build fenics-dolfinx mpi4py petsc4py petsc’. And the error messages say ’ ERROR: Failed building wheel for fenics-dolfinx’, ‘ERROR: Failed building wheel for petsc4py’, ‘ERROR: Failed building wheel for mpi4py’ and ‘ERROR: Failed building wheel for petsc’. Here shows the complete error messages for ‘petsc’.

Building wheel for petsc (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      petsc: this package cannot be built as a wheel
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for petsc
  Running setup.py clean for petsc

Any idea how to operate it?

Could you add the output of echo $PETSC_ARCH echo $PETSC_DIR and pip3 install -v .

Hello, dokken,

Here is the output of these three commands. As it is too long, I split it in two replies.

Hope your reply.

leo@leo-MS-7C37:~/Documents/dolfinx-0.5.1/python$ echo $PETSC_ARCH
arch-linux-c-debug
leo@leo-MS-7C37:~/Documents/dolfinx-0.5.1/python$ echo $PETSC_DIR
/home/leo/Downloads/petsc_3.18.1
leo@leo-MS-7C37:~/Documents/dolfinx-0.5.1/python$ pip3 install -v .
Using pip 22.3 from /home/leo/.local/lib/python3.8/site-packages/pip (python 3.8)
Defaulting to user installation because normal site-packages is not writeable
Processing /home/leo/Documents/dolfinx-0.5.1/python
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info
  writing /tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/SOURCES.txt'
  writing manifest file '/tmp/pip-pip-egg-info-jh8ll21m/fenics_dolfinx.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Collecting cffi
  Using cached cffi-1.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (442 kB)
Collecting fenics-ffcx<0.6.0,>=0.5.0
  Using cached fenics_ffcx-0.5.0.post0-py3-none-any.whl (124 kB)
Collecting fenics-ufl<2022.3.0,>=2022.2.0
  Using cached fenics_ufl-2022.2.0-py3-none-any.whl (258 kB)
Collecting mpi4py
  Using cached mpi4py-3.1.4.tar.gz (2.5 MB)
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=40.9.0
    Using cached setuptools-65.5.0-py3-none-any.whl (1.2 MB)
  Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
  Installing collected packages: wheel, setuptools
  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  launchpadlib 1.10.6 requires testresources, which is not installed.
  Successfully installed setuptools-65.5.0 wheel-0.37.1
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing src/mpi4py.egg-info/PKG-INFO
  writing dependency_links to src/mpi4py.egg-info/dependency_links.txt
  writing top-level names to src/mpi4py.egg-info/top_level.txt
  reading manifest file 'src/mpi4py.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE.rst'
  writing manifest file 'src/mpi4py.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info
  writing /tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/dependency_links.txt
  writing top-level names to /tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE.rst'
  writing manifest file '/tmp/pip-modern-metadata-i6trnhv_/mpi4py.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-i6trnhv_/mpi4py-3.1.4.dist-info'
  adding license file "LICENSE.rst" (matched pattern "LICEN[CS]E*")
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.21 in /home/leo/.local/lib/python3.8/site-packages (from fenics-dolfinx==0.5.1) (1.23.4)
Collecting petsc4py
  Using cached petsc4py-3.18.1.tar.gz (2.5 MB)
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info
  writing /tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/SOURCES.txt'
  invalid PETSC_DIR: /home/leo/Downloads/petsc_3.18.1 (ignored)
  reading manifest file '/tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file '/tmp/pip-pip-egg-info-z203jghn/petsc4py.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from fenics-ffcx<0.6.0,>=0.5.0->fenics-dolfinx==0.5.1) (39.0.1)
Collecting fenics-basix<0.6.0,>=0.5.0
  Using cached fenics_basix-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting petsc<3.19,>=3.18
  Using cached petsc-3.18.1.tar.gz (18.4 MB)
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info
  writing /tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/requires.txt
  writing top-level names to /tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/top_level.txt
  writing manifest file '/tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/SOURCES.txt'
  writing manifest file '/tmp/pip-pip-egg-info-arbnyjsx/petsc.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: fenics-dolfinx, mpi4py, petsc4py, petsc
  Running command python setup.py bdist_wheel
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/pkgconfig.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/jit.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/log.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/common.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/graph.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/mesh.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/geometry.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/plot.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/la.py -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/__init__.py -> build/lib.linux-x86_64-3.8/dolfinx
  creating build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/forms.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/bcs.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/petsc.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/assemble.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/function.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/dofmap.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/fem/__init__.py -> build/lib.linux-x86_64-3.8/dolfinx/fem
  creating build/lib.linux-x86_64-3.8/dolfinx/io
  copying dolfinx/io/utils.py -> build/lib.linux-x86_64-3.8/dolfinx/io
  copying dolfinx/io/gmshio.py -> build/lib.linux-x86_64-3.8/dolfinx/io
  copying dolfinx/io/__init__.py -> build/lib.linux-x86_64-3.8/dolfinx/io
  creating build/lib.linux-x86_64-3.8/dolfinx/nls
  copying dolfinx/nls/petsc.py -> build/lib.linux-x86_64-3.8/dolfinx/nls
  copying dolfinx/nls/__init__.py -> build/lib.linux-x86_64-3.8/dolfinx/nls
  creating build/lib.linux-x86_64-3.8/dolfinx/wrappers
  copying dolfinx/wrappers/__init__.py -> build/lib.linux-x86_64-3.8/dolfinx/wrappers
  copying dolfinx/py.typed -> build/lib.linux-x86_64-3.8/dolfinx
  copying dolfinx/fem/py.typed -> build/lib.linux-x86_64-3.8/dolfinx/fem
  copying dolfinx/nls/py.typed -> build/lib.linux-x86_64-3.8/dolfinx/nls
  copying dolfinx/wrappers/caster_petsc.h -> build/lib.linux-x86_64-3.8/dolfinx/wrappers
  copying dolfinx/wrappers/MPICommWrapper.h -> build/lib.linux-x86_64-3.8/dolfinx/wrappers
  copying dolfinx/wrappers/array.h -> build/lib.linux-x86_64-3.8/dolfinx/wrappers
  copying dolfinx/wrappers/caster_mpi.h -> build/lib.linux-x86_64-3.8/dolfinx/wrappers
  running build_ext
  -- The C compiler identification is GNU 11.1.0
  -- The CXX compiler identification is GNU 11.1.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - 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: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  CMake Error at /usr/local/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find Python3 (missing: Python3_INCLUDE_DIRS Development.Module)
    (found version "3.8.0")
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /usr/local/share/cmake-3.24/Modules/FindPython/Support.cmake:3203 (find_package_handle_standard_args)
    /usr/local/share/cmake-3.24/Modules/FindPython3.cmake:490 (include)
    CMakeLists.txt:15 (find_package)


  -- Configuring incomplete, errors occurred!
  See also "/home/leo/Documents/dolfinx-0.5.1/python/build/temp.linux-x86_64-3.8/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/home/leo/Documents/dolfinx-0.5.1/python/setup.py", line 66, in <module>
      setup(name='fenics-dolfinx',
    File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
      self.run_command('build')
    File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/home/leo/Documents/dolfinx-0.5.1/python/setup.py", line 40, in run
      self.build_extension(ext)
    File "/home/leo/Documents/dolfinx-0.5.1/python/setup.py", line 62, in build_extension
      subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
    File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/home/leo/Documents/dolfinx-0.5.1/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/leo/Documents/dolfinx-0.5.1/python/build/lib.linux-x86_64-3.8/dolfinx', '-DPython3_EXECUTABLE=/usr/bin/python', '-DPython3_LIBRARIES=/usr/lib/python3.8', '-DPython3_INCLUDE_DIRS=/usr/include/python3.8', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/home/leo/Documents/dolfinx-0.5.1/python/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-0qdb2v7n
  cwd: /home/leo/Documents/dolfinx-0.5.1/python/
  Building wheel for fenics-dolfinx (setup.py) ... error
  ERROR: Failed building wheel for fenics-dolfinx
  Running setup.py clean for fenics-dolfinx
  Running command python setup.py clean
  running clean
  removing 'build/temp.linux-x86_64-3.8' (and everything under it)
  removing 'build/lib.linux-x86_64-3.8' (and everything under it)
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.8' does not exist -- can't clean it
  removing 'build'

And here is the second part of the output.

 Running command Building wheel for mpi4py (pyproject.toml)
  running bdist_wheel
  running build
  running build_src
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/run.py -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/bench.py -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/__main__.py -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/__init__.py -> build/lib.linux-x86_64-cpython-38/mpi4py
  creating build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/_core.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/__main__.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/__init__.py -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  creating build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/util/pkl5.py -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/util/dtlib.py -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/util/__init__.py -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/py.typed -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/__init__.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/MPI.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/bench.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/dl.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/run.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/__main__.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-cpython-38/mpi4py
  copying src/mpi4py/__init__.pxd -> build/lib.linux-x86_64-cpython-38/mpi4py
  creating build/lib.linux-x86_64-cpython-38/mpi4py/include
  creating build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-cpython-38/mpi4py/include/mpi4py
  copying src/mpi4py/futures/__init__.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/_core.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/pool.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/aplus.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/_lib.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/server.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/futures/__main__.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/futures
  copying src/mpi4py/util/__init__.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/util/dtlib.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  copying src/mpi4py/util/pkl5.pyi -> build/lib.linux-x86_64-cpython-38/mpi4py/util
  running build_clib
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /usr/bin/mpicc
  MPI C++ compiler:  /usr/bin/mpicxx
  MPI F compiler:    /usr/bin/mpifort
  MPI F90 compiler:  /usr/bin/mpif90
  MPI F77 compiler:  /usr/bin/mpif77
  checking for library 'lmpe' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -llmpe -o _configtest
  /usr/bin/ld: cannot find -llmpe
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  building 'mpe' dylib library
  creating build/temp.linux-x86_64-cpython-38
  creating build/temp.linux-x86_64-cpython-38/src
  creating build/temp.linux-x86_64-cpython-38/src/lib-pmpi
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-cpython-38/src/lib-pmpi/mpe.o
  creating build/lib.linux-x86_64-cpython-38/mpi4py/lib-pmpi
  /usr/bin/mpicc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,--no-as-needed build/temp.linux-x86_64-cpython-38/src/lib-pmpi/mpe.o -o build/lib.linux-x86_64-cpython-38/mpi4py/lib-pmpi/libmpe.so
  checking for library 'vt-mpi' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt-mpi -o _configtest
  /usr/bin/ld: cannot find -lvt-mpi
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt.mpi -o _configtest
  /usr/bin/ld: cannot find -lvt.mpi
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  building 'vt' dylib library
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt.o
  /usr/bin/mpicc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,--no-as-needed build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt.o -o build/lib.linux-x86_64-cpython-38/mpi4py/lib-pmpi/libvt.so
  checking for library 'vt-mpi' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt-mpi -o _configtest
  /usr/bin/ld: cannot find -lvt-mpi
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.mpi' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt.mpi -o _configtest
  /usr/bin/ld: cannot find -lvt.mpi
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-mpi' dylib library
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt-mpi.o
  /usr/bin/mpicc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,--no-as-needed build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt-mpi.o -o build/lib.linux-x86_64-cpython-38/mpi4py/lib-pmpi/libvt-mpi.so
  checking for library 'vt-hyb' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt-hyb -o _configtest
  /usr/bin/ld: cannot find -lvt-hyb
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  checking for library 'vt.ompi' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -lvt.ompi -o _configtest
  /usr/bin/ld: cannot find -lvt.ompi
  collect2: error: ld returned 1 exit status
  failure.
  removing: _configtest.c _configtest.o
  building 'vt-hyb' dylib library
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt-hyb.o
  /usr/bin/mpicc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,--no-as-needed build/temp.linux-x86_64-cpython-38/src/lib-pmpi/vt-hyb.o -o build/lib.linux-x86_64-cpython-38/mpi4py/lib-pmpi/libvt-hyb.so
  running build_ext
  MPI configuration: [mpi] from 'mpi.cfg'
  MPI C compiler:    /usr/bin/mpicc
  MPI C++ compiler:  /usr/bin/mpicxx
  MPI F compiler:    /usr/bin/mpifort
  MPI F90 compiler:  /usr/bin/mpif90
  MPI F77 compiler:  /usr/bin/mpif77
  checking for dlopen() availability ...
  checking for header 'dlfcn.h' ...
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  success!
  checking for library 'dl' ...
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  x86_64-linux-gnu-gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'dlopen' ...
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  x86_64-linux-gnu-gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  building 'mpi4py.dl' extension
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/usr/include/python3.8 -c src/dynload.c -o build/temp.linux-x86_64-cpython-38/src/dynload.o
  src/dynload.c:5:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  warning: build_ext: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

  warning: build_ext: building optional extension "mpi4py.dl" failed

  checking for MPI compile and link ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for missing MPI functions/symbols ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  checking for function 'MPI_Type_create_f90_integer' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'MPI_Type_create_f90_real' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'MPI_Type_create_f90_complex' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'MPI_Status_c2f' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'MPI_Status_f2c' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for symbol 'MPI_LB' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for symbol 'MPI_UB' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for dlopen() availability ...
  checking for header 'dlfcn.h' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  success!
  removing: _configtest.c _configtest.o
  success!
  checking for library 'dl' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  checking for function 'dlopen' ...
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.8 -c _configtest.c -o _configtest.o
  /usr/bin/mpicc -pthread _configtest.o -Lbuild/temp.linux-x86_64-cpython-38 -ldl -o _configtest
  success!
  removing: _configtest.c _configtest.o _configtest
  building 'mpi4py.MPI' extension
  /usr/bin/mpicc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/usr/include/python3.8 -c src/MPI.c -o build/temp.linux-x86_64-cpython-38/src/MPI.o
  In file included from src/MPI.c:4:
  src/mpi4py.MPI.c:6:10: fatal error: Python.h: No such file or directory
      6 | #include "Python.h"
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/mpicc' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for mpi4py (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python /home/leo/.local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpwpvp023e
  cwd: /tmp/pip-install-n0xz3lor/mpi4py_9571343811e14803aa569538d1311045
  Building wheel for mpi4py (pyproject.toml) ... error
  ERROR: Failed building wheel for mpi4py
  Running command python setup.py bdist_wheel
  running bdist_wheel
  invalid PETSC_DIR: /home/leo/Downloads/petsc_3.18.1 (ignored)
  running build
  running build_src
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/petsc4py
  copying src/__main__.py -> build/lib.linux-x86_64-3.8/petsc4py
  copying src/PETSc.py -> build/lib.linux-x86_64-3.8/petsc4py
  copying src/__init__.py -> build/lib.linux-x86_64-3.8/petsc4py
  creating build/lib.linux-x86_64-3.8/petsc4py/lib
  copying src/lib/__init__.py -> build/lib.linux-x86_64-3.8/petsc4py/lib
  creating build/lib.linux-x86_64-3.8/petsc4py/include
  creating build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/petsc4py.PETSc.h -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/petsc4py.h -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/petsc4py.PETSc_api.h -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/numpy.h -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/petsc4py.i -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/PETSc.pxd -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/__init__.pxd -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/include/petsc4py/__init__.pyx -> build/lib.linux-x86_64-3.8/petsc4py/include/petsc4py
  copying src/PETSc.pxd -> build/lib.linux-x86_64-3.8/petsc4py
  copying src/lib/petsc.cfg -> build/lib.linux-x86_64-3.8/petsc4py/lib
  running build_ext
  error: PETSc not found
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-n0xz3lor/petsc4py_80dabf6fe4194d98ae3fc54a18611fc7/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-cnkm9y50
  cwd: /tmp/pip-install-n0xz3lor/petsc4py_80dabf6fe4194d98ae3fc54a18611fc7/
  Building wheel for petsc4py (setup.py) ... error
  ERROR: Failed building wheel for petsc4py
  Running setup.py clean for petsc4py
  Running command python setup.py clean
  running clean
  invalid PETSC_DIR: /home/leo/Downloads/petsc_3.18.1 (ignored)
  removing 'build/lib.linux-x86_64-3.8' (and everything under it)
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.8' does not exist -- can't clean it
  removing 'build'
  removing 'petsc4py.egg-info' (and everything under it)
  Running command python setup.py bdist_wheel
  petsc: this package cannot be built as a wheel
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /usr/bin/python -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize
  
  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)
  
  __file__ = %r
  sys.argv[0] = __file__
  
  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"
  
  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-n0xz3lor/petsc_9f5ef27d23fb4297924cc610d6123126/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d /tmp/pip-wheel-luzcewhe
  cwd: /tmp/pip-install-n0xz3lor/petsc_9f5ef27d23fb4297924cc610d6123126/
  Building wheel for petsc (setup.py) ... error
  ERROR: Failed building wheel for petsc
  Running setup.py clean for petsc
  Running command python setup.py clean
  running clean
  'build/lib' does not exist -- can't clean it
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-3.8' does not exist -- can't clean it
Failed to build fenics-dolfinx mpi4py petsc4py petsc
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects
leo@leo-MS-7C37:~/Documents/dolfinx-0.5.1/python$

I don’t really know why this error pops up. Maybe @dparsons or @jackhale knows

Possibly it means you need the python development packages installed (python3-dev, which will trigger installation of libpython3-dev).

2 Likes