-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
49 lines (38 loc) · 1.27 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
import os
from setuptools import Extension, setup
from glob import glob
import julia
from Cython.Build import Cythonize, cythonize
from alignment import settings as s
if s.CLEAN:
for path in glob('alignment/**.c*'):
os.remove(path)
if s.BUILD:
paths = set(glob("alignment/*.py"))
paths -= set(["alignment/fede_tuning.py"])
paths -= set(["alignment/settings.py"])
paths -= set(glob("alignment/evaluate_*.py"))
paths -= set(glob("alignment/__init__.py"))
for path in paths:
Cythonize.main([path, "-3", "--inplace"])
extensions = [
Extension("alignment.cdist", ["alignment/cdist.pyx"],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp'])
]
setup(name="cdist",
ext_modules=cythonize(extensions,
compiler_directives={
'language_level': "3",
'embedsignature': True,
'boundscheck': False,
'wraparound': False
}))
julia.install()
# the following two after having installed PyCall and so on
from julia.api import LibJulia # noqa: autoimport
api = LibJulia.load()
api.init_julia(["--project=."])
from julia import Main # noqa: autoimport
Main.eval('using Pkg')
Main.eval('Pkg.instantiate()')