make openmp on windows optional

This commit is contained in:
Henning Peters 2016-04-12 10:12:57 +02:00
parent 6df3858dbc
commit 5f699883dd

View File

@ -72,7 +72,7 @@ MOD_NAMES = [
# which is really known only after finalize_options # which is really known only after finalize_options
# http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used # http://stackoverflow.com/questions/724664/python-distutils-how-to-get-a-compiler-that-is-going-to-be-used
compile_options = { compile_options = {
'msvc': ['/Ox', '/EHsc', '/openmp'], 'msvc': ['/Ox', '/EHsc'],
'mingw32' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function'], 'mingw32' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function'],
'other' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function'] 'other' : ['-O3', '-Wno-strict-prototypes', '-Wno-unused-function']
} }
@ -85,6 +85,10 @@ link_options = {
} }
if os.environ.get('USE_OPENMP') == '1':
compile_options['msvc'].append('/openmp')
if not sys.platform.startswith('darwin'): if not sys.platform.startswith('darwin'):
compile_options['other'].append('-fopenmp') compile_options['other'].append('-fopenmp')
link_options['other'].append('-fopenmp') link_options['other'].append('-fopenmp')