From 1a57db0395283dabc72505690a255c8a702ca5ce Mon Sep 17 00:00:00 2001 From: ajanicijamd Date: Wed, 16 Jul 2025 18:49:22 -0400 Subject: [PATCH] Add a CMake Presets file (#44) Adds the following presets: - `ci` - to match the common CI settings - including tests and asserts - `debug` - True debug build - include building tests - `debug-optimized` - include building tests - `release` - To match the "build-release` script - no tests. The default build folder will be `${sourceDir}/build/`. --------- Co-authored-by: David Galiffi [ROCm/rocprofiler-systems commit: 92e1d84c72c9321d79a1866e0090fae0215e6557] --- .../.github/workflows/opensuse.yml | 2 + .../.github/workflows/redhat.yml | 2 + .../.github/workflows/ubuntu-focal.yml | 2 + .../.github/workflows/ubuntu-jammy.yml | 2 + .../.github/workflows/ubuntu-noble.yml | 2 + .../rocprofiler-systems/CMakePresets.json | 94 +++++++++++++++++++ 6 files changed, 104 insertions(+) create mode 100644 projects/rocprofiler-systems/CMakePresets.json diff --git a/projects/rocprofiler-systems/.github/workflows/opensuse.yml b/projects/rocprofiler-systems/.github/workflows/opensuse.yml index ebbd9eef26..049bec9b7f 100644 --- a/projects/rocprofiler-systems/.github/workflows/opensuse.yml +++ b/projects/rocprofiler-systems/.github/workflows/opensuse.yml @@ -16,6 +16,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json pull_request: branches: [ amd-mainline, amd-staging, release/** ] paths-ignore: @@ -30,6 +31,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/projects/rocprofiler-systems/.github/workflows/redhat.yml b/projects/rocprofiler-systems/.github/workflows/redhat.yml index 77c1e49a6e..6de49268eb 100644 --- a/projects/rocprofiler-systems/.github/workflows/redhat.yml +++ b/projects/rocprofiler-systems/.github/workflows/redhat.yml @@ -16,6 +16,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json pull_request: branches: [ amd-mainline, amd-staging, release/** ] paths-ignore: @@ -30,6 +31,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/projects/rocprofiler-systems/.github/workflows/ubuntu-focal.yml b/projects/rocprofiler-systems/.github/workflows/ubuntu-focal.yml index 28d57f9542..be18f9c894 100644 --- a/projects/rocprofiler-systems/.github/workflows/ubuntu-focal.yml +++ b/projects/rocprofiler-systems/.github/workflows/ubuntu-focal.yml @@ -16,6 +16,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json pull_request: branches: [ amd-mainline, amd-staging, release/** ] paths-ignore: @@ -30,6 +31,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/projects/rocprofiler-systems/.github/workflows/ubuntu-jammy.yml b/projects/rocprofiler-systems/.github/workflows/ubuntu-jammy.yml index aa391520e8..02a21ec52d 100644 --- a/projects/rocprofiler-systems/.github/workflows/ubuntu-jammy.yml +++ b/projects/rocprofiler-systems/.github/workflows/ubuntu-jammy.yml @@ -16,6 +16,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json pull_request: branches: [ amd-mainline, amd-staging, release/** ] paths-ignore: @@ -30,6 +31,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/projects/rocprofiler-systems/.github/workflows/ubuntu-noble.yml b/projects/rocprofiler-systems/.github/workflows/ubuntu-noble.yml index cf00d96e3a..3544b32b9d 100644 --- a/projects/rocprofiler-systems/.github/workflows/ubuntu-noble.yml +++ b/projects/rocprofiler-systems/.github/workflows/ubuntu-noble.yml @@ -16,6 +16,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json pull_request: branches: [ amd-mainline, amd-staging, release/** ] paths-ignore: @@ -30,6 +31,7 @@ on: - '.github/workflows/weekly-mainline-sync.yml' - 'docker/**' - .wordlist.txt + - CMakePresets.json concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/projects/rocprofiler-systems/CMakePresets.json b/projects/rocprofiler-systems/CMakePresets.json new file mode 100644 index 0000000000..e1e86a0f75 --- /dev/null +++ b/projects/rocprofiler-systems/CMakePresets.json @@ -0,0 +1,94 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "ci", + "displayName": "official CI build", + "description": "Official CI build parameters", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/ci", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_INSTALL_PREFIX": "/opt/rocprofiler-systems", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "ROCPROFSYS_USE_ROCM": "ON", + "ROCPROFSYS_USE_PYTHON": "ON", + "ROCPROFSYS_BUILD_DYNINST": "ON", + "ROCPROFSYS_BUILD_TBB": "ON", + "ROCPROFSYS_BUILD_BOOST": "ON", + "ROCPROFSYS_BUILD_ELFUTILS": "ON", + "ROCPROFSYS_BUILD_LIBIBERTY": "ON", + "ROCPROFSYS_BUILD_TESTING": "ON", + "ROCPROFSYS_STRIP_LIBRARIES": "OFF", + "ROCPROFSYS_MAX_THREADS": "64", + "ROCPROFSYS_BUILD_CI": "ON" + } + }, + { + "name": "debug", + "displayName": "official debug build", + "description": "Debug build parameters with tests", + "binaryDir": "${sourceDir}/build/debug", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_INSTALL_PREFIX": "/opt/rocprofiler-systems", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "ROCPROFSYS_USE_ROCM": "ON", + "ROCPROFSYS_USE_PYTHON": "ON", + "ROCPROFSYS_BUILD_DYNINST": "ON", + "ROCPROFSYS_BUILD_TBB": "ON", + "ROCPROFSYS_BUILD_BOOST": "ON", + "ROCPROFSYS_BUILD_ELFUTILS": "ON", + "ROCPROFSYS_BUILD_LIBIBERTY": "ON", + "ROCPROFSYS_BUILD_TESTING": "ON", + "ROCPROFSYS_STRIP_LIBRARIES": "OFF", + "ROCPROFSYS_BUILD_DEBUG": "ON" + } + }, + { + "name": "debug-optimized", + "displayName": "release build with debug info", + "description": "Release build with debug info with tests", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/debug-optimized", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_INSTALL_PREFIX": "/opt/rocprofiler-systems", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "ROCPROFSYS_USE_ROCM": "ON", + "ROCPROFSYS_USE_PYTHON": "ON", + "ROCPROFSYS_BUILD_DYNINST": "ON", + "ROCPROFSYS_BUILD_TBB": "ON", + "ROCPROFSYS_BUILD_BOOST": "ON", + "ROCPROFSYS_BUILD_ELFUTILS": "ON", + "ROCPROFSYS_BUILD_LIBIBERTY": "ON", + "ROCPROFSYS_BUILD_TESTING": "ON", + "ROCPROFSYS_STRIP_LIBRARIES": "OFF" + } + }, + { + "name": "release", + "displayName": "official release build", + "description": "Official release build", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_INSTALL_PREFIX": "/opt/rocprofiler-systems", + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++", + "ROCPROFSYS_USE_ROCM": "ON", + "ROCPROFSYS_USE_PYTHON": "ON", + "ROCPROFSYS_BUILD_DYNINST": "ON", + "ROCPROFSYS_BUILD_TBB": "ON", + "ROCPROFSYS_BUILD_BOOST": "ON", + "ROCPROFSYS_BUILD_ELFUTILS": "ON", + "ROCPROFSYS_BUILD_LIBIBERTY": "ON" + } + } + ] +}