-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
40 lines (35 loc) · 1.03 KB
/
setup.py
File metadata and controls
40 lines (35 loc) · 1.03 KB
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
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext
import sys
import sysconfig
import numpy as np
cxx_std = 17
extra_compile_args = []
extra_link_args = []
# linux environment, default
extra_compile_args += ["-O2", "-ffast-math", "-march=native", "-fopenmp", "-Wall", "-Wextra", "-Wpedantic", "-mavx2", "-mfma"]
extra_link_args += ["-fopenmp"]
ext_modules = [
Pybind11Extension(
"flashashing",
sources=[
"csrc/sha256_base.cpp",
"csrc/sha256_simd.cpp",
'csrc/blake3_avx2.cpp',
"csrc/blake3_base.cpp",
"csrc/binding.cpp"
],
include_dirs=[np.get_include()],
cxx_std=cxx_std,
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
]
setup(
name="flashashing",
version="0.1.0",
description="High performance hashing (SHA-256, BLAKE3) implementation with pybind11",
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
)