-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Packaging for unsupported systems #14967
Comments
Thanks for your post! I'll leave the issue open for discussion for others in the community to participate, even if the work is unofficial. One related item is #1183 ("pip install pydrake"). We are currently planning out that work and will be starting implementation soon. As part of that, we will likely need to adapt the build to be more configurable about its external dependencies (e.g., to conform to one of the more recent "manylinux" standards). The methods we use there will likely be a good reference for other, non-Ubuntu platforms. As for a hint to get you started, it's possible that straight-up replacing the A couple of our externals are shipped in pre-compiled form, and those you'd have to rebuild or omit. For example, |
If anyone is interested in attempt to package drake on non-supported package managers using as much external dependency as possible, in the past I experimented in spare time in building drake with conda-forge dependencies (to eventually package drake in conda-forge to make it installable via
I was able so far to compile and test drake common (with the exception of two failed tests: traversaro/drake-conda-forge-build#1). The patch is currently full of workarounds, as I am by far not a Bazel expert, and I was not aware of @jwnimmer-tri suggestions in the last comment. However, it could be interesting for people attempting the same on other package managers. One thing for example that I noticed is that you for packaging on a distro different from the one supported, you may want to modify Another two things that I noticed that are missing for me at the moment and that probably apply to any packager:
|
Perhaps also worth noting is https://github.com/bazelbuild/rules_foreign_cc -- "Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja)". It's been a while since I last looked into it, and I don't have any practical experience, but it's the kind of that that might help out, if it works. |
I don't have any experience with bazel, so I'll have to dive into that, I did make some changes to the CMakeLists.txt to not error out straight away, but I'll read through the workplace stuff and your work @traversaro. |
Thanks! I checked in the past that repo, but it seems to contain mostly rules for building external libraries that use Make/CMake/Boost Build/Ninja, not for finding compiled/installed libraries that have CMake Config files. |
There's a wip fork now at ixil/drake and an aur package ixil/aur-drake that I'm using to test it out. |
I think rules_foreign only really makes sense for projects that employ tricks with their build system that are cumbersome or impossible to replicate with Bazel. Current VTK is a good example. As far as reading CMake config files, that is a hard problem. I think there has been interest in making them more standardized, but that would be years away. Using CMake to parse the files using find_package from a generated otherwise empty project would be the way forward. |
FWIW I am also interested in Arch. It matches up pretty well with Homebrew in versions, but is more accessible for developers. Alpine is also interesting because of its small size, which is good for a lot of hardware. |
In related news, one side-effect of #17231 is that we will be building a lot more of our dependencies from source (instead of linking to Ubuntu's shared libraries), which should make it easier to build on non-Ubuntu systems. |
Just a quick, general update here -- with our work on #17231 and #19023 and wheel builds, we're closer to this goal than ever. If there are community members working on ports, where you are curating patches to Drake to get it to build on other distributions, please feel free to link those patches / branches here. If I see things in the patch where we can refactor Drake to make it a simpler or narrower patch, I'm happy to help work on that consolidation from the Drake side. Ideally, there would be relatively few places in Drake that require patching, and eventually we can declare that Drake should build on any reasonably modern Linux distribution. |
Can be drake build without bazel? Can be drake build partially only using dependencies from for example Debian or Ubuntu or Fedora? |
Not really. (Technically the project is open-source, so someone could write new pile of CMakeLists.txt files from the ground up, but to build using the code as-is requires running Bazel.) Drake offers a CMakeLists.txt entry point that accepts traditional settings (install prefix, debug/release, strip, etc.) for compatibility, but then under the hood converts those CMake options to Bazel options and shells out to Bazel to do the build.
Are you asking whether Drake can build without downloading externals? That is not directly supported. The default WORKSPACE file is set up to download and patch the necessary versions of most externals. Or are you asking whether Drake has any kind of options to turn off features, to make the dependency footprint smaller? There are very few options for that -- only the commercial solvers (SNOPT, Mosek, Gurobi) have an on/off option. A few of the other open-source solvers have (unsupported) flags to opt-out of them. But other than those few things, no -- most build-time dependencies are mandatory. |
As you can see in some of the PRs linked above, I've done some work on unwinding the "hard-coded to Ubuntu" logic in the Drake build system. I still have about 6 more patches I need to finish and land, but once that's done the "build Drake" step should be somewhat platform-independent. The "setup Drake" step (installing the dependencies like glib, X, etc.) will still be hard-coded to Ubuntu but should be pretty easy for other platforms to figure out the analogous steps. |
Hi @jwnimmer-tri, (I am posting my questions here instead on Stack Overflow, because you said that you were leaving this issue open for discussion and people complained rightfully on Stack Overflow that my questions about developer's plan do not fit on there) it seems like you are close to achieving platform-independent building yourself.
I am asking, because I have to port drake to OpenSUSE. I really like and want to use the Drake simulator because of its area-based hydro-elastic contact and friction modelling.
3.1) If the WORKSPACE file is indeed the central lever, how come two (one is unfinished though) forks with similar intentions did not change it? master...ixil:drake:master (I think this is unfinished) master...jwnimmer-tri:drake:bookworm Thank you very much |
You have good timing. In #21075 just a few days ago, we reached the deprecation window cutoff for some OS-specific code, and were finally able to delete it. I've opened #21089 now with some more clean-ups, that might be enough to build on other linuxen without further changes. In any case, whatever attempts you make please start from #21089 as a basis, to save yourself some trouble.
That's not something I can answer. The question is fundamentally about what unknown bugs / challenges still lie in wait for you. The only way to know that is for you (and others) to try it, and report back. I think it's fair to say that as of #21089 we've probably solved all of the problems that have been previously identified, so there is a real chance that it's simple to accomplish.
For the bookworm branch, the answer is easy -- Debian Bookworm and Ubuntu Jammy are roughly synonymous. They are similar enough that just convincing the build system that we're actually running on Jammy gets us most/all of the way there. The gist of the WORKSPACE file is that it's the lever by which to control where Drake's dependencies come from. If someone is trying to package Drake into another package manager, then they will need to change that. For example, they might want to use the distribution's build of If you're just a user trying to compile Drake from source on your own computer, then the situation is much simpler. The hope is that the current
Assuming you're just trying to build from source, rather than submit Drake into a package manager / distribution: (1) Install the necessary prereqs in OpenSUSE. For Ubuntu we have scripts under https://github.com/RobotLocomotion/drake/tree/master/setup/ubuntu to accomplish this, which are probably a good reference (in particular, the text files; less so the bash scripts). You'll probably need to create your own list commands to do a similar thing. You can also just take a best swing at it, try a build, and then circle back if there was something missing. (2) Run the CMake build ( For eigen, fmt, spdlog in particular you can directly tell CMake how and where to find them (and then it will not use |
For anyone interested: I have created a WIP GitHub repository https://github.com/hedaniel7/Drake-OpenSUSE-Integration where I am currently trying to integrate Drake in a OpenSUSE docker image.
I will post further specific questions on Stack Overflow and "report back" by documenting my progress in the repository's README.md |
I'll use this post to collect some new problems we've seen, and continue to add more as we find them:
|
Is there any interest in expanding the ability for external/unofficial distribution / packaging of drake?
It does not seem to be a part of #14695, but I also imagine it's not a priority for the team.
However, I am interested in attempting it.
In particular I am attempting to package drake for Archlinux.
At the moment it's a bit of a battle since the packaging for drake is so tightly coupled to the system (which maybe related to bazel).
If there are other's interested it would be good to know.
Cheers
The text was updated successfully, but these errors were encountered: