Added
Link Here
|
1 |
--- setup.py.orig 2021-05-28 02:40:44 UTC |
2 |
+++ setup.py |
3 |
@@ -6,6 +6,11 @@ import platform |
4 |
import subprocess |
5 |
|
6 |
from setuptools import setup, setuptools, Extension |
7 |
+if platform.machine() == "amd64": |
8 |
+ # Patch the unix compiler to accept ASM |
9 |
+ from distutils.unixccompiler import UnixCCompiler |
10 |
+ UnixCCompiler.src_extensions.append('.S') |
11 |
+ del UnixCCompiler |
12 |
from setuptools.command.build_ext import build_ext |
13 |
from distutils.version import LooseVersion |
14 |
|
15 |
@@ -87,24 +92,34 @@ class get_pybind_include(object): |
16 |
|
17 |
return pybind11.get_include(self.user) |
18 |
|
19 |
+fse = ('fse', {'sources': [ |
20 |
+ "lib/FiniteStateEntropy/lib/entropy_common.c", |
21 |
+ "lib/FiniteStateEntropy/lib/fse_compress.c", |
22 |
+ "lib/FiniteStateEntropy/lib/fse_decompress.c", |
23 |
+ "lib/FiniteStateEntropy/lib/hist.c"]}) |
24 |
|
25 |
+if platform.machine() == "amd64": |
26 |
+ blake = ('blake', {'sources': [ |
27 |
+ "src/b3/blake3.c", |
28 |
+ "src/b3/blake3_portable.c", |
29 |
+ "src/b3/blake3_dispatch.c", |
30 |
+ "src/b3/blake3_avx2_x86-64_unix.S", |
31 |
+ "src/b3/blake3_avx512_x86-64_unix.S", |
32 |
+ "src/b3/blake3_sse41_x86-64_unix.S"]}) |
33 |
+else: |
34 |
+ blake = ('blake', {'sources': [ |
35 |
+ "src/b3/blake3.c", |
36 |
+ "src/b3/blake3_portable.c", |
37 |
+ "src/b3/blake3_dispatch.c"]}) |
38 |
+ |
39 |
+chacha = ('chacha', {'sources': ["src/chacha8.c"]}) |
40 |
+ |
41 |
ext_modules = [ |
42 |
Extension( |
43 |
"chiapos", |
44 |
[ |
45 |
- "lib/FiniteStateEntropy/lib/entropy_common.c", |
46 |
- "lib/FiniteStateEntropy/lib/fse_compress.c", |
47 |
- "lib/FiniteStateEntropy/lib/fse_decompress.c", |
48 |
- "lib/FiniteStateEntropy/lib/hist.c", |
49 |
"python-bindings/chiapos.cpp", |
50 |
"uint128_t/uint128_t.cpp", |
51 |
- "src/b3/blake3.c", |
52 |
- "src/b3/blake3_portable.c", |
53 |
- "src/b3/blake3_dispatch.c", |
54 |
- "src/b3/blake3_avx2.c", |
55 |
- "src/b3/blake3_avx512.c", |
56 |
- "src/b3/blake3_sse41.c", |
57 |
- "src/chacha8.c", |
58 |
], |
59 |
include_dirs=[ |
60 |
# Path to pybind11 headers |
61 |
@@ -161,6 +176,12 @@ class BuildExt(build_ext): |
62 |
"unix": [""], |
63 |
} |
64 |
|
65 |
+ if "WITH_DEBUG" in os.environ: |
66 |
+ c_opts["unix"] += ["-g"] |
67 |
+ l_opts["unix"] += ["-g"] |
68 |
+ else: |
69 |
+ l_opts["unix"] += ["-s"] |
70 |
+ |
71 |
if sys.platform == "darwin": |
72 |
darwin_opts = ["-stdlib=libc++", "-mmacosx-version-min=10.14"] |
73 |
c_opts["unix"] += darwin_opts |
74 |
@@ -202,6 +223,7 @@ if platform.system() == "Windows": |
75 |
else: |
76 |
setup( |
77 |
name="chiapos", |
78 |
+ version="1.0.3", |
79 |
author="Mariano Sorgente", |
80 |
author_email="mariano@chia.net", |
81 |
description="Chia proof of space plotting, proving, and verifying (wraps C++)", |
82 |
@@ -209,8 +231,10 @@ else: |
83 |
python_requires=">=3.7", |
84 |
long_description=open("README.md").read(), |
85 |
long_description_content_type="text/markdown", |
86 |
- url="https://github.com/Chia-Network/chiavdf", |
87 |
- ext_modules=[CMakeExtension("chiapos", ".")], |
88 |
- cmdclass=dict(build_ext=CMakeBuild), |
89 |
+ url="https://github.com/Chia-Network/chiapos", |
90 |
+ scripts=['tools/parse_disk.py'], |
91 |
+ libraries=[fse, blake, chacha], |
92 |
+ ext_modules=ext_modules, |
93 |
+ cmdclass={"build_ext": BuildExt}, |
94 |
zip_safe=False, |
95 |
) |