Merge pull request #9076 from ricardoquesada/android_build_fix

fixes how to check for CPU in android-build
This commit is contained in:
Ricardo Quesada 2014-11-10 16:09:00 -08:00
commit 377af3b447
1 changed files with 2 additions and 9 deletions

View File

@ -15,15 +15,8 @@ def get_num_of_cpu():
''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.
'''
try:
platform = sys.platform
if platform == 'win32':
if 'NUMBER_OF_PROCESSORS' in os.environ:
return int(os.environ['NUMBER_OF_PROCESSORS'])
else:
return 1
else:
from numpy.distutils import cpuinfo
return cpuinfo.cpu._getNCPUs()
import multiprocessing
return multiprocessing.cpu_count()
except Exception:
print "Can't know cpuinfo, use default 1 cpu"
return 1