-
Notifications
You must be signed in to change notification settings - Fork 43
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
Custom Doxygen executable to improve Sphinx builds #139
Conversation
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.
Overall this looks okay to me, pending the merge of the noted change to rocm-docs-core. My only concern at present is adding BUILDER
as a mandatory argument, I worry that will cause issues for backwards compatibility. I would prefer that this variable have a sane default (perhaps html
?), but am open to arguments.
get_filename_component(OUTPUT_DIR "${PARSE_OUTPUT_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") | ||
else() | ||
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/sphinx/${PARSE_BUILDER}") | ||
endif() |
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 also removes some functionality, namely that the cache variables for the output directories of different builders are removed, so that setting these cache variables manually can no longer alter the output directories. I don't know if this functionality is used by anything, but it's worth noting.
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.
Maybe worth noting. I saw only 2 projects use this module. Hoping that will change in the future.
The cache variables in the long run have to go. While using ExternalProject
excessively to drive the docs super build such that we could have multiple instances of these cache vars (one per project), the end game IMHO should be getting ROCm projects to a state where they are add_subdirectory
friendly, at least among themselves and the entire thing (minus LLVM) can be built using one ninja process. If that's not something we're aspiring towards, I could restore the cache variables to how they were, but it will cause conflicts as soon as two documented projects share a build.
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 dont know how much this is used, but it is nice to be able to set the OUTPUT_DIR
without needing to modify the source files. Maybe you could just do if(DEFINED)
check and then use the variable. This shouldn't cause problems for add_subdirectory
.
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 agree with the justification on removing the cache variables in the long-term. Paul's suggestion of just checking to see if a variable is defined seems reasonable to me to duplicate the functionality noted while not having collisions. I would also note that collisions could be avoided by adding the project name to the cache variable used, although that definitely leads to other potential usability issues of knowing exactly how that variable should be used.
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.
Please take a look at the current solution driven by ROCM_CMAKE_DOCS_DIR
. This was the closest to replicating a possibility of specifying externally an output directory while also keeping it idiomatic CMake (as far as command wrappers can be idiomatic). It tries to mimic globally defined variables that target-props take their default from, such as CMAKE_RUNTIME_OUTPUT_DIRECTORY
.
@lawruble13 |
doc/src/ROCMSphinxDoc.rst
Outdated
List of HTML template values passed to Sphinx. List items will be passed as | ||
command-line args by prepending ``-A`` to each item. | ||
|
||
``USES_DOXYGEN`` |
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 would prefer it to be imperative: USE_DOXYGEN
.
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.
Done.
@@ -1,5 +1,5 @@ | |||
# ###################################################################################################################### | |||
# Copyright (C) 2017 Advanced Micro Devices, Inc. | |||
# Copyright (C) 2023 Advanced Micro Devices, Inc. |
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.
2017-2023
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.
Done. (been done for a while, just didn't mark here)
@@ -1,7 +1,9 @@ | |||
# ###################################################################################################################### | |||
# Copyright (C) 2021 Advanced Micro Devices, Inc. |
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.
2021-2023
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.
Done. (been done for a while, just didn't mark here)
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.
Minor copyright updates
@saadrahim Should be okay. |
This change is causing MiGraphX failed to compile. Do we need to install any pre-req @pfultz2 ? 11:18:25 -- MIGraphx is using Find-2.0 API of MIOpen Command to build MigraphX pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz && git clone --depth=1 https://github.com/ROCmSoftwarePlatform/AMDMIGraphX --branch master && cd AMDMIGraphX && rbuild package --cxx /opt/rocm/llvm/bin/clang++ -DGPU_TARGETS="gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102" -d /workspace/AMDMIGraphX/deps -B /workspace/AMDMIGraphX/build' |
python3 -m pip install sphinx -> After installation, it's passing But, @pfultz2 has patch #144 which will help us. |
This PR improves how Sphinx docs are built, specifically those using rocm-docs-core.
Changes
rocm_add_sphinx_doc
(which even had it's name outdated.USE_DOXYGEN
which triggers a poor man's version ofREQUIRED
for the Doxygen executable. It relays the full path of Doxygen to rocm-docs-core as enabled by this PR.Notes
requirements.in
will need a change once the dependent PR of rocm-docs-core goes live and receives a tagged version.