-
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
Refactor and "clean up" superbuild logic #2758
Refactor and "clean up" superbuild logic #2758
Conversation
Definitely goes in the right direction. Unfortunately Jenkins seems to be having issues right now. Reviewed 5 of 5 files at r2. Comments from Reviewable |
Arf... will dig more tomorrow... I'm seeing at least one bug, also; it's not supposed to print "with dependencies" as part of "Preparing to build..." when there are no dependencies... apparently that's not working (on my machine either, even though I would've sworn I checked...) |
11385b3
to
b4ff705
Compare
4f6ba57
to
acb6e26
Compare
So, turns out dependencies for non-CMake externals were broken because I missed a spot renaming variables. Hopefully things are working now. (Windows CI seems okay as of a few builds back, and the changes to try to get Linux working shouldn't break them.) |
Please move the Also, the |
@mwoehlke-kitware the new names look good. Please squash that in when ready. |
Done.
It's intended to be the build environment setup, as opposed to user build options (which would be |
Refactor the top-level CMakeLists.txt (i.e. 'the superbuild') into several files, making use of CMake functions to organize the logic and eliminate some minor duplication. In particular, this converts the mostly-declarative (and somewhat superfluously repetitive) logic for setting up externals into more imperative/procedural logic that is hopefully better organized and easier to read. One particular change of note is that all special case "externals" have been removed in favor of new options `ALWAYS` and `LOCAL`, indicating, respectively, that an external is always enabled, and that an external is local to the repository (does not need download/update steps). This allows drake itself to be simply a `LOCAL`, `ALWAYS` subproject rather than having a completely separate block for setting up the subproject. The overall formatting and documentation (comments) of the superbuild logic has also been improved. Additionally, logic related to PODS has been removed.
Remove the top-level Makefile that was included for PODS compatibility. Users of drake should build drake as a 'typical' CMake project.
fa57ba2
to
e98bb28
Compare
Fix the error message when MSVC is too old; the old error message claimed to require "14", when it actually requires 19 (a.k.a. VS 2015). Also, note the Visual Studio release year in the message, which is more likely to be recognized by users than the internal monotonic version number.
df4c5c2
to
787840c
Compare
just tested this on my mac. looks like the source version is not getting passed through properly...
note also
but
|
Arf, sorry; setting the flags needs to be a quoted string. Patch coming shortly. |
787840c
to
1949629
Compare
Move the logic to set the Java compile flags so that Java will target the matlab JVM version from drake itself to the superbuild, and propagate Java options to all externals. This should address mismatches in the targeted Java version between drake itself, and externals such as LCM.
1949629
to
dc30cb6
Compare
Modify how drake_add_external processes parses user specified commands to allow delayed expansion of variables. This is required for variables which are defines by an external's required packages, as immediate expansion may expand to nothing. In particular, this fixes the build of textbook. (For some reason, it only seems to break with makefiles, even though it ought to be broken everywhere.)
jenkins: retest this please (CI seems clean and looks like I figured out the textbook problem — see last commit — but for some reason CI is showing up as failed in github...) |
Waiting on platform review... @sherm1, can you do that or reassign to someone that can? Thanks! |
Note: expected to fix #2772. |
I'll do platform the review of this one. We will also need @RussTedrake to do a build-and-test on his mac before merging. |
Makefile, line 1 [r7] (raw file): @RussTedrake I believe the deletion of Comments from Reviewable |
Yes, but also there are changes to the It's my understanding that we are moving away from PODS, but if that's not the case, or if we're not ready for this step yet, please let me know and I can back those changes out. |
Done with first read-through. I will want to test a bunch of this locally, which I will try to do today. Reviewed 1 of 8 files at r2, 4 of 7 files at r5, 1 of 4 files at r6, 3 of 3 files at r7. CMakeLists.txt, line 102 [r7] (raw file):
I don't understand what "in order of dependencies" means here. The immediately subsequent list is alphabetical, and the wider "external projects" section is not strictly in dependency order. CMakeLists.txt, line 202 [r7] (raw file):
Unclear what "FIXME" is referring to -- either the problem, or the suggested resolution, or ... Makefile, line 1 [r7] (raw file): Needs CHANGELOG.md entry documenting the removal of this feature. cmake/DrakeExamples.cmake, line 2 [r7] (raw file):
Please add an API comment explaining what this function does. For this (and the similar defects below) -- brevity is fine, a single sentence or so. I am content to let people read the source code to see the details, but I think capturing the big picture intent atop the function is important. cmake/DrakeExamples.cmake, line 5 [r7] (raw file):
BTW -- a META-comment for this PR (though marked as cmake/DrakeExternals.cmake, line 15 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakeExternals.cmake, line 45 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakeExternals.cmake, line 58 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakeExternals.cmake, line 83 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakeExternals.cmake, line 136 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakeExternals.cmake, line 183 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakePlatform.cmake, line 2 [r7] (raw file):
Please add an API comment explaining what this function does. cmake/DrakePlatform.cmake, line 24 [r7] (raw file):
I think this relies on Comments from Reviewable |
Makefile, line 1 [r7] (raw file):
Let's move this discussion to #2484. Comments from Reviewable |
is it still possible to "make clean" for a single external? (even by, e.g., zapping the right subdirectories from build?). for example, I've been trying to test your changes to lcm, and don't know how to do that with confidence without rebuilding all of the externals from scratch? if missing, can we add back those targets? Review status: all files reviewed at latest revision, 14 unresolved discussions. Comments from Reviewable |
i think you do not have enough testing capabilities to bring in this change right now. please extract the lcm java fix into a separate PR so that we can resolve that first. Review status: all files reviewed at latest revision, 13 unresolved discussions. Comments from Reviewable |
You can enter the external's build directory and run
One of the reasons I removed them is because they were broken. They nuked the build trees but not the stamp files needed to trigger a rebuild, so they'd leave the overall build in a broken state requiring manual intervention to repair.
Because CMake projects' clean target do not remove installed files, the only reliable way to do such a test (whether for LCM or for anything else) is to nuke the entire install tree and reinstall everything. While it's possible to nuke just the install-step stamp files, I usually find it easier to nuke all the stamps and rebuild everything. (Actually, since we always rebuild externals, you wouldn't save much trying to be more surgical anyway.) So the easiest way to do such a test is to remove |
rebuilding the entire tree is much slower. in the old way, I would manually zap the pod-build folders in the repo of interest, and any repo that I wanted to rebuild because it was a dependent. |
I think there is some confusion here. Note:
There are two ways to force a clean build of a CMake external:
This is the same as the procedure you are describing, except that the name of the build directory has changed (prior to this PR); see preceding statements in this comment. You do still need to nuke the install tree to clean it. However, disregard my prior statement about nuking all the stamps; this is not needed for Drake. Since we run the build steps always, and the install steps depend on the build steps, the install steps also always run. |
With |
Refactor the top-level CMakeLists.txt (i.e. 'the superbuild') into several files, making use of CMake functions to organize the logic and eliminate some minor duplication. In particular, this converts the mostly-declarative (and somewhat superfluously repetitive) logic for setting up externals into more imperative/procedural logic that is hopefully better organized and easier to read.
One particular change of note is that all special case "externals" have been removed in favor of new options
ALWAYS
andLOCAL
, indicating, respectively, that an external is always enabled, and that an external is local to the repository (does not need download/update steps). This allows drake itself to be simply aLOCAL
,ALWAYS
subproject rather than having a completely separate block for setting up the subproject.The overall formatting and documentation (comments) of the superbuild logic has also been improved. Also, the PODS Makefile and PODS-specific options have been removed.
This includes #2749. This is the first part of an overall effort to clean up the CMake logic for drake proper, which will include reducing or eliminating use of "PODS" and pkg-config.
Picking on @bradking for now for feature review, but feel free to punt to someone else. Review-wise, this is sufficiently close to a total rewrite that it likely makes more sense to simply compare the old and new files on the whole rather than try to review the diff/changes. Also, as the intent of this is to make the CMake logic "as clean as possible", please feel free to point out any areas that could benefit from further improvement.
This change is