-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fix inconsistency between the building doc and CMakeLists.txt #1248
Merged
rapids-bot
merged 3 commits into
rapidsai:branch-23.04
from
yong-wang:imp-doc-and-cmakelists
Feb 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably want to leave this as defaulting to
${BUILD_TESTS}
, otherwise tests will be extremely slow to compile. Actually, perhaps this really should default to ON if we're building tests or benchmarks, since the same is true in either case. @cjnolet WDYT?I'm not sure what the best way is to document this default; it may just have to be written in words in build.md rather than relying on a simple ON/OFF entry in the table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we definitely want to keep this defaulting to build tests (and I agree it probably should default BUILD_TESTS | BUILD_BENCH. We rely on this to make sure really expensive specializations are compiled once (in libraft-distance/libraft-nn) and reused.
As for the docs, I think we could update the description in this table to maybe mention that it defaults to ON because BUILD_TESTS defaults to on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about filling the "Default Value" column with
${BUILD_TESTS}
in the table? Does it look reasonable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I searched the web but didn't find any easy way to evaluate things like
BUILD_TESTS OR BUILD_BENCH
inside anoption()
.I'm not familiar with CMake. Any suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cc @robertmaynard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake doesn't support that kind of expression evaluation. AFAIK the canonical solution would be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the table, I think no matter what you put in the column you'll probably need to explain it a bit in words.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds exactly like the use case for
cmake_dependent_option
which allows for complex initialization of cache variables.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestions.
I tried
cmake_dependent_option
, but when bothBUILD_TESTS
andBUILD_BENCH
areOFF
, could not setRAFT_COMPILE_LIBRARIES
toON
from the command line. According to CMake doc,RAFT_COMPILE_LIBRARIES
is hidden from the user in this case.So I used Vyas' way to set the default value. Also updated the table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not aware of
cmake_dependent_option
, that's cool. It does seem from the docs like the way the option may be hidden is incompatible with our needs in this case, though.