-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
69 lines (62 loc) · 1.83 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from setuptools import setup, Extension
import sys, os
def which(pgm):
path=os.getenv('PATH')
for p in path.split(os.path.pathsep):
p=os.path.join(p,pgm)
if os.path.exists(p) and os.access(p,os.X_OK):
return p
if sys.platform != 'win32':
os.environ["CC"] = "gcc"
if sys.platform == 'darwin':
gcc=None
for i in range(9, 5, -1):
gcc = 'gcc-'+str(i)
if which(gcc):
os.environ["CC"] = gcc
break
eca = []
ela = []
libs = []
macros = []
src = []
if '--enable-gpu' in sys.argv:
sys.argv.remove('--enable-gpu')
if '--use-vc' in sys.argv:
sys.argv.remove('--use-vc')
libs = ['OpenCL']
macros = [('HAVE_CL_CL_H', '1')]
if sys.platform == 'darwin':
macros = [('HAVE_OPENCL_OPENCL_H', '1')]
ela=['-framework', 'OpenCL']
src = ['mpow.c']
else:
eca = ['-fopenmp']
ela=['-fopenmp']
src = ['b2b/blake2b.c', 'mpow.c']
if '--use-vc' in sys.argv:
sys.argv.remove('--use-vc')
macros = [('USE_VISUAL_C', '1')]
eca = ['/openmp', '/arch:SSE2', '/arch:AVX', '/arch:AVX2']
ela = ['/openmp', '/arch:SSE2', '/arch:AVX', '/arch:AVX2']
setup(
name="nano-dpow-client",
version='1.1.1',
description='Work client for the Nano (cryptocurrency) Distributed Proof of Work System. Supports CPU and GPU.',
url='https://github.com/jamescoxon/nano_distributed_pow_client',
author='James Coxon',
author_email='james@joltwallet.com',
scripts=['nano-dpow-client'],
license='MIT',
python_requires='>=3.0',
install_requires=[
'websocket-client', 'requests'],
ext_modules=[
Extension(
'mpow',
sources=src,
extra_compile_args=eca,
extra_link_args=ela,
libraries=libs,
define_macros=macros)
])