4

I'm having trouble installing Pyfst, which is a Python wrapper for OpenFst. I've tried using

pip install pyfst    

but always end up with an error about some "unordered_map" which can't be found. Here's part of the stack trace:

In file included from fst/_fst.cpp:321:

/usr/local/include/fst/symbol-table.h:26:10: fatal error: 'unordered_map' file not found

#include <unordered_map>    
istewart
  • 437
  • 5
  • 18
  • 3
    I have had the same error. There's an open issue here: https://github.com/vchahun/pyfst/issues/24 – Delip Sep 15 '15 at 16:19

2 Answers2

4

Figured out a solution...

Environment: Ubuntu Server 14.04

Build and install OpenFST:

mkdir openfst
cd openfst
wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.5.0.tar.gz
tar zxf openfst-1.5.0.tar.gz
cd openfst-1.5.0
./configure
make
sudo make install

The Magic:

sudo CFLAGS="-std=c++0x" pip install pyfst

Hope this helps.

Lee Morris
  • 41
  • 2
  • Thanks for the suggestion! I'm running Mac OSX, and I got as far as ./configure before I hit the following error: `checking whether we are cross compiling... configure: error: in '/Downloads/openfst/openfst-1.5.0': configure: error: cannot run C compiled programs.` – istewart Jan 06 '16 at 18:01
  • Edit: fixed the above error by installing the latest Xcode tools and now running `./configure` without any errors so far. – istewart Jan 07 '16 at 01:06
  • 1
    Last update: I was able to run the `./configure` and `make install` commands as directed. However when I tried running `pip install` as directed I got a similar `unordered map error`: `/usr/local/include/fst/symbol-table.h:26:10: fatal error: 'unordered_map' file not found #include ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1` – istewart Jan 07 '16 at 01:26
1

i also came across the problem,but i solved it easily!

https://github.com/UFAL-DSG/pyfst

You should install OpenFst first,then to install fst!For more details,look at the link above.

Leaf
  • 11
  • 1
  • @leaf: Consider describing the answer here, in case that github page goes down. – Arafangion Mar 08 '17 at 03:03
  • Still doesn't work for me and I get a c++ error => c++: error: unrecognized command line option '-stdlib=libstdc++' command 'c++' failed with exit status 1 error: command 'c++' failed with exit status 1 – istewart Mar 09 '17 at 05:46