Skip to content

Consider reducing hard CPM dependency to ease packaging #2149

Open

Description

@hollykbuck

Currently, CMakeLists.txt and the cmake modules have a heavy reliance on CPM (via rapids-cmake) for dependency management. While this works well for standalone development, it creates significant friction for package managers like vcpkg and Conan, which need to supply dependencies from their own registries instead. Maintainers must patch the CMake files to bypass CPM, increasing maintenance burden.

Happy to help with a PR if this direction is welcomed.

Activity

  1. rbberger commented on Oct 15, 2026

    @rbberger

    +1 from the Spack package manager side. Now that we're seeing other things like HPX 2.x creating dependencies on this there will be increased interest and more patching needed. I've seen cpm being used and failing various use cases in Legion/Realm, so we eventually added the necessary fallbacks to support other packaging efforts. @junghans @hkaiser FYI

  2. junghans commented on Oct 15, 2026

    @junghans

    +1 for Fedora packaging.

  3. junghans commented on Oct 15, 2026

    @junghans

    As stdexec is header-only, and all dependencies are used for testing only a simple_install.sh as below should do the same as the cmake --install:

    #! /bin/sh -e
    
    [ -d "$1" ] || { echo "First argument should be a directory"; exit 1; }
    
    # exclude asio sub directory
    find include/exec -path "include/exec/asio" -prune -o -type f -exec install -D -m 0644 {} "$1"/{} \;
    find include/stdexec -type f -exec install -D -m 0644 {} "$1"/{} \;
    
    cat << EOF > "$1"/include/stdexec_version_config.hpp
    /*
     * Copyright (c) 2021, NVIDIA CORPORATION.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *     http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    #pragma once
    
    #define STDEXEC_VERSION_MAJOR 0
    #define STDEXEC_VERSION_MINOR 11
    #define STDEXEC_VERSION_PATCH 0
    EOF

    No testing, of course.

  4. czoido commented on Oct 16, 2026

    @czoido
    Contributor

    +1 from the Conan side. I opened #2341 as a small first step. It keeps CPM and icm out of the default configure, so stdexec can be configured and installed without network access when tests and the optional integrations are off. It doesn't change how the integrations get their dependencies, which is the rest of what this issue asks for.

    I also opened #2342 asking for a v0.11.0 tag, so package managers don't have to make up their own versions.

  5. junghans commented on Oct 16, 2026

    @junghans

    @czoido After chatting with @rbberger yesterday, we came with a similar approach (details below). #2341 is the more complete version of that, so thanks for creating the PR.

    For Fedora, I got it to package, but I still need to figure out what to do with the bundled rapids-cmake though. At least one can pre-download that and then inject it with -Drapids-cmake-url=file://....

    Details ```diff --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,10 +105,10 @@ endif() # ############################################################################## # * Dependencies -------------------------------------------------------------

    +if(STDEXEC_BUILD_TESTS)

    Initialize CPM

    rapids_cpm_init(OVERRIDE ${CMAKE_CURRENT_SOURCE_DIR}/cmake/versions.json)

    -if(STDEXEC_BUILD_TESTS)

    Add Catch2

    set(Catch2_VERSION 3.14.0)

    Always download it, don't attempt to do find_package(Catch2) first

    @@ -126,7 +126,6 @@ if(STDEXEC_BUILD_TESTS)
    OPTIONS
    "CMAKE_CXX_STANDARD 20"
    "CATCH_CONFIG_NO_POSIX_SIGNALS ON")
    -endif()

    Add ICM

    set(icm_VERSION 1.5.0)
    @@ -151,6 +150,7 @@ rapids_cpm_find(
    git
    apply
    ${CMAKE_CURRENT_LIST_DIR}/cmake/cpm/patches/icm/regex-build-error.diff)
    +endif()

    Ensure that we link with the threading library

    set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

    </details>
    
    
  6. czoido commented on Oct 16, 2026

    @czoido
    Contributor

    Thanks @junghans and @rbberger, good sign that we landed on the same fix! The extra conditions in #2341 are there because the ASIO, Taskflow and CUDA integrations also use CPM (rapids_cpm_find, CPMAddPackage and rapids_cpm_cccl), and rapids_cpm_init has to run before them.

    For rapids-cmake, the idea for the ConanCenter recipe would be to point CMake's standard FETCHCONTENT_SOURCE_DIR_RAPIDS-CMAKE variable at an unpacked copy of the archive, in case that's easier for Fedora than a file:// URL.

  7. junghans commented on Oct 16, 2026

    @junghans

    I just did

    ...
    Source1:        https://github.com/rapidsai/rapids-cmake/archive/refs/heads/branch-24.02.zip
    ...
    %cmake -DSTDEXEC_BUILD_TESTS=OFF -Drapids-cmake-url=file://%{S:1}
    ...

    which works in a network-less build as well.

  8. rbberger commented on Oct 17, 2026

    @rbberger

    Great progress! Thanks for getting it done.

    @ericniebler The only leftover nitpick is that include/._clangd_helper_file is compiled for nothing.
    This is not a problem most of times, however, if for whatever reason you're untar-ing this repo on MacOS (like when using a cached git-clone) the ._ file may be mistaken as AppleDouble metadata file and skipped, causing a hard compilation error due to missing files. Created a dedicate issue for this: #2345

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions