kylebgorman / pynini

Read-only mirror of Pynini
http://pynini.opengrm.org
Apache License 2.0
120 stars 26 forks source link

[do not merge] adding mason-installed lib and include dirs #1

Open boblannon opened 6 years ago

boblannon commented 6 years ago

Opening this PR for instructive purposes. This is just to show how mason can be used to install Pynini's C++ dependencies. The advantage of using mason is similar to the advantages of virtual environments: nothing depends on the state of the system or its shared libraries. The dependencies can be installed and even interlinked local to the project, making it easy to build/clean/update.

The steps to install become:

  1. clone mason locally (you can also use submodule or do a simple curl install)
cd /path/to/Pynini
git clone git@github.com:mapbox/mason.git .mason
  1. install re2 and openfst. If you need updated versions of either package, they need to be added to mason as a PR. https://github.com/mapbox/mason/pull/580 is an example of updating OpenFST, and should illustrate what needs to be done. Contact me for help if anything's not clear, though.
.mason/mason install re2 2018-08-01
.mason/mason install openfst 1.6.7

This will create a mason_packages folder in the pwd, structured similarly to this (example from a laptop running OSX):

mason_packages/
└── osx-x86_64
    ├── openfst
    │   └── 1.6.7
    └── re2
        └── 2017-08-01
  1. The changes to setup.py in this PR now allow you to make use of the mason-installed header files and libraries, so you can continue with installation as directed in the Pynini documentation.
kylebgorman commented 6 years ago

+1.