diff --git a/setup.py b/setup.py index 591e50bbc..2ceb9bfbb 100644 --- a/setup.py +++ b/setup.py @@ -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')