Undefined symbol error during importing dolfinx

gives;

total 83812
drwxrwxr-x 3 ekrem ekrem     4096 Dec  6 14:22 cmake
drwxrwxr-x 2 ekrem ekrem     4096 Dec  6 14:22 dolfinx
lrwxrwxrwx 1 ekrem ekrem       17 Dec  6 14:22 libdolfinx.so -> libdolfinx.so.0.3
lrwxrwxrwx 1 ekrem ekrem       21 Dec  6 14:22 libdolfinx.so.0.3 -> libdolfinx.so.0.3.1.0
-rw-r--r-- 1 ekrem ekrem 85805288 Dec  6 14:22 libdolfinx.so.0.3.1.0
drwxrwxr-x 2 ekrem ekrem     4096 Dec  6 14:22 pkgconfig
drwxrwxr-x 3 ekrem ekrem     4096 Dec  6 14:29 python3.8

and

gives

00000000000f92b0 T _ZN7dolfinx3fem18create_matrix_nestERKSt6vectorIS1_IPKNS0_4FormISt7complexIdEEESaIS7_EESaIS9_EERKS1_IS1_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISJ_EESaISL_EE

The symbol is available in your complex libdolfinx.so, but it contains “complex”. It’s not the same symbol reported missing. It looks like you have libdolfinx.so compiled correctly against petsc-complex, but the python component lib/python3.8/dist-packages/dolfinx/cpp.cpython-38-x86_64-linux-gnu.so was not. It seems to be built against the real version.

I recommend setting PETSC_DIR to point at the complex installation, without using PETSC_ARCH.

Please report your cmake output.

Please report your cmake output.

An idea is to delete this file from the system, as if this points to the same cpp.cpython file for real and complex, it might struggle with going between versions (real, then complex).
The python installer (pip3) doesn’t remove old files when recompiling, which can cause it to think some functions in the pybind layer have already been compiled).

My cmake report is

(fenicsx) ekrem@ekrem-TP501UB:~/Dev/fenicsx/repos/src/dolfinx/build-complex$ PETSC_DIR=$PETSC_DIR/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=${DOLFIN_CMAKE_CXX_FLAGS} ../cpp
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.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
-- Found MPI_C: /home/ekrem/Dev/fenicsx/installation/openmpi/lib/libmpi.so (found suitable version "3.1", minimum required is "3") 
-- Found MPI_CXX: /home/ekrem/Dev/fenicsx/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 Python3: /home/ekrem/Dev/fenicsx/bin/python3 (found version "3.8.10") found components: Interpreter 
-- 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 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 filesystem 
-- Adding /home/ekrem/Dev/fenicsx/lib/python3.8/site-packages/basix to Basix/xtensor/xtl search hints
-- Performing Test arch_native_supported
-- Performing Test arch_native_supported - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for one of the modules 'petsc;PETSc'
-- Test PETSC_TEST_RUNS with shared library linking - Success
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of PetscInt
-- Check size of PetscInt - done
-- Looking for PETSC_USE_COMPLEX
-- Looking for PETSC_USE_COMPLEX - found
-- Found PETSc: TRUE (found suitable version "3.16.1", minimum required is "3.10") 
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /home/ekrem/Dev/fenicsx/installation/hdf5/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.12.1") found components: C 
-- HDF5_DIR: HDF5_DIR-NOTFOUND
-- HDF5_DEFINITIONS: 
-- HDF5_INCLUDE_DIRS: /home/ekrem/Dev/fenicsx/installation/hdf5/include
-- HDF5_LIBRARIES: /home/ekrem/Dev/fenicsx/installation/hdf5/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so
-- HDF5_HL_LIBRARIES: 
-- HDF5_C_DEFINITIONS: 
-- HDF5_C_INCLUDE_DIR: 
-- HDF5_C_INCLUDE_DIRS: /home/ekrem/Dev/fenicsx/installation/hdf5/include
-- HDF5_C_LIBRARY: 
-- HDF5_C_LIBRARIES: /home/ekrem/Dev/fenicsx/installation/hdf5/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so
-- HDF5_C_HL_LIBRARY: 
-- HDF5_C_HL_LIBRARIES: 
-- Defined targets (if any):
-- ... hdf5::hdf5
-- Asking Python module FFCx for location of UFC... ()
-- Found UFC: /home/ekrem/Dev/fenicsx/lib/python3.8/site-packages/ffcx/codegeneration (Required is at least version "0.3") 
-- Found MPI_C: /home/ekrem/Dev/fenicsx/installation/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI_CXX: /home/ekrem/Dev/fenicsx/installation/openmpi/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found ADIOS2: /home/ekrem/Dev/fenicsx/installation/adios2/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.7.1", minimum required is "2.7.1") found components: C CXX MPI 
-- Checking for package 'SCOTCH-PT'
-- Found SCOTCH (version 6.1.1)
-- Performing test SCOTCH_TEST_RUNS
-- Performing test SCOTCH_TEST_RUNS - Success
-- Found SCOTCH: /home/ekrem/Dev/fenicsx/installation/petsc/linux-gnu-complex-32/lib/libptscotch.a;/home/ekrem/Dev/fenicsx/installation/petsc/linux-gnu-complex-32/lib/libscotch.a;/home/ekrem/Dev/fenicsx/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")
-- Checking for package 'KaHIP'
-- KaHIP could not be found/configured. (missing: KAHIP_INCLUDE_DIRS KAHIP_LIBRARIES KAHIP_TEST_RUNS) 
-- 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_ENABLE_ADIOS2, Compile with support for ADIOS2.
 * DOLFINX_ENABLE_PARMETIS, Compile with support for ParMETIS.
 * DOLFINX_ENABLE_SCOTCH, Compile with support for SCOTCH.
 * DOLFINX_ENABLE_KAHIP, Compile with support for KaHIP.

-- The following OPTIONAL packages have been found:

 * ADIOS2 (required version >= 2.7.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 REQUIRED packages have been found:

 * Python3
 * boost_chrono (required version == 1.71.0)
 * boost_timer (required version == 1.71.0)
 * boost_headers (required version == 1.71.0)
 * boost_filesystem (required version == 1.71.0)
 * Boost (required version >= 1.70), Boost C++ libraries, <http://www.boost.org>
 * Basix
 * xtensor (required version >= 0.23.10), C++ library for numerical analysis with multi-dimensional array expressions., <https://xtensor.readthedocs.io/>
 * PkgConfig
 * PETSc (required version >= 3.10), 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>
 * UFC (required version >= 0.3), Unified interface for form-compilers (part of FFCx), <https://github.com/fenics/ffcx>
 * MPI

-- The following features have been disabled:

 * DOLFINX_SKIP_BUILD_TESTS, Skip build tests for testing usability of dependency packages.
 * XTENSOR_USE_XSIMD, Enable SIMD with xtensor (xsimd).
 * XTENSOR_OPTIMIZE, Enable architecture-specific optimizations as defined by xtensor.

-- The following OPTIONAL 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
 * KaHIP, A family of graph partitioning programs, <https://kahip.github.io/>
   Parallel graph partitioning

-- 
-- Copying demo and test data to build directory.
-- ----------------------------------------------
-- 
-- Generating form files in demo and test directories. May take some time...
-- ----------------------------------------------------------------------------------------
-- 
-- Generating CMakeLists.txt files in demo directory
-- -------------------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ekrem/Dev/fenicsx/repos/src/dolfinx/build-complex
(fenicsx) ekrem@ekrem-TP501UB:~/Dev/fenicsx/repos/src/dolfinx/build-complex$ ninja install
[64/65] Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/libdolfinx.so.0.3.1.0
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/libdolfinx.so.0.3
-- Set runtime path of "/home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/libdolfinx.so.0.3.1.0" to "/home/ekrem/Dev/fenicsx/installation/basix/lib:/home/ekrem/Dev/fenicsx/installation/hdf5/lib:/home/ekrem/Dev/fenicsx/installation/adios2/lib:/home/ekrem/Dev/fenicsx/installation/petsc/linux-gnu-complex-32/lib:/home/ekrem/Dev/fenicsx/installation/openmpi/lib"
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/libdolfinx.so
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXTargets.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXTargets-relwithdebinfo.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/defines.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/dolfin_common.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/dolfin_doc.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/IndexMap.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/init.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/log.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/loguru.hpp
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/sort.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/math.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/MPI.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/subsystem.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/Table.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/Timer.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/TimeLogger.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/TimeLogManager.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/timing.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/UniqueIdGenerator.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/common/version.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/Constant.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/CoordinateElement.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/DirichletBC.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/DofMap.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/ElementDofLayout.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/Expression.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/FiniteElement.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/Form.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/Function.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/FunctionSpace.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/assembler.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/assemble_matrix_impl.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/assemble_scalar_impl.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/assemble_vector_impl.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/discreteoperators.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/dofmapbuilder.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/dolfin_fem.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/interpolate.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/petsc.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/sparsitybuild.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/fem/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/generation/BoxMesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/generation/dolfin_generation.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/generation/IntervalMesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/generation/RectangleMesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/geometry/BoundingBoxTree.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/geometry/gjk.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/geometry/dolfin_geometry.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/geometry/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/graph/AdjacencyList.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/graph/dolfin_graph.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/graph/ordering.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/graph/partitioners.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/graph/partition.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/dolfin_io.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/ADIOS2Writers.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/cells.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/HDF5Interface.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/pugiconfig.hpp
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/pugixml.hpp
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/VTKFile.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/XDMFFile.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/xdmf_function.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/xdmf_mesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/xdmf_meshtags.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/xdmf_read.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/io/xdmf_utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/dolfin_la.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/PETScKrylovSolver.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/PETScMatrix.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/PETScOperator.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/PETScOptions.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/PETScVector.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/SLEPcEigenSolver.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/SparsityPattern.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/la/Vector.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/dolfin_mesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/Mesh.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/Geometry.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/Topology.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/MeshTags.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/cell_types.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/graphbuild.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/permutationcomputation.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/topologycomputation.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/mesh/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/nls/dolfin_nls.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/nls/NewtonSolver.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/refinement/dolfin_refinement.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/refinement/plaza.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/refinement/refine.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/include/dolfinx/refinement/utils.h
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/FindPETSc.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/FindSLEPc.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXConfig.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/cmake/dolfinx/DOLFINXConfigVersion.cmake
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/pkgconfig/dolfinx.pc
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/dolfinx/dolfinx.conf
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/CMakeLists.txt
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson/poisson.ufl
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson/CMakeLists.txt
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson/poisson.c
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson/main.cpp
-- Installing: /home/ekrem/Dev/fenicsx/installation/dolfinx-complex/share/dolfinx/demo/poisson/poisson.h
----------------------------------------------------------------------------
DOLFINx has now been installed in

    /home/ekrem/Dev/fenicsx/installation/dolfinx-complex

and demo programs have been installed in

    /home/ekrem/Dev/fenicsx/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/ekrem/Dev/fenicsx/installation/dolfinx-complex/lib/dolfinx/dolfinx.conf

I got the same error using the docker container, only for the complex build. I report it here:

>>> import dolfinx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/__init__.py", line 33, in <module>
    from dolfinx import common
  File "/usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/common.py", line 10, in <module>
    from dolfinx import cpp as _cpp
ImportError: /usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/cpp.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN7dolfinx3fem5petsc18create_matrix_nestERKSt6vectorIS2_IPKNS0_4FormIdEESaIS6_EESaIS8_EERKS2_IS2_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISI_EESaISK_EE

the problem remains if i do

export PETSC_DIR=/usr/local/petsc/linux-gnu-complex-64
export PETSC_ARCH=

the file in

/usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/cpp.cpython-310-x86_64-linux-gnu.so

is equal to its counterpart in the real build, maybe the error is there.
if I delete it I got this error

ImportError: cannot import name 'cpp' from partially initialized module 'dolfinx' (most likely due to a circular import) (/usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/__init__.py)

could you update the docker container?

How did you activate the complex environment in the dolfinx/dolfinx container?

If you have deleted source files you would need to recreate a docker container based on the dolfinx/dolfinx image.

I have exactly the same problem. It worked fine a few month ago.

I activated the complex environment with:

source /usr/local/bin/dolfinx-complex-mode

to perform these tests every time I stop, remove and run a new container