ok100 / lyvi

🎶 Command-line lyrics (and more!) viewer
http://ok100.github.com/lyvi/
Do What The F*ck You Want To Public License
172 stars 28 forks source link

Installation problems, cannot find -lglyr #37

Closed RonaldFindling closed 9 years ago

RonaldFindling commented 9 years ago

I'm currently trying to install lyvi to use it with cmus on my Ubuntu 14.04. After finding out that the whole process is python3 based (https://github.com/ok100/lyvi/issues/34 ), I tried the following:

# download lyvi
cd ~/bin
git clone https://github.com/ok100/lyvi.git
cd lyvi
# download dependencies
sudo apt-get install python3-pip python-dbus python-gobject
sudo pip3 install cython
git clone https://github.com/sahib/glyr.git
mv glyr glyr-repo
# copy the header files so the compiler can find them
sudo cp -r glyr-repo/lib /usr/include/glyr/
sudo pip3 install plyr # /usr/bin/ld: cannot find -lglyr

For me it looks like the pip3 installation fails because it can't find the "glyr.h" which is located in ~/bin/lyvi/glyr/ and /usr/include/glyr/. I used the manual pip3 install <package> instead of sudo pip3 install -r pip_requirements.txt --use-mirrors because I wanted to make sure were exactly the error occurred.

Any help would be appreciated.

sahib commented 9 years ago

That's because you did not install libglyr, which is why he chokes on finding the library with a cannot find -lglyr. Installing the headers is not enough, you have to compile and install the binary too. libglyr's build system will already take care of this:

(https://github.com/sahib/glyr/wiki/Compiling)

TL;DR:

$ cmake -DCMAKE_INSTALL_PREFIX=/usr 
$ make && sudo make install

Also note that the error happens during install of plyr, the python wrapper of libglyr.

RonaldFindling commented 9 years ago

Oh, I completely forgot to compile. I needed a view more dependencies since glyr depends on glib >= 2.14 and glib depends on libffi-3.1, but after installing all of them I was able to install lyvi. For reproducability the libraries I downloaded, unpacked an installed in the corresponding order: http://www.linuxfromscratch.org/blfs/view/7.6/general/libffi.html

sed -e '/^includesdir/ s:$(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include:$(includedir):' \
    -i include/Makefile.in &&
sed -e '/^includedir/ s:${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include:@includedir@:' \
    -e 's/^Cflags: -I${includedir}/Cflags:/' \
    -i libffi.pc.in        &&
./configure --prefix=/usr --disable-static &&
# make check
sudo make install

http://www.linuxfromscratch.org/blfs/view/7.6/general/glib2.html

./configure --prefix=/usr --with-pcre=system &&
make
sudo make install

https://github.com/sahib/glyr/wiki/Compiling

cmake -DCMAKE_INSTALL_PREFIX=/usr .
make && sudo make install

After that the installation of lyvi(sudo pip install -r pip_requirements.txt --use-mirrors ) was successful and the communication with cmus works out of the box.

Many thanks to ok100 for the tool and to sahib for the help.

PS: I'm not shure how to assign the question label or how to mark this as solved, maybe someone else can do that.

Kabouik commented 4 years ago

I'm having a similar issue despite having successfully compiled and installed libglyr:

[nemo@Sailfish glyr]$ cmake -DCMAKE_INSTALL_PREFIX=/usr .
-- Building Target: release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nemo/Templates/glyr
[nemo@Sailfish glyr]$ make && devel-su make install
[ 74%] Built target glyr
[ 76%] Built target dbcache
[ 78%] Built target threads
[ 80%] Built target simple
[ 85%] Built target glyrc
[ 87%] Built target getinfo
[ 89%] Built target example
[ 90%] Built target exit_signal
[ 92%] Built target ping_url
[ 93%] Built target musictree
[ 94%] Built target async_queue
[ 96%] Built target guess_lang
[ 98%] Built target clean_db
[100%] Built target rating
Password: 
[ 74%] Built target glyr
[ 76%] Built target dbcache
[ 78%] Built target threads
[ 80%] Built target simple
[ 85%] Built target glyrc
[ 87%] Built target getinfo
[ 89%] Built target example
[ 90%] Built target exit_signal
[ 92%] Built target ping_url
[ 93%] Built target musictree
[ 94%] Built target async_queue
[ 96%] Built target guess_lang
[ 98%] Built target clean_db
[100%] Built target rating
Install the project...
-- Install configuration: "release"
-- Up-to-date: /usr/lib/pkgconfig/libglyr.pc
-- Up-to-date: /usr/include/glyr/glyr.h
-- Up-to-date: /usr/include/glyr/types.h
-- Up-to-date: /usr/include/glyr/misc.h
-- Up-to-date: /usr/include/glyr/cache.h
-- Up-to-date: /usr/include/glyr/config.h
-- Up-to-date: /usr/include/glyr/testing.h
-- Up-to-date: /usr/lib/libglyr.so.1.1.0
-- Up-to-date: /usr/lib/libglyr.so.1
-- Up-to-date: /usr/lib/libglyr.so
-- Up-to-date: /usr/bin/glyrc
[nemo@Sailfish glyr]$ cd ../lyvi/
[nemo@Sailfish lyvi]$ devel-su pip install -r pip_requirements.txt --use-mirrors
Password: 

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options] ...
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: --use-mirrors
[nemo@Sailfish lyvi]$ devel-su pip install -r pip_requirements.txt
Password: 
Requirement already satisfied: Pillow in /usr/lib/python3.8/site-packages (from -r pip_requirements.txt (line 4)) (5.4.1)
Collecting plyr
  Using cached plyr-1.0.2.tar.gz (13 kB)
Collecting urwid
  Using cached urwid-2.1.0.tar.gz (630 kB)
Collecting psutil
  Using cached psutil-5.7.0.tar.gz (449 kB)
Using legacy setup.py install for plyr, since package 'wheel' is not installed.
Using legacy setup.py install for urwid, since package 'wheel' is not installed.
Using legacy setup.py install for psutil, since package 'wheel' is not installed.
Installing collected packages: plyr, urwid, psutil
    Running setup.py install for plyr ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bbf68zsz/plyr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bbf68zsz/plyr/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-record-0mrfq_5w/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/plyr
         cwd: /tmp/pip-install-bbf68zsz/plyr/
    Complete output (22 lines):
    Please make sure to:
    - Have libglyr >= 1.0.0 and all developement deps installed.
    - Have a working compiler.

    Cython will be installed automatically.

    running install
    running build
    running build_ext
    cythoning src/glyr.pyx to src/glyr.c
    /usr/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-bbf68zsz/plyr/src/glyr.pyx
      tree = Parsing.p_module(s, pxd, full_module_name)
    building 'plyr' extension
    creating build
    creating build/temp.linux-aarch64-3.8
    creating build/temp.linux-aarch64-3.8/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi -fPIC -I/usr/include/python3.8 -c src/glyr.c -o build/temp.linux-aarch64-3.8/src/glyr.o
    src/glyr.c:4:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bbf68zsz/plyr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bbf68zsz/plyr/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-record-0mrfq_5w/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/plyr Check the logs for full command output.
[nemo@Sailfish lyvi]$ 

Any ideas?

Kabouik commented 4 years ago

I was just missing python3-devel, sorry about the noise.