-
Notifications
You must be signed in to change notification settings - Fork 22
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 option/cache variable naming #991
Conversation
The CMake GUI for a configuraiton with python, nvtx, tests and CUDA_ARCH=86 under linux currently looks like: Which can be grouped And ADVANCED exposes a bunch of options which most users shouldn't mind. For now, I've left CUDA_ARCH alone, as it might be dissapearing (#976). Similar changes need making to the vis repo, and the docs repo will need a tweak as well. I've potentially still missed some CACHE variables / conditional options that are not in the top level CMake or other obvious locations, so I need to hunt those down. @Robadob - any thoughts on Renaming I Might renable the NVCC_THREADS related options too, so they are neighbours in the list, not 100%. |
No preference. P.S. Not seen that grouping before. |
It's a checkbox next to the Advanced checkbox, just seems to group cache vars by splitting upto the first
|
Configuring individual examples from the individual example directory, has the following advanced grouped GUI entry, this is due to where options / cache variables are mostly set (the root CMakeLists.txt).
This is a little complicated though, as to what options should be available in this case. A lot of options e.g. python/tests/exampeles aren't relevant, but other options are:
I guess these options should be deinfed in |
e0ae6d3
to
fff1dc8
Compare
CMake Vis build failures due to Windows has a few extra CMake macros and functions always have global scope, so like the options / cache variables we need to prefix them to avoid collisions. Duplicated code within the vis repo will want a its own versions that set relevant settings there. Should probably add global include guards all over the shop too. There's not a strong convention within CMake Modules (files) to have a particular naming pattern, but they now (internally) try to prefix functions with the module name, with a Upper Camel module name, then upper Snake case for function names? https://gitlab.kitware.com/cmake/cmake/-/commit/fa5055eb565666d14231a4abf335591b69bcd14d |
4fd409e
to
2865ec8
Compare
Testing in Windows was worth it as I had missed an important line of CMake when copying the dlls. Vis builds tested on python and windows, vis and non vis on linux have been tested. Also updated the freshly merged CTest logic in, making sure things are marked as advanced etc too. This is now ready for review, but prior to merge does need the vis hash updating after FLAMEGPU/FLAMEGPU2-visualiser#110 has been merged. A fresh build directory / configure is probably worthwhile if you want to see the correct state of the CMake UI after this change. It might actually be worth prefixing compile time defines with |
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.
Changes seem thorough and worthwhile.
Nothing obvious stands out as missing, I'm not in a position to do a local build but CI seems happy.
2865ec8
to
cc5c534
Compare
I've now also prefixed the preprocessor macros with FLAMEGPU, to avoid windows.h MAX style issues. I've also made the preproc definitions CMake target public where they are required in flamegpu headers (so they match the static lib, even if the user would attempt to redefine them). And also made a minor fix to CMAKE_CUDA_ARCHITECTURES, as in the vis repo. Commits are still individual for now, but will manually squash once the vis hash is finalised. I've tested builds locally with all the modified values having different options, with both test suites passing in both cases (thoguh I didn't explicitly check behaviour). |
b393206
to
6e1ce4a
Compare
This should be in a state to be merged once CI passes, however the telemetyr PR has slightly broken python testing, when running the tests on
It just stops there rather than progressing, with no errors etc. Running via |
…mprovments + Adds top-level CMakeLists.txt detection to the root CMakeLists.txt + Prefixes CMake options / CACHE variables with FLAMEGPU_ to cooperate with others, including: + BUILD_EXAMPLE_<example> -> FLAMEGPU_BUILD_EXAMPLE_<example> as dependent options + FLAMEPGU_BUILD_ALL_EXAMPLES -> FLAMEGPU_BUILD_ALL_EXAMPLES + Defaults to ON only if the main FLAMEGPU CMakeLists is the top level, removing the need for NO_EXAMPLES + BUILD_SWIG_PYTHON -> FLAMEPGU_BUILD_PYTHON + USE_NVTX -> FLAMEGPU_ENABLE_NVTX + USE_GLM -> FLAMEGPU_ENABLE_GLM + CURAND_ENGINE -> FLAMEGPU_CURAND_ENGINE, including a dropdown in the GUI + Removes USE_NVCC_THREADS + NVCC_THREADS -> FLAMEGPU_NVCC_THREADS which defaults to 2, and handles being set to OFF correctly. + VERBOSE_PTXAS -> FLAMEGPU_VERBOSE_PTXAS + BUILD_TESTS -> FLAMEGPU_BUILD_TESTS + BUILD_TESTS_DEV -> FLAMEGPU_BUILD_TESTS_DEV + EXPORT_RTC_SOURCES -> FLAMEGPU_RTC_EXPORT_SOURCES + RTC_DISK_CACHE -> FLAMEGPU_RTC_DISK_CACHE + WARNINGS_AS_ERRORS -> FLAMEGPU_WARNINGS_AS_ERRORS + SEATBELTS -> FLAMEGPU_SEATBELTS + BUILD_API_DOCUMENTATION -> FLAMEGPU_BUILD_API_DOCUMENTATION + VISUALIASTION -> FLAMEGPU_VISUSALISATION + And associated sub-optons FLAMEGPU_VISUALISATION_ROOT etc. + USE_GTEST_DISCOVER -> FLAMEGPU_ENABLE_GTEST_DISCOVER + Switch to CMAKE_CUDA_ARCHITECTURES from CUDA_ARCH with custom default setting + Mark many CMake Cache varaibles as advanced to exclude them from the default CMake GUI + Improves cpplint CMake logic + Move definition location of some CMake options, so they are pulled into individual examples + Prefix Cmake functions and macros with flamegpu_ and rename to all lower case, including: + add_flamegpu_executable -> flamegpu_add_executable + Use target-specific c++17 specification + Correct cmake_minimum_required statements and add a <polciy_max> of 3.25 + Modernise GLM CMake + De-duplicate compiler definition for the pyflamegpu target, using properties from the flamegpu target + Reduce use of cmake variables from the visualiser CMake, instead request a list of (dll) files to copy is needed + Move flamegpu target specific compiler definitions into private/public target properties + Prefix flamegpu compiler definitions with FLAMEGPU_ + SEATBELTS -> FLAMEGPU_SEATBELTS + VISUASLIATION -> FLAMEGPU_VISUSALISATION + CURAND_<X>->FLAMEGPU_CURAND_<X> + USE_GLM -> FLAMEGPU_USE_GLM + USE_GLM_PATH -> FLAMEGPU_USE_GLM_PATH + DISABLE_RTC_DISK_CACHE -> FLAMEGPU_DISABLE_RTC_DISK_CACHE + OUTPUT_RTC_DYNAMIC_FILES -> FLAMEGPU_OUTPUT_RTC_DYNAMIC_FILES + Updates the visualisation repository hash
6e1ce4a
to
0eb17fe
Compare
Refactor CMake: Option names, use CMAKE_CUDA_ARCHITECTURES, general improvments
Closes #837
Closes #976
Closes #448
Closes #732