Skip to content
Snippets Groups Projects
Commit 3b135f66 authored by Andre Sailer's avatar Andre Sailer Committed by Marko Petric
Browse files

[CMake]: add DD4HEP_HIGH_MEM_POOL_DEPTH option

Allow setting of parallel builds of ddparser objects with the ninja generator
defaults to memory / 2000 cores (rounded down)
parent 057a3be9
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,10 @@ ENDIF() ...@@ -61,6 +61,10 @@ ENDIF()
############################### ###############################
# Define DD4hep build options # # Define DD4hep build options #
############################### ###############################
# NINJA ONLY
# Limit number of parallel DDParser builds to number equal to 2 gigs per core
cmake_host_system_information(RESULT HOST_RAM_MB QUERY TOTAL_PHYSICAL_MEMORY)
math(EXPR DD4HEP_HIGH_MEM_POOL_DEPTH "${HOST_RAM_MB} / 2000" OUTPUT_FORMAT DECIMAL)
option(DD4HEP_USE_XERCESC "Enable 'Detector Builders' based on XercesC" OFF) option(DD4HEP_USE_XERCESC "Enable 'Detector Builders' based on XercesC" OFF)
option(DD4HEP_USE_GEANT4 "Enable the simulation part based on Geant4" OFF) option(DD4HEP_USE_GEANT4 "Enable the simulation part based on Geant4" OFF)
...@@ -81,7 +85,10 @@ OPTION(DD4HEP_BUILD_EXAMPLES "Build all the examples" OFF) ...@@ -81,7 +85,10 @@ OPTION(DD4HEP_BUILD_EXAMPLES "Build all the examples" OFF)
OPTION(DD4HEP_DEBUG_CMAKE "Print debugging information for DD4hep CMAKE" OFF) OPTION(DD4HEP_DEBUG_CMAKE "Print debugging information for DD4hep CMAKE" OFF)
SET(DD4HEP_USE_EXISTING_DD4HEP "" CACHE STRING "Build some parts of DD4hep against an existing installation") SET(DD4HEP_USE_EXISTING_DD4HEP "" CACHE STRING "Build some parts of DD4hep against an existing installation")
SET(DD4HEP_HIGH_MEM_POOL_DEPTH "${DD4HEP_HIGH_MEM_POOL_DEPTH}" CACHE STRING "Number of build slots for high memory compile units (DDParsers), Ninja only")
# create the job pool
set_property(GLOBAL PROPERTY JOB_POOLS HIGH_MEM_POOL=${DD4HEP_HIGH_MEM_POOL_DEPTH})
##################### #####################
# Configure version # # Configure version #
##################### #####################
......
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
dd4hep_print("|++> Will build DDParsers") dd4hep_print("|++> Will build DDParsers")
# set the default job pool to use, is unset below, although this only applies for this directory
SET(CMAKE_JOB_POOL_COMPILE HIGH_MEM_POOL)
file(GLOB DDParsers_SOURCES src/Parsers/*.cpp src/Evaluator/*.cpp) file(GLOB DDParsers_SOURCES src/Parsers/*.cpp src/Evaluator/*.cpp)
file(GLOB DDParsers_SPIRIT_SOURCES src/Spirit/*.cpp) file(GLOB DDParsers_SPIRIT_SOURCES src/Spirit/*.cpp)
...@@ -33,3 +37,5 @@ install(DIRECTORY include/Parsers include/Evaluator DESTINATION include) ...@@ -33,3 +37,5 @@ install(DIRECTORY include/Parsers include/Evaluator DESTINATION include)
install(TARGETS DDParsers ${OPTIONAL_TARGETS} EXPORT DD4hep install(TARGETS DDParsers ${OPTIONAL_TARGETS} EXPORT DD4hep
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib) ARCHIVE DESTINATION lib)
# Unset job pool
SET(CMAKE_JOB_POOL_COMPILE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment