From 53158aa2ead43a67210cc7dc394ac0b5aacec601 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Thu, 19 Dec 2019 08:44:12 -0500 Subject: [PATCH] Don't allow ninja job pool sizes to be negative If the job pool size becomes negative, ninja treats it as an absurdly large positive integer and errors out. --- CMake/VTKmWrappers.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMake/VTKmWrappers.cmake b/CMake/VTKmWrappers.cmake index ad52864e0..08c359053 100644 --- a/CMake/VTKmWrappers.cmake +++ b/CMake/VTKmWrappers.cmake @@ -123,13 +123,15 @@ function(vtkm_setup_job_pool) # compilation units to be built at the same time. # # We try to allocate a pool size where we presume each compilation process - # will require 4GB of memory. To allow for other NON VTK-m jobs we leave at - # least 8GB of memory as 'slop'. + # will require 3GB of memory. To allow for other NON VTK-m jobs we leave at + # least 3GB of memory as 'slop'. cmake_host_system_information(RESULT vtkm_mem_ QUERY TOTAL_PHYSICAL_MEMORY) - math(EXPR vtkm_pool_size "(${vtkm_mem_}/4096)-2") - if (vtkm_pool_size EQUAL 0) + math(EXPR vtkm_pool_size "(${vtkm_mem_}/3072)-1") + + if (vtkm_pool_size LESS 1) set(vtkm_pool_size 1) endif () + set_property(GLOBAL APPEND PROPERTY JOB_POOLS vtkm_pool=${vtkm_pool_size})