{"id":23639033,"url":"https://github.com/rocm/rocmds-cmake","last_synced_at":"2025-04-10T02:41:54.104Z","repository":{"id":251694258,"uuid":"787529620","full_name":"ROCm/ROCmDS-cmake","owner":"ROCm","description":"This is a collection of CMake modules that are useful for all ROCm-DS projects. By sharing the code in a single place it makes rolling out CMake fixes easier.","archived":false,"fork":false,"pushed_at":"2025-02-24T11:22:30.000Z","size":1388,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"branch-24.06","last_synced_at":"2025-03-24T04:12:02.617Z","etag":null,"topics":["amd","cmake","cuda","hip","radeon-instinct-mi-series","rocm"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ROCm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-16T17:42:04.000Z","updated_at":"2025-02-07T07:59:19.000Z","dependencies_parsed_at":"2024-12-28T08:11:45.839Z","dependency_job_id":"5380cfe1-9947-44d0-b747-d2809bf7d9ad","html_url":"https://github.com/ROCm/ROCmDS-cmake","commit_stats":null,"previous_names":["rocm/rapids-cmake","rocm/rockitds-cmake","rocm/rocmds-cmake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2FROCmDS-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2FROCmDS-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2FROCmDS-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROCm%2FROCmDS-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ROCm","download_url":"https://codeload.github.com/ROCm/ROCmDS-cmake/tar.gz/refs/heads/branch-24.06","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144963,"owners_count":21055017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","cmake","cuda","hip","radeon-instinct-mi-series","rocm"],"created_at":"2024-12-28T08:10:44.722Z","updated_at":"2025-04-10T02:41:54.087Z","avatar_url":"https://github.com/ROCm.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- MIT License\n  --\n  -- Modifications Copyright (c) 2024 Advanced Micro Devices, Inc.\n  --\n  -- Permission is hereby granted, free of charge, to any person obtaining a copy\n  -- of this software and associated documentation files (the \"Software\"), to deal\n  -- in the Software without restriction, including without limitation the rights\n  -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  -- copies of the Software, and to permit persons to whom the Software is\n  -- furnished to do so, subject to the following conditions:\n  --\n  -- The above copyright notice and this permission notice shall be included in all\n  -- copies or substantial portions of the Software.\n  --\n  -- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n  -- SOFTWARE.\n--\u003e\n\n# ROCm-DS CMake\n\n\u003e [!CAUTION]\n\u003e This release is an *early-access* software technology preview. Running production workloads is *not* recommended.\n\n\u003e [!NOTE]\n\u003e This repository will be eventually moved to the [ROCm-DS](https://github.com/rocm-ds) Github organization.\n\n\u003c!-- **NOTE:** For the latest stable [README.md](https://github.com/ROCm/ROCmDS-cmake/blob/main/README.md) ensure you are on the default branch. --\u003e\n\n## Overview\n\nThis is a collection of CMake modules that are useful for all ROCm-DS\nprojects. By sharing the code in a single place it makes rolling out CMake\nfixes easier.\n\n\u003e [!NOTE]\n\u003e This ROCm\u0026trade; port is derived from the NVIDIA RAPIDS\u0026reg; RAPIDS-CMake project. It aims to\nfollow the latter's directory structure, file naming and API naming as closely as possible to minimize porting friction for users that are interested in using both projects.\n\n## Installation\n\nThe `rapids-cmake` module is designed to be acquired via CMake's [Fetch\nContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) into your project.\n\n```cmake\n\ncmake_minimum_required(...)\n\nif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/\u003cPROJECT\u003e_RAPIDS.cmake)\n  file(DOWNLOAD https://raw.githubusercontent.com/ROCm/ROCmDS-CMake/branch-\u003cVERSION_MAJOR\u003e.\u003cVERSION_MINOR\u003e/RAPIDS.cmake\n    ${CMAKE_CURRENT_BINARY_DIR}/\u003cPROJECT\u003e_RAPIDS.cmake)\nendif()\ninclude(${CMAKE_CURRENT_BINARY_DIR}/\u003cPROJECT\u003e_RAPIDS.cmake)\n\ninclude(rapids-cmake)\ninclude(rapids-cpm)\ninclude(rapids-cuda)\ninclude(rapids-export)\ninclude(rapids-find)\n\nproject(....)\n```\n\nNote that we recommend you install `rapids-cmake` into the root `CMakeLists.txt` of\nyour project before the first `project` call. This allows us to offer features such as\n`rapids_hip_architectures()`\n\n## Usage\n\n`rapids-cmake` provides a collection of useful CMake settings that any ROCmDS project may use.\nWhile they maybe common, we know that they aren't universal and might need to be composed in\ndifferent ways.\n\nTo use function provided by `rapids-cmake` projects have two options:\n- Call `include(rapids-\u003ccomponent\u003e)` as that imports all commonly used functions for that component\n- Load each function independently via `include(${rapids-cmake-dir}/\u003ccomponent\u003e/\u003cfunction_name\u003e.cmake)`\n\n\n## Components\n\nComplete online documentation for all components can be found at:\n\n  https://docs.rapids.ai/api/rapids-cmake/nightly/api.html\n\n\n### cmake\nThe `rapids-cmake` module contains helpful general CMake functionality\n\n- `rapids_cmake_build_type( )` handles initialization of `CMAKE_BUILD_TYPE`\n- `rapids_cmake_support_conda_env( target [MODIFY_PREFIX_PATH])` Establish a target that holds the CONDA environment\n  include and link directories.\n- `rapids_cmake_write_version_file( \u003cfile\u003e )` Write a C++ header with a projects MAJOR, MINOR, and PATCH defines\n\n### cpm\n\nThe `rapids-cpm` module contains CPM functionality to allow projects to acquire dependencies consistently.\nFor consistency, all targets brought in via `rapids-cpm` are GLOBAL targets.\n\n- `rapids_cpm_init()` handles initialization of the CPM module.\n- `rapids_cpm_find(\u003cproject\u003e name BUILD_EXPORT_SET \u003cname\u003e INSTALL_EXPORT_SET \u003cname\u003e)` Will search for a module and fall back to installing via CPM. Offers support to track dependencies for easy package exporting\n\n### cuda\n\nThe `rapids-cuda` module contains core functionality to allow projects to build CUDA code robustly.\nThe most commonly used function are:\n\n- `rapids_cuda_init_architectures(\u003cproject_name\u003e)` handles initialization of `CMAKE_CUDA_ARCHITECTURE`. MUST BE CALLED BEFORE `PROJECT()`\n- `rapids_cuda_init_runtime(\u003cmode\u003e)` handles initialization of `CMAKE_CUDA_RUNTIME_LIBRARY`.\n- `rapids_cuda_patch_toolkit()` corrects bugs in the CUDAToolkit module that are being upstreamed.\n\n### cython\n\nThe `rapids_cython` functions allow projects to easily build cython modules using\n[scikit-build](https://scikit-build.readthedocs.io/en/latest/).\n\n- `rapids_cython_init()` handles initialization of scikit-build and cython.\n- `rapids_create_modules([CXX] [SOURCE_FILES \u003csrc1\u003e \u003csrc2\u003e ...] [LINKED_LIBRARIES \u003clib1\u003e \u003clib2\u003e ... ]  [INSTALL_DIR \u003cinstall_path\u003e] [MODULE_PREFIX \u003cmodule_prefix\u003e] )` will create cython modules for each provided source file\n\n\n### export\n\nThe `rapids-export` module contains core functionality to allow projects to easily record and write out\nbuild and install dependencies, that come from `find_package` or `cpm`\n\n- `rapids_export(\u003ctype\u003e \u003cproject\u003e EXPORT_SET \u003cname\u003e)` write out all the require components of a\n  projects config module so that the `install` or `build` directory can be imported via `find_package`. See `rapids_export` documentation for full documentation\n\n\n### find\n\nThe `rapids-find` module contains core functionality to allow projects to easily generate FindModule\nor export `find_package` calls:\n\nThe most commonly used function are:\n\n- `rapids_find_package(\u003cproject_name\u003e BUILD_EXPORT_SET \u003cname\u003e INSTALL_EXPORT_SET \u003cname\u003e )` Combines `find_package` and support to track dependencies for easy package exporting\n- `rapids_generate_module(\u003cPackageName\u003e HEADER_NAMES \u003cpaths...\u003e LIBRARY_NAMES \u003cnames...\u003e )` Generate a FindModule for the given package. Allows association to export sets so the generated FindModule can be shipped with the project\n\n### test\n\nThe `rapids_test` functions simplify CTest resource allocation, allowing for\ntests to run in parallel without overallocating GPU resources.\n\nThe most commonly used functions are:\n- `rapids_test_add(NAME \u003ctest_name\u003e GPUS \u003cN\u003e PERCENT \u003cN\u003e)`: State how many GPU resources a single\n  test requires\n\n\n## Overriding RAPIDS.cmake\n\nAt times projects or developers will need to verify ``rapids-cmake`` branches. To do this you can set variables that control which repository ``RAPIDS.cmake`` downloads, which should be done like this:\n\n```cmake\n  # To override the version that is pulled:\n  set(rapids-cmake-version \"\u003cversion\u003e\")\n\n  # To override the GitHub repository:\n  set(rapids-cmake-repo \"\u003cmy_fork\u003e\")\n\n  # To use an exact Git SHA:\n  set(rapids-cmake-sha \"\u003cmy_git_sha\u003e\")\n\n  # To use a Git tag:\n  set(rapids-cmake-tag \"\u003cmy_git_tag\u003e\")\n\n  # To override the repository branch:\n  set(rapids-cmake-branch \"\u003cmy_feature_branch\u003e\")\n\n  # Or to override the entire repository URL (e.g. to use a GitLab repo):\n  set(rapids-cmake-url \"https://gitlab.com/\u003cmy_user\u003e/\u003cmy_fork\u003e/-/archive/\u003cmy_branch\u003e/\u003cmy_fork\u003e-\u003cmy_branch\u003e.zip\")\n\n  # To override the usage of fetching the repository without git info\n  # This only works when specifying\n  #\n  # set(rapids-cmake-fetch-via-git \"ON\")\n  # set(rapids-cmake-branch \"branch-\u003ccal_ver\u003e\")\n  #\n  # or\n  # set(rapids-cmake-fetch-via-git \"ON\")\n  # set(rapids-cmake-url \"https://gitlab.com/\u003cmy_user\u003e/\u003cprivate_fork\u003e/\")\n  # set(rapids-cmake-sha \"ABC123\")\n  #\n  set(rapids-cmake-fetch-via-git \"ON\")\n\n  file(DOWNLOAD https://raw.githubusercontent.com/ROCm/rapids-cmake/branch-23.12/RAPIDS.cmake\n      ${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)\n  include(${CMAKE_CURRENT_BINARY_DIR}/RAPIDS.cmake)\n```\n\nA few notes:\n\n- An explicitly defined ``rapids-cmake-url`` will always be used\n- `rapids-cmake-sha` takes precedence over `rapids-cmake-tag`\n- `rapids-cmake-tag` takes precedence over `rapids-cmake-branch`\n- It is advised to always set `rapids-cmake-version` to the version expected by the repo your modifications will pull\n\n\u003c!-- ## Contributing\n\nReview the [CONTRIBUTING.md](https://github.com/ROCm/rapids-cmake/blob/main/CONTRIBUTING.md) file for information on how to contribute code and issues to the project. --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocm%2Frocmds-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocm%2Frocmds-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocm%2Frocmds-cmake/lists"}