Skip to content

Specify Python binding language in CMakeLists.txt #3734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged

Conversation

garth-wells
Copy link
Member

No description provided.

@garth-wells garth-wells added the nanobind Issues related to nanobindings label May 16, 2025
@garth-wells garth-wells enabled auto-merge May 16, 2025 16:51
@garth-wells garth-wells added this pull request to the merge queue May 16, 2025
Merged via the queue into main with commit 92e1890 May 16, 2025
28 checks passed
@garth-wells garth-wells deleted the py-cmake-lang branch May 16, 2025 17:40
@francesco-ballarin
Copy link
Member

Are we sure that we want to do this change right now?

After this change, my weekly FEM on Colab build fails with

Building wheels for collected packages: fenics-dolfinx
  Building wheel for fenics-dolfinx (pyproject.toml): started
  Building wheel for fenics-dolfinx (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Building wheel for fenics-dolfinx (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [70 lines of output]
      *** scikit-build-core 0.11.3 using CMake 4.0.0 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmprfxbd2vk/build/CMakeInit.txt
      Re-run cmake no build system arguments
      -- The CXX compiler identification is GNU 12.3.0
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/local/bin/mpicxx - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /usr/bin/python3 (found version "3.11.12") found components: Interpreter Development Development.Module Development.Embed
      -- Found MPI_CXX: /usr/local/bin/mpicxx (found version "3.1")
      -- Found MPI: TRUE (found version "3.1")
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
      -- Found Threads: TRUE
      -- Found Boost 1.88.0 at /usr/local/lib/cmake/Boost-1.88.0
      --   Requested configuration: REQUIRED
      -- Found boost_headers 1.88.0 at /usr/local/lib/cmake/boost_headers-1.88.0
      -- Checking for Basix hints with /usr/bin/python3
      -- Adding /usr/local/lib/python3.11/site-packages/basix to Basix search hints
      -- HDF5: Using hdf5 compiler wrapper to determine C configuration
      -- Found HDF5: /usr/local/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.14.3") found components: C
      -- HDF5_DIR: HDF5_DIR-NOTFOUND
      -- HDF5_DEFINITIONS:
      -- HDF5_INCLUDE_DIRS:
      -- HDF5_LIBRARIES: /usr/local/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so
      -- HDF5_HL_LIBRARIES:
      -- HDF5_C_DEFINITIONS:
      -- HDF5_C_INCLUDE_DIR:
      -- HDF5_C_INCLUDE_DIRS:
      -- HDF5_C_LIBRARY:
      -- HDF5_C_LIBRARIES: /usr/local/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so
      -- HDF5_C_HL_LIBRARY:
      -- HDF5_C_HL_LIBRARIES:
      -- Defined targets (if any):
      -- ... hdf5::hdf5
      -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
      -- Checking for one of the modules 'PETSc;petsc'
      -- Checking for one of the modules 'SLEPc;slepc'
      -- Found ADIOS2: /usr/local/lib/cmake/adios2/adios2-config.cmake (found suitable version "2.10.2", minimum required is "2.8.1") found components: CXX
      -- Found DOLFINx at /usr/local/lib/cmake/dolfinx
      -- Performing Test HAVE_PEDANTIC
      -- Performing Test HAVE_PEDANTIC - Success
      -- Found petsc4py include directory at /usr/local/lib/python3.11/dist-packages/petsc4py/include
      -- Found mpi4py include directory at /usr/local/lib/python3.11/dist-packages/mpi4py/include
      -- Configuring done (1.7s)
      CMake Error at /usr/local/lib/cmake/adios2/adios2-cxx11-targets.cmake:69 (set_target_properties):
        The link interface of target "adios2::cxx11_mpi" contains:
      
          MPI::MPI_C
      
        but the target was not found.  Possible reasons include:
      
          * There is a typo in the target name.
          * A find_package call is missing for an IMPORTED target.
          * An ALIAS target is missing.
      
      Call Stack (most recent call first):
        /usr/local/lib/cmake/adios2/adios2-config-common.cmake:211 (include)
        /usr/local/lib/cmake/adios2/adios2-config.cmake:29 (include)
        /usr/lib/python3.11/site-packages/cmake/data/share/cmake-4.0/Modules/CMakeFindDependencyMacro.cmake:78 (find_package)
        /usr/local/lib/cmake/dolfinx/DOLFINXConfig.cmake:123 (find_dependency)
        CMakeLists.txt:26 (find_package)
      
      
      -- Generating done (0.0s)
      CMake Generate step failed.  Build files cannot be regenerated correctly.
      
      *** CMake configuration failed
      [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

adios2 related discussions are in ornladios/ADIOS2#4255 and ornladios/ADIOS2#4082 but it seems to me that the corresponding commit ornladios/ADIOS2@8afa8af hasn't made it into a release yet.

@garth-wells
Copy link
Member Author

garth-wells commented May 24, 2025

Spack fails without the change.

@francesco-ballarin
Copy link
Member

OK, not a big deal: I easily backported ornladios/ADIOS2@8afa8af onto v2.10.2 of adios2.

cc-ing @drew-parsons @minrk , as we/they may need to do a similar job if the next release of dolfinx happens before v2.11 of adios2.

jmv2009 added a commit to jmv2009/dolfinx that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nanobind Issues related to nanobindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants