readbeyond / aeneas

aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
http://www.readbeyond.it/aeneas/
GNU Affero General Public License v3.0
2.49k stars 228 forks source link

/usr/bin/ld: cannot find -lespeak #189

Closed frisch1 closed 6 years ago

frisch1 commented 7 years ago

Not sure if it's just me. Whenever I install on a clean Ubuntu 16.04 box, I go through the install steps, then always have to remember how to get around this error:

/usr/bin/ld: cannot find -lespeak

I can never remember if it's one or both of these, so I do both:

in /usr/lib: ln -s /usr/bin/espeak espeak and then sudo apt-get install libespeak-dev

And it works. Not sure if it's worth adding to the directions, or I'm doing something wrong each time that puts me in this hole.

readbeyond commented 7 years ago

Hello Bill,

thank you for your message.

I think that installing the libespeak-dev package, which provides the headers needed to compile the Python C extension cew against the espeak library, should be sufficient.

The script:

https://raw.githubusercontent.com/readbeyond/aeneas/master/install_dependencies.sh

is (roughly) the same used by the Vagrant recipe to set up a working aeneas environment in a Debian virtual machine, and I believe it should work on Ubuntu too. The libespeak-dev package is indeed listed there.

I am not sure about adding a distribution-specific mention in the generic documentation: at that point, for uniformity, we would also need to mention all the other required packages/libraries. However, we might want to add a "troubleshooting" section to the docs, and list this issue with its solution there.

Thank you for your feedback,

Alberto Pettarin

On 10/04/2017 06:05 AM, Bill Frischling wrote:

Not sure if it's just me. Whenever I install on a clean Ubuntu 16.04 box, I go through the install steps, then always have to remember how to get around this error:

/usr/bin/ld: cannot find -lespeak

I can never remember if it's one or both of these, so I do both:

in /usr/lib: ln -s /usr/bin/espeak espeak and then sudo apt-get install libespeak-dev

And it works. Not sure if it's worth adding to the directions, or I'm doing something wrong each time that puts me in this hole.

tsn361 commented 6 years ago

Hi Pettarin,

I have faced the same problem during install on CentOS (3.10.0-693.2.2.el7.x86_64) and already installed all the dependencies and versions are as follows:

I have used the following link as an installation guide: https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md

Till this "sudo pip install -r requirements.txt" command seems everything allright.

[root@ns1 aeneas]# sudo pip install -r requirements.txt
Requirement already satisfied: BeautifulSoup4>=4.5.1 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied: lxml>=3.6.0 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied: numpy>=1.9 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 3))

But on python setup.py build_ext --inplace we got error "cannot find -lespeak". Detail as bellow:

[root@ns1 aeneas]# python setup.py build_ext --inplace
running build_ext
building 'aeneas.cew.cew' extension
C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtun           e=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtu           ne=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC

compile options: '-I['/usr/lib64/python2.7/site-packages/numpy/core/include'] -I/usr/include/python2.7 -c'
gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -L/usr/lib64 -lespeak -lpython2.7 -o build/lib.linux-           x86_64-2.7/aeneas/cew/cew.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libespeak.so when searching for -lespeak
/usr/bin/ld: skipping incompatible /lib/libespeak.so when searching for -lespeak
/usr/bin/ld: skipping incompatible /usr/lib/libespeak.so when searching for -lespeak
/usr/bin/ld: cannot find -lespeak
collect2: error: ld returned 1 exit status
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libespeak.so when searching for -lespeak
/usr/bin/ld: skipping incompatible /lib/libespeak.so when searching for -lespeak
/usr/bin/ld: skipping incompatible /usr/lib/libespeak.so when searching for -lespeak
/usr/bin/ld: cannot find -lespeak
collect2: error: ld returned 1 exit status
error: Command "gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -L/usr/lib64 -lespeak -lpython2.7 -o            build/lib.linux-x86_64-2.7/aeneas/cew/cew.so" failed with exit status 1

It would be really kind if you let me know where I am doing wrong. Thanks, Hossain

readbeyond commented 6 years ago

Hi,

I guess that

yum install espeak

only installs the espeak executable with the voice data; you need to install also the dev/devel version of espeak, as it contains the header files for the espeak C API, needed to compile the aeneas cew extension.

I believe the RPM package is called "espeak-devel": https://centos.pkgs.org/7/centos-x86_64/espeak-devel-1.47.11-4.el7.x86_64.rpm.html

After installing both espeak and espeak-devel, you should be able to pip install aeneas.

HTH,

AP

On 10/27/2017 12:41 PM, Shakhawat Hossain wrote:

Hi Pettarin,

I have faced the same problem during install on CentOS (3.10.0-693.2.2.el7.x86_64) and already installed all the dependencies and versions are as follows:

  • ffmpeg and ffprobe version N-87326-g3ffd3b7 Copyright (c) 2000-2017 the FFmpeg developers
  • Python 2.7.5
  • pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)
  • eSpeak text-to-speech: 1.47.11 03.May.13 Data at: /usr/share/espeak-data (command "sudo yum install espeak")

I have used the following link as an installation guide: https://github.com/readbeyond/aeneas/blob/master/wiki/INSTALL.md

Till this "sudo pip install -r requirements.txt" command seems everything allright.

|[root@ns1 aeneas]# sudo pip install -r requirements.txt Requirement already satisfied: BeautifulSoup4>=4.5.1 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 1)) Requirement already satisfied: lxml>=3.6.0 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 2)) Requirement already satisfied: numpy>=1.9 in /usr/lib64/python2.7/site-packages (from -r requirements.txt (line 3)) |

But on python setup.py build_ext --inplace we got error "cannot find -lespeak". Detail as bellow:

|[root@ns1 aeneas]# python setup.py build_ext --inplace running build_ext building 'aeneas.cew.cew' extension C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtun e=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtu ne=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC compile options: '-I['/usr/lib64/python2.7/site-packages/numpy/core/include'] -I/usr/include/python2.7 -c' gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -L/usr/lib64 -lespeak -lpython2.7 -o build/lib.linux- x86_64-2.7/aeneas/cew/cew.so /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libespeak.so when searching for -lespeak /usr/bin/ld: skipping incompatible /lib/libespeak.so when searching for -lespeak /usr/bin/ld: skipping incompatible /usr/lib/libespeak.so when searching for -lespeak /usr/bin/ld: cannot find -lespeak collect2: error: ld returned 1 exit status /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libespeak.so when searching for -lespeak /usr/bin/ld: skipping incompatible /lib/libespeak.so when searching for -lespeak /usr/bin/ld: skipping incompatible /usr/lib/libespeak.so when searching for -lespeak /usr/bin/ld: cannot find -lespeak collect2: error: ld returned 1 exit status error: Command "gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -L/usr/lib64 -lespeak -lpython2.7 -o build/lib.linux-x86_64-2.7/aeneas/cew/cew.so" failed with exit status 1 |

It would be really kind if you let me know where I am doing wrong. Thanks, Hossain

tsn361 commented 6 years ago

It works. You save my life. Thanks a lot.

MarCnu commented 6 years ago

Thanks for the tip frish1. This installation solved my install failure. Installing espeak wasn't enough it seems.

sudo apt-get install libespeak-dev

I add the copypaste of the error message for Google to index it!

error: Command "x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -lespeak -o build/lib.linux-x86_64-2.7/aeneas/cew/cew.so" failed with exit status 1

  ----------------------------------------
  Failed building wheel for aeneas

error: Command "x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/aeneas/cew/cew_py.o build/temp.linux-x86_64-2.7/aeneas/cew/cew_func.o -lespeak -o build/lib.linux-x86_64-2.7/aeneas/cew/cew.so" failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-v0rVBi/aeneas/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-tk0VyQ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-v0rVBi/aeneas/
readbeyond commented 6 years ago

Bumping up, so I do not forget to add this to the doc of the upcoming 1.7.4

readbeyond commented 6 years ago

Docs updated on devel branch for 1.7.4, closing.

nevertoday commented 2 years ago

libespeak-dev

macos can't do this , so confuse