Re: [Help needed] Build openvdb with nanobind requirement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 5, 2025 at 3:51 AM Sandro <lists@xxxxxxxxxxxxx> wrote:
>
> On 05-04-2025 09:32, Sandro wrote:
> >> Also, upstream nanobind provides a small script to find the right
> >> path; upstream openvdb should probably be suggested to use that:
> >> $ python3 -c 'import nanobind; print(nanobind.cmake_dir())'
> >> /usr/lib/python3.13/site-packages/nanobind/cmake
> >
> > I think that's what should be used in nanobind-config.cmake "internally"
> > and returned to the package trying to find it.
>
> Interestingly, in the package where I crossed paths with nanobind, they
> use something similar:
>
> # Detect the installed nanobind package and import it into CMake
> execute_process(
>      COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
>      OUTPUT_STRIP_TRAILING_WHITESPACE
>      OUTPUT_VARIABLE nanobind_ROOT
> )
> find_package(nanobind CONFIG REQUIRED)
>
> Basically, calling `python3 -m nanobind --cmake`.
>
> I still think something like nanobind_ROOT should be provided and
> returned as part of `find_package(nanobind)`.
>

No, that's backwards of the way nanobind works. The nanobind helper is
intended to work in Python venvs. In a venv, nanobind cannot install
in a CMake standard path, so downstream CMake users must call the
helper and add the path before searching for the CMake config.

In Fedora, we can ourselves move the CMake files to a standard path,
and modify the script to return that location, but the script should
still be the entry point. Some inspiration for this can be taken from
nanobind's precursor, pybind11, which ha sits CMake files in a
standard directory, but also patches the helper script to point to the
right place.

-- 
Elliott
-- 
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux