-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.py.in
More file actions
30 lines (26 loc) · 809 Bytes
/
setup.py.in
File metadata and controls
30 lines (26 loc) · 809 Bytes
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
from distutils.core import setup
from distutils.extension import Extension
import re
creg_sources = ('fdict.cc', 'dict.cc', 'gzstream.cc', 'filelib.cc',
'json_feature_map_lexer.cc')
creg_sources = ['creg/'+fn for fn in creg_sources]
INC = ['creg/', '.', 'python/']
LIB = ['liblbfgs/']
LIBS = re.findall('-l([^\s]+)', '@LIBS@')
CPPFLAGS = re.findall('-[^\s]+', '@CPPFLAGS@ @CXXFLAGS@')
LDFLAGS = re.findall('-[^\s]+', '@LDFLAGS@')
ext_modules = [
Extension(name='_creg',
sources=['python/_creg.cpp'] + creg_sources,
language='c++',
include_dirs=INC,
library_dirs=LIB,
libraries=['lbfgs'] + LIBS,
extra_compile_args=CPPFLAGS,
extra_link_args=LDFLAGS)
]
setup(
name='creg',
ext_modules=ext_modules,
packages=['creg']
)