forked from meshpro/pygalmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
40 lines (36 loc) · 1.32 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
import os
from pybind11.setup_helpers import (Pybind11Extension, build_ext,
ParallelCompile, naive_recompile)
from setuptools import setup
# https://github.com/pybind/python_example/
ext_modules = [
Pybind11Extension(
"_pygalmesh",
# Sort input source files to ensure bit-for-bit reproducible builds
# (https://github.com/pybind/python_example/pull/53)
sorted(
[
"src/generate.cpp",
"src/generate_2d.cpp",
"src/generate_from_inr.cpp",
"src/generate_from_inr_with_features.cpp",
"src/generate_from_off.cpp",
"src/generate_periodic.cpp",
"src/generate_periodic_multiple_domains.cpp",
"src/generate_surface_mesh.cpp",
"src/remesh_surface.cpp",
"src/pybind11.cpp",
]
),
include_dirs=[os.environ.get("EIGEN_INCLUDE_DIR", "/usr/include/eigen3/")],
# no CGAL libraries necessary from CGAL 5.0 onwards
libraries=["gmp", "mpfr"],
)
]
if __name__ == "__main__":
ParallelCompile("NPY_NUM_BUILD_JOBS", needs_recompile=naive_recompile).install()
setup(
cmdclass={"build_ext": build_ext},
ext_modules=ext_modules,
zip_safe=False,
)