-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
58 lines (51 loc) · 1.62 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 os
import glob
import platform
import numpy as np
from distutils.core import setup, Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
"""
Run setup with the following command:
```
python setup.py build_ext --inplace
```
"""
# Determine current directory of this setup file to find our module
CUR_DIR = os.path.dirname(__file__)
sys_name = platform.system()
if sys_name == 'Linux':
libigl_incs = ['/usr/local/include/']
elif sys_name == 'Windows':
libigl_incs = ['C:/lib/libigl/include']
libigl_incs += [os.path.join(libigl_incs[-1],'..','external','eigen')]
self_incs = [os.path.join(CUR_DIR, 'src')]
if sys_name == 'Linux':
extensions = [
Extension('p2mesh._p2mesh',
sources=[os.path.join(CUR_DIR, '_cy_p2mesh.pyx')],
language='c++',
include_dirs=[np.get_include()] + libigl_incs + self_incs,
extra_compile_args=['-O3', '-w'],
# extra_link_args=
)]
elif sys_name == 'Windows':
extensions = [
Extension('p2mesh._p2mesh',
sources=[os.path.join(CUR_DIR, '_cy_p2mesh.pyx')],
language='c++',
include_dirs=[np.get_include()] + libigl_incs + self_incs,
extra_compile_args=['/O2'],
# extra_link_args=
)]
setup(
name="p2mesh._p2mesh",
version = "0.0.1",
author = "Chen Feng",
author_email= "[email protected]",
description="python wrapper for libigl's igl::point_mesh_squared_distance function",
# platforms=
license="BSD",
cmdclass={'build_ext': build_ext},
ext_modules=cythonize(extensions)
)