Replies: 2 comments 13 replies
-
A few quick thoughts: nanobind is designed to be compiled on the fly for each project, and it's small enough that this takes literally a second. Distributing pre-compiled versions of nanobind is not something that I would endorse. (It would also be complicated, because you would have to do this for different platforms, Python versions, while also handling the various parameters that can be passed to nanobind during compilation). In this way, nanobind is different from, say, Now that said, nanobind can be imported through CMake. In fact, this is how the pip distribution mechanism works. The PyPI file contains the CMake infrastructure and the C++ headers and source files so that other packages can run |
Beta Was this translation helpful? Give feedback.
-
I have a Fair warning: the changes in that branch aren't exactly minimal (nor all necessary), but I'm happy to break it up into smaller pieces. I think opening a PR with that branch and then have people comment, break out, document, or clean up as needed into other smaller PRs would be a decent idea? What do you think @wjakob? Importantly, I've kept support for compiling nanobind on the fly, i.e., my refactor installs the source files of nanobind and CMake to support finding/building, like how it's done now. While I think vcpkg should be fine with this, I also agree that it makes more sense to distribute nanobind this way for the reasons @wjakob mentions. Again, I know there are quite a few changes, and I'm happy to break some of it up (or explain it) for incremental merging/review, if there's a chance for integrating and supporting this. I also tried to update the documentation (let me know if I can add anything else), but for now, the CI (and I've been testing for compatibility with three branches on the nanobind_example repo:
Thank you for the great project!! |
Beta Was this translation helpful? Give feedback.
-
I would like to implement a vcpkg port for the
nanobind
library. This package manager uses CMake internally and supports many target platforms (Windows, Linux, MacOS, etc.). Using a package manager, thenanobind
library can be built once and used in many projects without rebuilding the dependencies.Unfortunately
nanobind
doesn't support building and installing using CMake (Pip or Conda only). This is a big limitation because the C/C++ package manager doesn't manage Python packages.I would suggest doing an alternative way of building a static or shared library (depending on the options requested), installing the binaries and headers, generating CMake configuration files using the helpers.
Related to microsoft/vcpkg#33401.
Related to #55, #291, #339.
Beta Was this translation helpful? Give feedback.
All reactions