make openmp on windows optional

This commit is contained in:
Henning Peters 2016-04-12 10:12:57 +02:00
parent 6df3858dbc
commit 5f699883dd
1 changed files with 5 additions and 1 deletions

View File

@ -72,7 +72,7 @@ MOD_NAMES = [
# 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
compile_options = {
'msvc': ['/Ox', '/EHsc', '/openmp'],
'msvc': ['/Ox', '/EHsc'],
'mingw32' : ['-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'):
compile_options['other'].append('-fopenmp')
link_options['other'].append('-fopenmp')