forked from msanchezc/pycupid
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
167 lines (153 loc) · 3.82 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import os
import sys
import subprocess
import platform
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
WRAPPER_DIR = 'pycupid'
CUPID_DIR = 'cupid'
wrapper_sources = [
'pycupid',
]
cupid_sources = [
'cupidcfaddpixel.c',
'cupidcfdeleteps.c',
'cupidcferode.c',
'cupidcffreeps.c',
'cupidcfidl.c',
'cupidcflevels.c',
'cupidcfmakeps.c',
'cupidcfnebs.c',
'cupidcfscan.c',
'cupidcfxfer.c',
'cupidclumpfind.c',
'cupidconfigD.c',
'cupidconfigI.c',
'cupidconfigrms.c',
'cupiddefminpix.c',
'cupidfellwalker.c',
'cupidfwjoin.c',
'cupidfwmain.c',
'cupidfwpixelsets.c',
'cupidgaussclumps.c',
'cupidgccalcf.c',
'cupidgccalcg.c',
'cupidgcchisq.c',
'cupidgcdump.c',
'cupidgcfindmax.c',
'cupidgcfit.c',
'cupidgclistclump.c',
'cupidgcmodel.c',
'cupidgcndfclump.c',
'cupidgcprofwidth.c',
'cupidgcsetinit.c',
'cupidgcupdatearrays.c',
'cupidndfclump.c',
'cupidrca.c',
'cupidrca2.c',
'cupidrcheckface.c',
'cupidrcopyline.c',
'cupidredges.c',
'cupidreinhold.c',
'cupidrfill.c',
'cupidrfillclumps.c',
'cupidrfillline.c',
'cupidrinitedges.c',
'cupidsumclumps.c',
]
ext = '.pyx'
libs = ["libary.*",
"libast_ems.*",
"libast_err.*",
"libast_grf_2.0.*",
"libast_grf_3.2.*",
"libast_grf3d.*",
"libast_grf_5.6.*",
"libast_pal.*",
"libast.*",
"libchr.*",
"libcnf.*",
"libemsf.*",
"libems.*",
"liberr_standalone.*",
"libhdsf.*",
"libhds.*",
"libndf.*",
"libpda.*",
"libprm_a.*",
"libprm.*",
"libpsx.*",
"libstarmem.*",
"libstarutil.*"]
if "Linux" in platform.platform():
libs = [l.replace(".*",".so*") for l in libs]
else:
libs = [l.replace(".*","*.dylib*") for l in libs]
libs = [os.path.join("star","lib",lib) for lib in libs ]
wrapper_sources = [os.path.join(WRAPPER_DIR, s + ext) for s in wrapper_sources]
cupid_sources = [os.path.join(CUPID_DIR, "src", s) for s in cupid_sources]
ext_sources = wrapper_sources + cupid_sources
extensions = [
Extension(
"pycupid.pycupid",
ext_sources,
include_dirs = [os.path.join(WRAPPER_DIR, "star", "include"),
os.path.join(CUPID_DIR, "include")],
library_dirs = [os.path.join(WRAPPER_DIR, "star", "lib")],
extra_link_args = ["-Wl,-rpath," + os.path.join("$ORIGIN", "star", "lib")],
extra_compile_args = ["-std=c99"],
libraries = [
"ast",
"err_standalone",
"hds",
"ndf",
"pda",
# AST
"ast_pal",
"ast_grf_2.0",
"ast_grf_3.2",
"ast_grf_5.6",
"ast_grf3d",
"ast_pass2",
"ast_err",
"m",
# MERS
"chr",
"emsf",
"ems",
"cnf",
"starmem",
"pthread",
"starutil",
# HDS
"hdsf",
"hds",
# NDF
"psx",
"ary",
"prm",
"prm_a",
"ast_ems",
]
),
]
setup(
name = 'pycupid',
cmdclass = {'build_ext': build_ext},
ext_modules = extensions,
package_data = {'pycupid': libs},
version = '0.1.7',
author = u'LIRAE TEAM',
author_email = '[email protected]',
packages = ['pycupid'],
url = 'https://github.com/ChileanVirtualObservatory/pycupid',
description = 'Python wrappers for Starlink\'s CUPID package',
install_requires = {
'numpy >= 1.11.2',
},
python_requires='==2.7.*, ==3.4.*, ==3.5.*, ==3.6.*'
)