Skip to content

Commit 74f2874

Browse files
committed
RLS: Final changes before release
Final modifications to setup prior to release
1 parent e3fa086 commit 74f2874

File tree

3 files changed

+63
-13
lines changed

3 files changed

+63
-13
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ implementation for identical results. It also passes NumPy's test suite.
115115
python setup.py install
116116
```
117117

118+
### SSE2
119+
`dSFTM` makes use of SSE2 by default. If you have a very old computer or are
120+
building on non-x86, you can install using:
121+
122+
```bash
123+
python setup.py install --no-sse2
124+
```
125+
118126
### Windows
119127
Either use a binary installer or if building from scratch using Python 3.5 and
120128
the free Visual Studio 2015 Community Edition. It can also be build using

README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ Installing
135135
136136
python setup.py install
137137
138+
SSE2
139+
~~~~
140+
141+
``dSFTM`` makes use of SSE2 by default. If you have a very old computer
142+
or are building on non-x86, you can install using:
143+
144+
.. code:: bash
145+
146+
python setup.py install --no-sse2
147+
138148
Windows
139149
~~~~~~~
140150

setup.py

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from setuptools.dist import Distribution
1212

1313
FORCE_EMULATION = False
14+
USE_SSE2 = True if not '--no-sse2' in sys.argv else False
1415

1516
mod_dir = './randomstate'
1617
configs = []
@@ -23,6 +24,11 @@
2324
extra_defs = []
2425
extra_link_args = ['Advapi32.lib', 'Kernel32.lib'] if os.name == 'nt' else []
2526
base_extra_compile_args = [] if os.name == 'nt' else ['-std=c99']
27+
if USE_SSE2:
28+
if os.name == 'nt':
29+
base_extra_compile_args += ['/arch:SSE2']
30+
else:
31+
base_extra_compile_args += ['-msse2']
2632

2733

2834
def write_config(file_name, config):
@@ -35,10 +41,10 @@ def write_config(file_name, config):
3541
val = '"' + val + '"'
3642
config.write('DEF ' + key + ' = ' + str(val) + '\n')
3743

44+
3845
base_include_dirs = [mod_dir] + [numpy.get_include()]
3946
if os.name == 'nt' and sys.version_info < (3, 5):
40-
base_include_dirs += [join(mod_dir, 'src', 'common')]
41-
47+
base_include_dirs += [join(mod_dir, 'src', 'common')]
4248

4349
for rng in rngs:
4450
if rng not in compile_rngs:
@@ -120,13 +126,10 @@ def write_config(file_name, config):
120126
sources += [join(mod_dir, 'src', 'dSFMT', 'dSFMT.c')]
121127
sources += [join(mod_dir, 'shims', 'dSFMT', 'dSFMT-shim.c')]
122128
# TODO: HAVE_SSE2 should only be for platforms that have SSE2
123-
# TODO: But how to reliable detect?
124-
defs = [('DSFMT_RNG', '1'),('DSFMT_MEXP','19937')]
125-
defs += [('HAVE_SSE2', '1')]
126-
if os.name == 'nt':
127-
extra_compile_args = base_extra_compile_args + ['/arch:SSE2']
128-
else:
129-
extra_compile_args = base_extra_compile_args + ['-msse2']
129+
# TODO: But how to reliably detect?
130+
defs = [('DSFMT_RNG', '1'), ('DSFMT_MEXP', '19937')]
131+
if USE_SSE2:
132+
defs += [('HAVE_SSE2', '1')]
130133

131134
include_dirs += [join(mod_dir, 'src', 'dSFMT')]
132135

@@ -140,12 +143,14 @@ def write_config(file_name, config):
140143

141144
configs.append(config)
142145

146+
143147
class BinaryDistribution(Distribution):
144-
def is_pure(self):
145-
return False
148+
def is_pure(self):
149+
return False
150+
146151

147152
try:
148-
subprocess.call(['pandoc','--from=markdown','--to=rst','--output=README.rst','README.md'])
153+
subprocess.call(['pandoc', '--from=markdown', '--to=rst', '--output=README.rst', 'README.md'])
149154
except:
150155
pass
151156
# Generate files and extensions
@@ -181,11 +186,36 @@ def is_pure(self):
181186

182187
ext_modules = cythonize(extensions)
183188

189+
classifiers = ['Development Status :: 5 - Production/Stable',
190+
'Environment :: Console',
191+
'Intended Audience :: End Users/Desktop',
192+
'Intended Audience :: Financial and Insurance Industry',
193+
'Intended Audience :: Information Technology',
194+
'Intended Audience :: Science/Research',
195+
'License :: OSI Approved',
196+
'Operating System :: MacOS :: MacOS X',
197+
'Operating System :: Microsoft :: Windows',
198+
'Operating System :: POSIX :: Linux',
199+
'Operating System :: Unix',
200+
'Programming Language :: C',
201+
'Programming Language :: Cython',
202+
'Programming Language :: Python :: 2.6',
203+
'Programming Language :: Python :: 2.7',
204+
'Programming Language :: Python :: 3.3',
205+
'Programming Language :: Python :: 3.4',
206+
'Programming Language :: Python :: 3.5',
207+
'Topic :: Adaptive Technologies',
208+
'Topic :: Artistic Software',
209+
'Topic :: Office/Business :: Financial',
210+
'Topic :: Scientific/Engineering',
211+
'Topic :: Security :: Cryptography']
212+
184213
setup(name='randomstate',
185214
version='1.10',
215+
classifiers=classifiers,
186216
packages=find_packages(),
187217
package_dir={'randomstate': './randomstate'},
188-
package_data={'': ['*.c','*.h','*.pxi','*.pyx','*.pxd'],
218+
package_data={'': ['*.c', '*.h', '*.pxi', '*.pyx', '*.pxd'],
189219
'randomstate.tests.data': ['*.csv']},
190220
include_package_data=True,
191221
license='NSCA',
@@ -196,6 +226,8 @@ def is_pure(self):
196226
url='https://github.com/bashtage/ng-numpy-randomstate',
197227
long_description=open('README.rst').read(),
198228
ext_modules=ext_modules,
229+
keywords=['pseudo random numbers', 'PRNG', 'RNG', 'RandomState', 'random', 'random numbers',
230+
'parallel random numbers', 'PCG', 'XorShift', 'dSFMT', 'MT19937'],
199231
zip_safe=False)
200232

201233
# Clean up generated files

0 commit comments

Comments
 (0)