diff options
author | David Cournapeau <cournape@gmail.com> | 2007-12-18 09:33:11 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2007-12-18 09:33:11 +0000 |
commit | 23fcc892595743a9fd0ecc59d568579404a5663a (patch) | |
tree | 98032d5bef2a90450916c48ffbdb2b30038d73d3 /numpy/core/setup.py | |
parent | 37fdc200e6080e59abcc79e3231e02b1980cde84 (diff) | |
download | numpy-23fcc892595743a9fd0ecc59d568579404a5663a.tar.gz |
Refactor the NPY_ALLOW_THREAD logic outside config.h generation, and put it inside numpy headers
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index a8fd46911..72c67964f 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -73,8 +73,7 @@ def configuration(parent_package='',top_path=None): nosmp = 1 except KeyError: nosmp = 0 - if nosmp: moredefs = [('NPY_ALLOW_THREADS', '0')] - else: moredefs = [] + moredefs = [] # mathlibs = [] tc = testcode_mathlib() @@ -123,8 +122,12 @@ def configuration(parent_package='',top_path=None): target_f.write('#define %s\n' % (d)) else: target_f.write('#define %s %s\n' % (d[0],d[1])) - if not nosmp: # default is to use WITH_THREAD - target_f.write('#ifdef WITH_THREAD\n#define NPY_ALLOW_THREADS 1\n#else\n#define NPY_ALLOW_THREADS 0\n#endif\n') + # Define NPY_NOSMP to 1 if explicitely requested, or if we cannot + # support thread support reliably + if nosmp: + target_f.write('#define NPY_NOSMP 1\n') + else: + target_f.write('#define NPY_NOSMP 0\n') target_f.close() print 'File:',target target_f = open(target) |