Hello,
I succesfully installed version 0.8.0 of dolfinx via spack. Now I try to install dolfinx_mpc on top, but I get an error message for the python part and do not know how to solve the issue.
I even do not understand what the issue might be. Can you help me? Is there a problem of nanobind
?
(The C++ part of dolfinx_mpc worked.)
python3 -m pip -v install --config-settings=cmake.build-type="Release" --config-settings=cmake.args="-DCMAKE_PREFIX_PATH=/xxx/spack/opt/spack/linux-rhel8-sapphirerapids/gcc-12.2.0/py-fenics-dolfinx-0.8.0-iwefi66rgtsh5ruth6pohzu3ngkt6jcy/share/dolfinx_mpc/" --no-build-isolation ./python -U
Using pip 24.0 from /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/pip (python 3.11)
Processing ./python
Running command Preparing metadata (pyproject.toml)
*** scikit-build-core 0.9.4 using CMake 3.20.2 (metadata_wheel)
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.21 in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from dolfinx_mpc==0.8.0) (1.26.4)
Requirement already satisfied: cffi in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from dolfinx_mpc==0.8.0) (1.15.1)
Requirement already satisfied: petsc4py in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from dolfinx_mpc==0.8.0) (3.21.1)
Requirement already satisfied: mpi4py in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from dolfinx_mpc==0.8.0) (3.1.5)
Requirement already satisfied: fenics-dolfinx<0.9.0,>=0.8.0.dev0 in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from dolfinx_mpc==0.8.0) (0.8.0)
Requirement already satisfied: fenics-basix<0.9.0,>=0.8.0 in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from fenics-dolfinx<0.9.0,>=0.8.0.dev0->dolfinx_mpc==0.8.0) (0.8.0)
Requirement already satisfied: fenics-ffcx<0.9.0,>=0.8.0 in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from fenics-dolfinx<0.9.0,>=0.8.0.dev0->dolfinx_mpc==0.8.0) (0.8.0)
Requirement already satisfied: fenics-ufl<2024.2.0,>=2024.1.0 in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from fenics-dolfinx<0.9.0,>=0.8.0.dev0->dolfinx_mpc==0.8.0) (2024.1.0.post1)
Requirement already satisfied: pycparser in /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages (from cffi->dolfinx_mpc==0.8.0) (2.21)
Building wheels for collected packages: dolfinx_mpc
Running command Building wheel for dolfinx_mpc (pyproject.toml)
*** scikit-build-core 0.9.4 using CMake 3.20.2 (wheel)
*** Configuring CMake...
loading initial cache file /tmp/tmpufmkguva/build/CMakeInit.txt
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/mpicc - 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: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/mpicxx - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/python3 (found version "3.11.9") found components: Interpreter Development Development.Module Development.Embed
-- Found Basix at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib64/cmake/basix
-- Found MPI_C: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/mpicc (found version "3.1")
-- Found MPI_CXX: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/mpicxx (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Found Boost 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/Boost-1.85.0
-- Requested configuration: QUIET REQUIRED COMPONENTS timer;filesystem
-- Found boost_headers 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/boost_headers-1.85.0
-- Found boost_timer 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/boost_timer-1.85.0
-- [x] libboost_timer.so.1.85.0
-- [ ] libboost_timer.a
-- Adding boost_timer dependencies: headers
-- Found boost_filesystem 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/boost_filesystem-1.85.0
-- [x] libboost_filesystem.so.1.85.0
-- [ ] libboost_filesystem.a
-- Adding boost_filesystem dependencies: atomic;headers
-- Found boost_atomic 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/boost_atomic-1.85.0
-- [x] libboost_atomic.so.1.85.0
-- [ ] libboost_atomic.a
-- Adding boost_atomic dependencies: headers
-- Found Boost: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/Boost-1.85.0/BoostConfig.cmake (found suitable version "1.85.0", minimum required is "1.70") found components: timer filesystem
-- Found Python3: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/python3 (found version "3.11.9") found components: Interpreter
-- Adding /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/basix to Basix search hints
-- Found HDF5 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/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
-- Found HDF5: hdf5-shared (found version "1.14.3") found components: C
-- HDF5_DIR: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/cmake
-- HDF5_DEFINITIONS:
-- HDF5_INCLUDE_DIRS: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/include
-- HDF5_LIBRARIES: hdf5-shared
-- HDF5_HL_LIBRARIES:
-- HDF5_C_DEFINITIONS:
-- HDF5_C_INCLUDE_DIR:
-- HDF5_C_INCLUDE_DIRS: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/include
-- HDF5_C_LIBRARY: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/libhdf5.so.310.3.0
-- HDF5_C_LIBRARIES: hdf5-shared
-- HDF5_C_HL_LIBRARY:
-- HDF5_C_HL_LIBRARIES:
-- Defined targets (if any):
-- ... hdf5::hdf5
-- ... hdf5-static
-- ... hdf5-shared
-- Found PkgConfig: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/pkg-config (found version "2.2.0")
-- Checking for one of the modules 'PETSc;petsc'
-- Found ADIOS2: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib64/cmake/adios2/adios2-config.cmake (found suitable version "2.10.0", minimum required is "2.8.1") found components: C CXX MPI
-- Found DOLFINx at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib64/cmake/dolfinx
-- Found Boost 1.85.0 at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/cmake/Boost-1.85.0
-- Requested configuration: QUIET REQUIRED COMPONENTS timer;filesystem
-- Adding /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/basix to Basix search hints
-- Found DOLFINx_MPC at /xxx/spack/opt/spack/linux-rhel8-sapphirerapids/gcc-12.2.0/py-fenics-dolfinx-0.8.0-iwefi66rgtsh5ruth6pohzu3ngkt6jcy/share/dolfinx_mpc
-- Found petsc4py include directory at /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/include
-- Adding /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/dolfinx/wrappers to include directories
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmpufmkguva/build
*** Building project with Ninja...
[1/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_internals.cpp.o
[2/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_func.cpp.o
[3/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_enum.cpp.o
[4/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_type.cpp.o
[5/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_static_property.cpp.o
[6/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/nb_ndarray.cpp.o
[7/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/common.cpp.o
[8/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/error.cpp.o
[9/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/implicit.cpp.o
[10/14] Building CXX object CMakeFiles/nanobind-static.dir/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/src/trampoline.cpp.o
[11/14] Linking CXX static library libnanobind-static.a
[12/14] Building CXX object CMakeFiles/cpp.dir/dolfinx_mpc/dolfinx_mpc.cpp.o
[13/14] Building CXX object CMakeFiles/cpp.dir/dolfinx_mpc/mpc.cpp.o
FAILED: CMakeFiles/cpp.dir/dolfinx_mpc/mpc.cpp.o
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/mpicxx -DADIOS2_USE_MPI -DBOOST_TIMER_DYN_LINK -DBOOST_TIMER_NO_LIB -DDOLFINX_MPC_VERSION=\"0.8.0.0\" -DDOLFINX_VERSION=\"0.8.0\" -DHAS_ADIOS2 -DHAS_PARMETIS -DHAS_PETSC -Dcpp_EXPORTS -I/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/include -I/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/dolfinx/wrappers -I/xxx/spack/opt/spack/linux-rhel8-sapphirerapids/gcc-12.2.0/python-3.11.9-xjlo73wly2x5rip5ndqenjzx2syxpghi/include/python3.11 -I/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include -isystem /xxx/spack/opt/spack/linux-rhel8-sapphirerapids/gcc-12.2.0/py-fenics-dolfinx-0.8.0-iwefi66rgtsh5ruth6pohzu3ngkt6jcy/include -isystem /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/include -isystem /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/._view/c4trzb5wie4uzjjredcvcxkgvklimw2x/include -isystem /xxx/spack/opt/spack/linux-rhel8-sapphirerapids/gcc-12.2.0/petsc-3.21.1-wh4v4d6rbhw7eqvn3p5l4xrt3xu4bdfj/include -O3 -DNDEBUG -fPIC -fvisibility=hidden -fno-stack-protector -ffunction-sections -fdata-sections -std=c++2a -MD -MT CMakeFiles/cpp.dir/dolfinx_mpc/mpc.cpp.o -MF CMakeFiles/cpp.dir/dolfinx_mpc/mpc.cpp.o.d -o CMakeFiles/cpp.dir/dolfinx_mpc/mpc.cpp.o -c /xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp
/xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp: In Instanziierung von »void {anonymous}::declare_mpc(nanobind::module_&, std::string) [with T = float; U = float; std::string = std::__cxx11::basic_string<char>]«:
/xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp:351:28: von hier erfordert
/xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp:81:22: Fehler: keine passende Funktion für Aufruf von »nanobind::ndarray<nanobind::numpy, const float, nanobind::shape<-1> >::ndarray(const float*, <brace-enclosed initializer list>)«
81 | nb::ndarray<nb::numpy, const T, nb::ndim<1>>(data.data(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82 | {data.size()}),
| ~~~~~~~~~~~~~~
In Datei, eingebunden von /xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp:27:
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:388:14: Anmerkung: Kandidat: »template<class ... Args2> nanobind::ndarray<Args>::ndarray(const nanobind::ndarray<Args2 ...>&) [with Args2 = {Args2 ...}; Args = {nanobind::numpy, const float, nanobind::shape<-1>}]«
388 | explicit ndarray(const ndarray<Args2...> &other) : ndarray(other.m_handle) { }
| ^~~~~~~
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:388:14: Anmerkung: Herleitung/Ersetzung von Templateargument gescheitert:
/xxx/dolfinx_mpc080/python/dolfinx_mpc/mpc.cpp:81:22: Anmerkung: unpassende Typen »const nanobind::ndarray<Args ...>« und »const float*«
81 | nb::ndarray<nb::numpy, const T, nb::ndim<1>>(data.data(),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82 | {data.size()}),
| ~~~~~~~~~~~~~~
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:431:5: Anmerkung: Kandidat: »nanobind::ndarray<Args>::ndarray(nanobind::ndarray<Args>&&) [with Args = {nanobind::numpy, const float, nanobind::shape<-1>}]«
431 | ndarray(ndarray &&t) noexcept : m_handle(t.m_handle), m_dltensor(t.m_dltensor) {
| ^~~~~~~
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:431:5: Anmerkung: Kandidat erwartet 1 Argument, 2 angegeben
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:427:5: Anmerkung: Kandidat: »nanobind::ndarray<Args>::ndarray(const nanobind::ndarray<Args>&) [with Args = {nanobind::numpy, const float, nanobind::shape<-1>}]«
427 | ndarray(const ndarray &t) : m_handle(t.m_handle), m_dltensor(t.m_dltensor) {
| ^~~~~~~
....
....
....
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:382:14: Anmerkung: Kandidat erwartet 1 Argument, 2 angegeben
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:380:5: Anmerkung: Kandidat: »constexpr nanobind::ndarray<Args>::ndarray() [with Args = {nanobind::numpy, const int, nanobind::shape<-1>}]«
380 | ndarray() = default;
| ^~~~~~~
/xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/nanobind/include/nanobind/ndarray.h:380:5: Anmerkung: Kandidat erwartet 0 Argumente, 2 angegeben
ninja: build stopped: subcommand failed.
*** CMake build failed
error: subprocess-exited-with-error
Ă— Building wheel for dolfinx_mpc (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: /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/bin/python3 /xxx/spack/var/spack/environments/fenicsx080-env/.spack-env/view/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmp2jt1hfn9
cwd: /xxx/dolfinx_mpc080/python
Building wheel for dolfinx_mpc (pyproject.toml) ... error
ERROR: Failed building wheel for dolfinx_mpc
Failed to build dolfinx_mpc
ERROR: Could not build wheels for dolfinx_mpc, which is required to install pyproject.toml-based projects