Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,194
    • Issues 3,194
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 16
    • Merge Requests 16
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • CMake
  • CMakeCMake
  • Issues
  • #18929

Closed
Open
Opened 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
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: cmake/cmake#18929