-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
72 lines (54 loc) · 2.11 KB
/
setup.py
File metadata and controls
72 lines (54 loc) · 2.11 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
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
#!/usr/bin/env python
#from setuptools import setup
from setuptools import setup, Extension
from distutils.sysconfig import get_config_var, get_config_vars
from setuptools.command.build_ext import build_ext
from subprocess import call
import os
import sys
# Bail on Python < 3
assert sys.version_info[0] >= 3
# MF. This is a workaround to be able to build the library with MacOS
if sys.platform == 'darwin':
vars = get_config_vars()
vars['LDSHARED'] = vars['LDSHARED'].replace('-bundle','-dynamiclib')
os.environ["CC"] = "clang"
# NB. These are not really Python extensions (i.e., they do not
# Py_Initialize() and they do define main() ), we are just cheating to
# re-use the setuptools build support.
libarlffi = Extension('libarlffi',
sources = ['ffiwrappers/src/arlwrap.c', 'ffiwrappers/src/wrap_support.c', 'ffiwrappers/src/wrappingcore.c'],
undef_macros = ['NDEBUG'],
extra_compile_args = ['-Wno-strict-prototypes'],
libraries= ['cfitsio'],
optional=True,
)
setup(name='algorithm-reference-library',
version='0.9',
python_requires='>=3',
description='Algorithm Reference Library for Radio Interferometry',
long_description=open('README.md').read(),
author='Tim Cornwell, Peter Wortmann, Bojan Nikolic',
author_email='realtimcornwell@gmail.com',
url='https://github.com/SKA-ScienceDataProcessor/algorithm-reference-library',
license='Apache License Version 2.0',
packages=['data_models', 'libs', 'processing_components', 'workflows', 'examples'],
test_suite="tests",
tests_require=['pytest'],
ext_modules = [libarlffi]
)
class CFFIBuild(build_ext):
def run(self):
super().run()
cmd = [
"make",
"BUILD_LIB={}".format(self.build_lib)
]
call(cmd)
#setup(name='FFI_Demo',
# version='0.1',
# python_requires='>=3',
# description = "Demo for compilation of FFI-wrapped Python callable from C",
# ext_modules = [libarlffi])
#,
# cmdclass = {'build_ext': CFFIBuild})