-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
45 lines (39 loc) · 1.38 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
import os
from setuptools import setup, find_packages
from subprocess import call
from setuptools.command.install import install
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
# os.environ["CC"] = "g++"
# os.environ["CXX"] = "g++"
SRC_DIR = "libffpy"
class CustomBuild(install):
def run(self):
call(['bash', 'install-depends.sh'])
install.run(self)
setup(
name="libffpy",
version="0.1",
packages=find_packages(),
author="Vitalis Salis",
author_email="[email protected]",
description="Cython wrapper for the libff library",
license="MIT",
keywords="libff ecc bn128 wrapper",
url="https://github.com/VitSalis/libffpy",
install_requires=["cython >= 0.22.1"],
ext_modules=cythonize(
Extension(
SRC_DIR + ".libffpy",
sources=[SRC_DIR + "/libffpy.pyx", SRC_DIR + "/libff_wrapper.cpp"],
language="c++",
include_dirs=[SRC_DIR + "/libff/include", SRC_DIR + "/libff"],
library_dirs = ["/usr/local/lib", SRC_DIR + "/libff/lib",
SRC_DIR + "/libff/build/depends"],
extra_compile_args = ["-std=c++11", "-fPIC", "-shared", "-w", "-static", "-O3"],
extra_link_args = ["-lgmp", "-lzm", "-lff", "-fopenmp", "-g"]
)
),
cmdclass = {'build_ext': build_ext, 'install': CustomBuild},
)