-
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
CMake options for solver opt-out #22547
Comments
@jwnimmer-tri This issue mentions a simple tweak is needed in cmake's generated bazelrc file. I wanted to confirm if the desired change is I also wanted to check for testing the options with drake_cmake_external, I would create the specific option(s) then pass them into ExternalProject_Add(drake_external_examples) via CMAKE_ARGS. Then, I would build locally to check if it build properly. On another note, is there any additional bazel documentaion or resources to better understand the workings of bazel.rc files? I just found https://bazel.build/run/bazelrc while looking over 22393. |
Best guess, the option(WITH_CLARABEL "Build with support for Clarabel" ON)
if(NOT WITH_CLARABEL)
string(APPEND BAZEL_CONFIG " --@drake//tools/flags:with_clarabel=False")
endif()
I don't know. Kitware are the CMake exports, hopefully you can find the answer in-house.
The link you have is the best one about the files themselves. I think it's pretty thorough. In terms of what flags to what, that's a question of whatever the bazel command line offers (rcfiles just tack things onto the command line) so https://bazel.build/reference/command-line-reference and and https://bazel.build/reference/be/general#config_setting. |
@jwnimmer-tri: It's unclear to me how drake-external-examples should be updated. The flags for open-source solvers in drake/tools/flags describes that we can't guarantee tests passing if one of the solvers is disabled. I understand wanting to test (and demonstrate) the CMake option, but I don't want to make a test here flake either? An alternative to just updating the call to |
That's talking about the full suite of Drake's own tests. The DEE examples use the solvers mostly not at all, so will not be a hazard. Something like (If we don't want to test via DEE that's fine too, but we need to test somewhere.) |
Is your feature request related to a problem? Please describe.
#22393 added flags for downstream Bazel users to opt-out of our open-source solvers (e.g., Clarabel). However, the need to opt-out applies equally well to downstream CMake users who are building and installing Drake from source.
Describe the solution you'd like
Offer CMake options to opt-out of the same solvers as the Bazel flags. (This should be as simple as tweaking CMake's generated bazelrc file to set the bazel flag when needed.
The options for open-source solvers should have the same truth sense as our options for commercial solvers, just with the opposite default, i.e.,
Update the documentation at https://drake.mit.edu/from_source.html to explain the new options.
Update
drake-external-examples/
(edit:drake_cmake_installed
drake_cmake_external
) to set one of the new options, as a way of documenting it & testing that they work.Describe alternatives you've considered
Users could make a magical
user.bazelrc
file to set the Bazel flag during a CMake build, but that's very awkward.Additional context
N/A
The text was updated successfully, but these errors were encountered: