Skip to content

Compile error on GPU #180

@stubbiali

Description

@stubbiali

I'm trying to build the Python binding on Alps.Santis with GPU enabled, but I keep getting this error when compiling bindings/python/src/_pyghex/mpi_comm_shim.cpp:

/users/subbiali/.cache/uv/git-v0/checkouts/0537b1d158fcb24c/3b059c31/bindings/python/src/_pyghex/mpi_comm_shim.cpp:102:53: error: ambiguous template instantiation for 'struct
      pybind11::detail::initimpl::factory<pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>, pybind11::detail::void_type (*)(), pyghex::mpi_comm_shim(pybind11::object),
      pybind11::detail::void_type()>'
        102 |     mpi_comm.def(pybind11::init<>())
            |                                                     ^
        103 |         .def(pybind11::init([](pybind11::object o) { return mpi_comm_shim(o); }), "mpi_comm_obj"_a,
            |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /users/subbiali/.cache/uv/builds-v0/.tmpUEkUnE/lib/python3.11/site-packages/pybind11/include/pybind11/detail/init.h:374:8: note: candidates are: 'template<class Func, class Return, class ...
      Args> struct pybind11::detail::initimpl::factory<Func, pybind11::detail::void_type (*)(), Return(Args ...), __remove_pointer(__remove_reference(pybind11::detail::void_type (*)()))> [with Func =
      pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>; Return = pyghex::mpi_comm_shim; Args = {pybind11::object}]'
        374 | struct factory<Func, void_type (*)(), Return(Args...)> {
            |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /users/subbiali/.cache/uv/builds-v0/.tmpUEkUnE/lib/python3.11/site-packages/pybind11/include/pybind11/detail/init.h:413:8: note:                 'template<class CFunc, class AFunc,
      class CReturn, class ... CArgs, class AReturn, class ... AArgs> struct pybind11::detail::initimpl::factory<CFunc, AFunc, CReturn(CArgs ...), AReturn(AArgs ...)> [with CFunc =
      pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>; AFunc = pybind11::detail::void_type (*)(); CReturn = pyghex::mpi_comm_shim; CArgs = {pybind11::object}; AReturn =
      pybind11::detail::void_type; AArgs = {}]'
        413 | struct factory<CFunc, AFunc, CReturn(CArgs...), AReturn(AArgs...)> {
            |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /users/subbiali/.cache/uv/git-v0/checkouts/0537b1d158fcb24c/3b059c31/bindings/python/src/_pyghex/mpi_comm_shim.cpp:102:53: error: invalid use of incomplete type 'struct
      pybind11::detail::initimpl::factory<pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>, pybind11::detail::void_type (*)(), pyghex::mpi_comm_shim(pybind11::object),
      pybind11::detail::void_type()>'
        102 |     mpi_comm.def(pybind11::init<>())
            |                                                     ^
        103 |         .def(pybind11::init([](pybind11::object o) { return mpi_comm_shim(o); }), "mpi_comm_obj"_a,
            |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /users/subbiali/.cache/uv/builds-v0/.tmpUEkUnE/lib/python3.11/site-packages/pybind11/include/pybind11/detail/init.h:369:42: note: declaration of 'struct
      pybind11::detail::initimpl::factory<pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>, pybind11::detail::void_type (*)(), pyghex::mpi_comm_shim(pybind11::object),
      pybind11::detail::void_type()>'
        369 |           typename = function_signature_t<AFunc>>
            |                                          ^~~~~~~
      /users/subbiali/.cache/uv/builds-v0/.tmpUEkUnE/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h: In instantiation of 'Ret pybind11::init(Func&&) [with Func =
      pyghex::register_mpi(pybind11::module&)::<lambda(object)>; Ret = detail::initimpl::factory<pyghex::register_mpi(pybind11::module&)::<lambda(object)>, detail::void_type (*)(),
      pyghex::mpi_comm_shim(object), detail::void_type()>]':
      /users/subbiali/.cache/uv/git-v0/checkouts/0537b1d158fcb24c/3b059c31/bindings/python/src/_pyghex/mpi_comm_shim.cpp:102:53:   required from here
        102 |     mpi_comm.def(pybind11::init<>())
            |                                                     ^
        103 |         .def(pybind11::init([](pybind11::object o) { return mpi_comm_shim(o); }), "mpi_comm_obj"_a,
            |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /users/subbiali/.cache/uv/builds-v0/.tmpUEkUnE/lib/python3.11/site-packages/pybind11/include/pybind11/pybind11.h:2598:1: error: return type 'struct
      pybind11::detail::initimpl::factory<pyghex::register_mpi(pybind11::module&)::<lambda(pybind11::object)>, pybind11::detail::void_type (*)(), pyghex::mpi_comm_shim(pybind11::object),
      pybind11::detail::void_type()>' is incomplete
       2598 | Ret init(Func &&f) {
            | ^~~~

I'm using the uenv prgenv-gnu/25.6:v1 that comes with GCC 14.2.0 and NVIDIA 12.9.41.

The bindings build fine on CPU.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions