mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 08:12:24 +03:00
* Add compile args to fix conda compilation on OSX, and increment version
This commit is contained in:
parent
69d27d55b0
commit
e885903dc6
17
setup.py
17
setup.py
|
@ -65,13 +65,13 @@ def name_to_path(mod_name, ext):
|
||||||
return '%s.%s' % (mod_name.replace('.', '/'), ext)
|
return '%s.%s' % (mod_name.replace('.', '/'), ext)
|
||||||
|
|
||||||
|
|
||||||
def c_ext(mod_name, language, includes, compile_args):
|
def c_ext(mod_name, language, includes, compile_args, link_args):
|
||||||
mod_path = name_to_path(mod_name, language)
|
mod_path = name_to_path(mod_name, language)
|
||||||
return Extension(mod_name, [mod_path], include_dirs=includes,
|
return Extension(mod_name, [mod_path], include_dirs=includes,
|
||||||
extra_compile_args=compile_args, extra_link_args=compile_args)
|
extra_compile_args=compile_args, extra_link_args=compile_args)
|
||||||
|
|
||||||
|
|
||||||
def cython_exts(mod_names, language, includes, compile_args):
|
def cython_exts(mod_names, language, includes, compile_args, link_args):
|
||||||
import Cython.Distutils
|
import Cython.Distutils
|
||||||
import Cython.Build
|
import Cython.Build
|
||||||
if language == 'cpp':
|
if language == 'cpp':
|
||||||
|
@ -80,7 +80,7 @@ def cython_exts(mod_names, language, includes, compile_args):
|
||||||
for mod_name in mod_names:
|
for mod_name in mod_names:
|
||||||
mod_path = mod_name.replace('.', '/') + '.pyx'
|
mod_path = mod_name.replace('.', '/') + '.pyx'
|
||||||
e = Extension(mod_name, [mod_path], language=language, include_dirs=includes,
|
e = Extension(mod_name, [mod_path], language=language, include_dirs=includes,
|
||||||
extra_compile_args=compile_args)
|
extra_compile_args=compile_args, extra_link_args=link_args)
|
||||||
exts.append(e)
|
exts.append(e)
|
||||||
return Cython.Build.cythonize(exts)
|
return Cython.Build.cythonize(exts)
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ def run_setup(exts):
|
||||||
description="Industrial-strength NLP",
|
description="Industrial-strength NLP",
|
||||||
author='Matthew Honnibal',
|
author='Matthew Honnibal',
|
||||||
author_email='honnibal@gmail.com',
|
author_email='honnibal@gmail.com',
|
||||||
version='0.65',
|
version='0.66',
|
||||||
url="http://honnibal.github.io/spaCy/",
|
url="http://honnibal.github.io/spaCy/",
|
||||||
package_data={"spacy": ["*.pxd"],
|
package_data={"spacy": ["*.pxd"],
|
||||||
"spacy.en": ["*.pxd", "data/pos/*",
|
"spacy.en": ["*.pxd", "data/pos/*",
|
||||||
|
@ -117,11 +117,14 @@ def run_setup(exts):
|
||||||
def main(modules, is_pypy):
|
def main(modules, is_pypy):
|
||||||
language = "cpp"
|
language = "cpp"
|
||||||
includes = ['.', path.join(sys.prefix, 'include')]
|
includes = ['.', path.join(sys.prefix, 'include')]
|
||||||
compile_args = ['-O3']
|
compile_args = ['-O3', '-std=c++11', '-stdlib=libc++',
|
||||||
|
'-mmacosx-version-min=10.8']
|
||||||
|
link_args = ['-lc++']
|
||||||
if use_cython:
|
if use_cython:
|
||||||
exts = cython_exts(modules, language, includes, compile_args)
|
exts = cython_exts(modules, language, includes, compile_args, link_args)
|
||||||
else:
|
else:
|
||||||
exts = [c_ext(mn, language, includes, compile_args) for mn in modules]
|
exts = [c_ext(mn, language, includes, compile_args, link_args)
|
||||||
|
for mn in modules]
|
||||||
run_setup(exts)
|
run_setup(exts)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user