kylebgorman / pynini

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

how should we install openfst properly to let pynini recognize the library? #13

Closed underdogliu closed 5 years ago

underdogliu commented 5 years ago

Dear Kyle,

Thanks for your previous reply (long time ago) on my issue! I realized that reply a while ago on new version of pynini and playing with it. But I found problem when compiling it.

I compiled an openfst first (version 1.7.1) using below command:

cd tools/openfst-1.7.1/
./configure --enable-static=no --enable-grm
make -j 4

then go to pynini folder at same path (version 2.0.6) and compile it but then it outputted some error about ld calling:

building 'pywrapfst' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -I/home/xuechen/envs/textnorm_new/include/python3.6m -c src/pywrapfst.cc -o build/temp.linux-x86_64-3.6/src/pywrapfst.o -std=c++11 -Wno-unused-function -Wno-unused-local-typedefs -funsigned-char
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/src/pywrapfst.o -lfstfarscript -lfstfar -lfstscript -lfst -lm -ldl -o build/lib.linux-x86_64-3.6/pywrapfst.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lfstfarscript
/usr/bin/ld: cannot find -lfstfar
/usr/bin/ld: cannot find -lfstscript
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1

so I guess the problem is the way of my compiling openfst, making it not "global" enough. Any ideas on how to properly compiling openfst for it? Thanks!

kylebgorman commented 5 years ago

You've compiled OpenFst, but not yet installed it. In tools/openfst-1.7.1 you have also issue sudo make -j4 install to install it.

underdogliu commented 5 years ago

Tried and worked :joy: thanks Kyle

kylebgorman commented 5 years ago

Glad to hear!