Skip to content

Commit

Permalink
Make use of CMAKE_BUILD_PARALLEL_LEVEL (davisking#2879)
Browse files Browse the repository at this point in the history
  • Loading branch information
avkarenow authored Oct 11, 2023
1 parent 13c6b7a commit f7d99ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def num_available_cpu_cores(ram_per_build_process_in_gb):
if 'TRAVIS' in os.environ and os.environ['TRAVIS']=='true':
# When building on travis-ci, just use 2 cores since travis-ci limits
# you to that regardless of what the hardware might suggest.
return 2
return 2
elif 'CMAKE_BUILD_PARALLEL_LEVEL' in os.environ and os.environ['CMAKE_BUILD_PARALLEL_LEVEL'].isnumeric():
return int(os.environ['CMAKE_BUILD_PARALLEL_LEVEL'])
try:
mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
mem_gib = mem_bytes/(1024.**3)
Expand Down

0 comments on commit f7d99ae

Please sign in to comment.