merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Speechtools - error importing python wrapper for hybrid synthesis

Open fosimoes opened this issue 6 years ago • 7 comments

This problem has been reported in past issues, but no solution has been presented. Hope somebody can help me with that.

I get the following errors when importing some of the speechtools python wrappers:

ImportError: ./_EST_Wave.so: undefined symbol: _ZN8EST_Wave19default_sample_rateE ImportError: ./_EST_Utterance.so: undefined symbol: est_errjmp

Any clues?

fosimoes avatar Mar 13 '18 03:03 fosimoes

Unfortunately I can't help - I'm currently also dealing with that issue and it seems there are a potential dozen reasons for it to happen.

Currently I assume you need the correct constellation of python, gcc, swig etc. for it to work out - I tried it with a few different settings now (Ubuntu, Mint, Mac OS X, Python 2 and 3, running swig during the makefile, getting the latest gcc etc.) but no luck yet.

m-toman avatar Mar 13 '18 06:03 m-toman

What I have found out so far:

apparently, the python wrappers are not linking with speechtools/lib/libestbase, which is the library where the unrecognized symbols are defined. I don't understand why this happens, though, since I have no compiler/linker warnings.

I don't know if libestbase should be linked statically or dinamically to the wrappers, neither how to force the appropriate linking.

Any kind of help will be aprreciated!

fosimoes avatar Mar 14 '18 03:03 fosimoes

Same error here. I'm not sure if it's system-related, but I do see some cases like failed in Ubuntu 17 but successful in Centos 7. If anyone succeeds in Ubuntu 16, please let me know. Thanks in advance!

licktion avatar Mar 14 '18 07:03 licktion

It happens to me too with http://www.cstr.ed.ac.uk/downloads/festival/2.4/speech_tools-2.4-with-wrappers.tar.gz, Ubuntu 16 My solution is to modify this file: speech_tools-2.4-with-wrappers/wrappers/python/Makefile: At line 87, change from: $(subst XXX,$@,$(MAKE_SHARED_LIB)) $(LIBS) $< to: $(subst XXX,$@,$(MAKE_SHARED_LIB)) $< $(LIBS) because with gcc in Ubuntu, the dependency order is important. The gcc command will be changed from: gcc -shared -o _EST_Wave.so -L../../lib -lestools -L../../lib -lestbase -L../../lib -leststring -lncurses -ldl -lncurses -lm -lstdc++ EST_Wave_wrap.o to: gcc -shared -o _EST_Wave.so EST_Wave_wrap.o -L../../lib -lestools -L../../lib -lestbase -L../../lib -leststring -lncurses -ldl -lncurses -lm -lstdc++ Then before importing this library, don't forget to add the directory containing libest*.so to LD_LIBRARY_PATH (speech_tools-2.4-with-wrappers/lib/)

lehaison avatar Jun 22 '18 07:06 lehaison

@lehaison , Thank you for the resolution, could you please let me know if I'm following this correctly :-

  1. I changed line 86 in speech_tools-2.4-with-wrappers/wrappers/python/Makefile from: $(subst XXX,$@,$(MAKE_SHARED_LIB)) $(LIBS) $< to: $(subst XXX,$@,$(MAKE_SHARED_LIB)) $< $(LIBS) and reinstalled speech-tools by running : a. ./configure
    b. make
    c. make install from the speech_tools-2.4-with-wrappers directory

  2. gcc command change: I'm guessing this change is done implicitly and there is nothing to be done form our end

  3. And before importing EST_Wave I made sure to have LD_LIBRARY_PATH set to speech_tools-2.4-with-wrappers/lib/ command: export LD_LIBRARY_PATH=/home/mypc/Downloads/speech_tools-2.4-with-wrappers/lib/

Tried the above procedure and went ahead on importing EST_Wave, but it still results in the same error. Could you please let me know where I'm going wrong?

ChethanVe avatar Dec 30 '18 20:12 ChethanVe

All is good. You maybe try to "make clean" before Step 1. If Step 1 is done without error, it must be good.

When you import EST_Wave, in fact you import EST_Wave.py, then EST_Wave.py uses _EST_Wave.so (in the same directory). So, one way to check if the linking works is to use "ldd":

ldd /home/mypc/Downloads/speech_tools-2.4-with-wrappers/wrappers/python/_EST_Wave.so

The output without setting LD_LIBRARY_PATH is something like:

linux-vdso.so.1 =>  (0x00007ffe9f9f4000)
libestbase.so => not found
libeststring.so => not found
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f8ac6b9e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8ac6895000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8ac6513000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8ac62fd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8ac5f33000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8ac6fed000)

and after setting:

export LD_LIBRARY_PATH=/home/mypc/Downloads/speech_tools-2.4-with-wrappers/lib

it must be:

linux-vdso.so.1 =>  (0x00007ffc1ed7d000)
libestbase.so => /home/mypc/Downloads/speech_tools-2.4-with-wrappers/lib/libestbase.so (0x00007f72a3409000)
libeststring.so => /home/mypc/Downloads/speech_tools-2.4-with-wrappers/lib/libeststring.so (0x00007f72a31f8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f72a2eef000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f72a2b6d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f72a2957000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f72a258d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f72a3a90000)

For 2, it's right, 2 is the result of 1. Hope this helps.

lehaison avatar Dec 31 '18 06:12 lehaison

Thank you, @lehaison . It worked perfectly!

ChethanVe avatar Jan 06 '19 15:01 ChethanVe