Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,926
    • Issues 3,926
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #18929
Closed
Open
Created Feb 14, 2019 by Artur Ryt@R2RTContributor

Feature idea: Parallel command blocks

I feel like there is big possibility to improve CMake performance by adding some kind of parallelism to language. First thing which happens when you call cmake .. is

-- Performing Test ...
-- Checking support ...
-- Looking for ...

And it takes up to few minutes. And this is only the first use that comes to mind, but for sure community would find more of it. (Parallel git clone for ExternalProject?)

I have not done any research how much effort would it take to implement parallelism neither to develop strict API for it.

My simplest API idea is to provide functions start_parallel_block and end_parallel_block, in which every command is run parallelly, e.g.:

start_parallel_block(WORKERS 4)
  LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H)
  LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
  LA_CHECK_INCLUDE_FILE("membership.h" HAVE_MEMBERSHIP_H)
  LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
  LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H)
  LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H)
end_parallel_blocks()

Setting same variable by two different workers would be prohibited to prevent any races (and need for synchronisation objects). I suppose same about directory/target's properties.

I've opened this issue to ask whenever similar idea have been tried to be implemented already? Or is there maybe some technical reason why it is a bad idea?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking