-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathsetup.py
58 lines (52 loc) · 1.56 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
import platform
from setuptools import setup, Extension
import numpy
if platform.system() == "Windows":
openmp_args = ["/openmp", "/std:c++11"]
openmp_linking_args = []
openmp_macro = [("CSF_USE_OPENMP", None)]
elif platform.system() == "Linux":
openmp_args = ["-fopenmp", "-std=c++11"]
openmp_linking_args = ["-fopenmp"]
openmp_macro = [("CSF_USE_OPENMP", None)]
else: # macOS, macOS clang won't come with openmp
openmp_args = ["-std=c++11"]
openmp_linking_args = []
openmp_macro = []
with open("README.md", encoding="utf8") as readme:
readme_content = readme.read()
sources = [
"python/CSF/CSF_wrap.cxx",
"src/c2cdist.cpp",
"src/Cloth.cpp",
"src/CSF.cpp",
"src/Particle.cpp",
"src/point_cloud.cpp",
"src/Rasterization.cpp",
"src/XYZReader.cpp",
]
include_dirs = ["src/", numpy.get_include()]
csf_module = Extension(
name="_CSF",
sources=sources,
include_dirs=include_dirs,
extra_compile_args=openmp_args,
extra_link_args=openmp_linking_args,
define_macros=openmp_macro
)
setup(
name="cloth_simulation_filter",
version="1.1.5",
author="Jianbo Qi",
url="http://ramm.bnu.edu.cn/projects/CSF/",
long_description=readme_content,
long_description_content_type='text/markdown',
maintainer="Jianbo Qi",
maintainer_email="jianboqi@126.com",
license="Apache-2.0",
keywords="LiDAR DTM DSM Classification",
description="CSF: Ground Filtering based on Cloth Simulation",
package_dir={"": "python/CSF"},
ext_modules=[csf_module],
py_modules=["CSF"],
)