-
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
Install libdrake.a C++ static library via CMake #16882
Comments
This sounds like a feature request on Drake, but I'm not sure exactly what feature you're requesting, or what problem you're trying to solve. Could you try to explain your desired result? Would it solve the problem if when doing If that's along the right path, then what should happen with the dependencies that are currently dynamically linked? Some of them are LGPL (LCM, dReal/IBEX), so we would either need to continue dynamically linking them, or else disable them. Similarly, when building statically, we'd need to disable pydrake (since Python loadable native modules are basically always dynamic). |
Yes, it will solve the issue. In fact, CMake has a built-in variable called The result will be a
The dynamic libraries that cannot be built statically (because of licensing or because of the way they are installed) should be installed/copied along with the static library.
Yes. My request is for C++ |
Ok, this makes sense. The feature request is for our CMake build to obey We'll need to do #16780 first (so that we have a C++ standalone build, with no Python), and then we can return to this issue. |
I was able to get one minimal static library build of Drake working by patching Bazel and doing some hacks. |
It seems that Bazel doesn't allow building a library as a static library by default, which is unfortunate as it means the users should either use the shared library or use Bazel as their build system all the way down.
There are multiple issues that report this in Bazel.
bazelbuild/bazel#1920
bazelbuild/bazel#492
There is one solution offered in the end. I tried it, but it lacks the libraries that Drakes uses (gflags).
bazelbuild/bazel#1920 (comment)
The text was updated successfully, but these errors were encountered: