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>    
1

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
Edit: fixed the above error by installing the latest Xcode tools and now running ./configure without any errors so far.
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 <unordered_map> ^ 1 error generated. error: command '/usr/bin/clang' failed with exit status 1
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.

2 Comments

@leaf: Consider describing the answer here, in case that github page goes down.
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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.