Set build parallelism correctly for travis-ci

This commit is contained in:
Davis E. King 2018-01-17 16:51:09 -05:00 committed by GitHub
parent a602126be3
commit fa14909e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -152,6 +152,8 @@ class CMakeBuild(build_ext):
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=build_folder) subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=build_folder)
def num_available_cpu_cores(ram_per_build_process_in_gb): def num_available_cpu_cores(ram_per_build_process_in_gb):
if os.environ.has_key('TRAVIS') and os.environ['TRAVIS']=='true':
return 2 # When building on travis-ci, just use 2 cores since travis-ci limits you to that regardless of what the hardware might suggest.
try: try:
mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
mem_gib = mem_bytes/(1024.**3) mem_gib = mem_bytes/(1024.**3)