Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pynini.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Home-page: http://pynini.opengrm.org/
Author: Kyle Gorman
Author-email: kbg@google.com
License: UNKNOWN
Description-Content-Type: UNKNOWN
Description: UNKNOWN
Keywords: natural language processing,speech recognition,machine learning
Platform: UNKNOWN
Expand Down
1 change: 1 addition & 0 deletions pynini.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ NEWS
README.rst
pynini.pdf
pynini_test.py
setup.cfg
setup.py
pynini.egg-info/PKG-INFO
pynini.egg-info/SOURCES.txt
Expand Down
26 changes: 26 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,46 @@
from setuptools import Extension
from setuptools import setup

import os
import platform

PROJ_DIR = os.path.dirname(os.path.realpath(__file__))

if platform.system() == 'Linux':
OS='linux'
elif platform.system() == 'Darwin':
OS='osx'
from distutils import sysconfig
config_vars = sysconfig.get_config_vars()
config_vars['LDSHARED'] = config_vars['LDSHARED'].replace('-bundle', '-dynamiclib')

COMPILE_ARGS = ["-std=c++11",
"-Wno-unused-function",
"-Wno-unused-local-typedef",
"-funsigned-char"]

INCLUDE_DIRS = [os.path.join(PROJ_DIR, p).format(OS) for p in [
"mason_packages/{}-x86_64/openfst/1.6.7/include",
"mason_packages/{}-x86_64/re2/2017-08-01/include",
]]

LIBRARY_DIRS = [os.path.join(PROJ_DIR, p).format(OS) for p in [
"mason_packages/{}-x86_64/openfst/1.6.7/lib",
"mason_packages/{}-x86_64/re2/2017-08-01/lib",
]]

pywrapfst = Extension(name="pywrapfst", language="c++",
extra_compile_args=COMPILE_ARGS,
library_dirs=LIBRARY_DIRS,
include_dirs=INCLUDE_DIRS,
libraries=["fstfarscript", "fstfar", "fstscript",
"fst", "m", "dl"],
sources=["src/pywrapfst.cc"])

pynini = Extension(name="pynini", language="c++",
extra_compile_args=COMPILE_ARGS,
library_dirs=LIBRARY_DIRS,
include_dirs=INCLUDE_DIRS,
libraries=["re2",
"fstfarscript",
"fstpdtscript",
Expand Down