Proposal - Refactor: Replace shell/Python build scripts with pure CMake#57
Open
jpola-amd wants to merge 1 commit intoGPUOpen-LibrariesAndSDKs:mainfrom
Open
Proposal - Refactor: Replace shell/Python build scripts with pure CMake#57jpola-amd wants to merge 1 commit intoGPUOpen-LibrariesAndSDKs:mainfrom
jpola-amd wants to merge 1 commit intoGPUOpen-LibrariesAndSDKs:mainfrom
Conversation
Collaborator
|
Thank you for your proposal. This is a big change. I'm not sure if we should replace everything with cmake. We still use premake in some projects, and for example, cmake doesn't work well with WSL. The testing scripts are shipped with our CI builds and used by CQE. The baking scripts ( |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The old build system relied on platform-specific shell scripts (
bakeKernel.bat/.sh), ad-hoc Python compilation scripts (compile.py,precompile_bitcode.py,common_tools.py), and a Premake5 alternative build path. This PR replaces all of them with a clean, self-contained CMake build.This still need to be carefully tested across platforms and code generators
Changes
Removed
tools/bakeKernel.bat,tools/bakeKernel.sh— Windows/Linux bake wrapperstools/stringify.py,tools/genArgs.py— low-quality helper scriptsscripts/bitcodes/compile.py,precompile_bitcode.py,common_tools.py— Python kernel compilation pipelinetools/functions.lua,tools/premake5/— Premake build systemscripts/unittest*.bat,scripts/unittest*.sh— manual test runner scriptsAdded
--source-dir; no CWD dependencyhip_get_gpu_architectures()(ported fromcommon_tools.py), optional NVIDIA support viafind_package(CUDAToolkit)add_custom_commandinvokinghipcc/amdclang++/nvccdirectly; replaces all Python compilation scriptsconvert_binary_to_array.pyGNUInstallDirs(bin/,lib/,include/)Modified
target_compile_definitionsinstead ofadd_definitions;PROJECT_SOURCE_DIRthroughout forFetchContentsafetyCMakeUserPresets.jsonBuild configurations
Build process still keeps the same CMAKE options.
Added support for presets
plainbake-kernelprecompile.hipfbat build timebake-compiledno-testsplain-vs2022/plain-vs2019Notes
PRECOMPILE=ONnow drives kernel compilation entirely through CMakeadd_custom_command— no Python subprocess neededgfx1100,gfx1030, ...) is now a CMake function in FindHIP.cmake, versioned againstHIP_VERSION_NUMFetchContent— allinstall()and DLL-copy calls are guarded byPROJECT_IS_TOP_LEVELamd_comgris now a soft dependency (warning, not error) to support minimal SDK installations