Closed cecton closed 3 years ago
Hmm, what gcc version are you using? According to the gcc c++ status page, gcc 7 was the first version to support structured bindings. I know for sure gcc 7.3.x and gcc 8.1.x should work fine .
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Ok thanks! 😖
I'm sorry but I really want to use modern C++ features since it makes the code much nicer.
I checked and there's a gcc-7 package in sid, so maybe you can try installing just that package from sid?
In any case, thanks for the report!
Yes this is no problem for me, I just really want to try out XD
If you don't mind helping me (I don't know anything about C++).
Now I keep hitting this:
/usr/bin/ld: cannot find -lboost_python-py3
I made a Dockerfile that might be useful to you if you want to let people build it more easily:
#FROM gcc:7
FROM debian:testing
ADD https://raw.githubusercontent.com/guilhem/apt-get-install/master/apt-get-install /usr/bin/
RUN chmod +x /usr/bin/apt-get-install
RUN apt-get-install libboost-python-dev
ADD . /src
RUN apt-get-install python3-setuptools
RUN apt-get-install build-essential
WORKDIR /src
RUN python3 setup.py build
(It's not cleaned as you can see but I'll produce a proper version when I will succeed to build it)
Full output:
Step 9/9 : RUN python3 setup.py build
---> Running in c10ffe7bcd75
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/bard
copying bard/config.py -> build/lib.linux-x86_64-3.6/bard
copying bard/ffprobemetadata.py -> build/lib.linux-x86_64-3.6/bard
copying bard/__init__.py -> build/lib.linux-x86_64-3.6/bard
copying bard/terminalcolors.py -> build/lib.linux-x86_64-3.6/bard
copying bard/musicdatabase.py -> build/lib.linux-x86_64-3.6/bard
copying bard/song.py -> build/lib.linux-x86_64-3.6/bard
copying bard/comparesongs.py -> build/lib.linux-x86_64-3.6/bard
copying bard/bard.py -> build/lib.linux-x86_64-3.6/bard
copying bard/utils.py -> build/lib.linux-x86_64-3.6/bard
copying bard/normalizetags.py -> build/lib.linux-x86_64-3.6/bard
copying bard/__main__.py -> build/lib.linux-x86_64-3.6/bard
running build_ext
building 'bard_ext' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/bard
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 -DMAJOR_VERSION=1 -DMINOR_VERSION=0 -D_GLIBCXX_PARALLEL -I/usr/include/boost -I/usr/include/python3.6m -c bard/bard_ext.cpp -o build/temp.linux-x86_64-3.6/bard/bard_ext.o -std=gnu++17 -fopenmp -Ofast -march=native -mtune=native -funroll-loops
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/bard/bard_ext.o -lboost_python-py3 -o build/lib.linux-x86_64-3.6/bard_ext.cpython-36m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lboost_python-py3
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
The command '/bin/sh -c python3 setup.py build' returned a non-zero code: 1
Can you try changing libraries=['boost_python-py3'],
to libraries=['boost_python-py36'],
in setup.py? (that is, py3
to py36
)
Btw, you need the mpv player if you want to use the "bard play" command. I'm not sure I documented that anywhere (yes, I should add more documentation, but I wanted to focus on the features first, and the blog post gave it more exposure than I expected :) )
Thanks Phoronix for that XD
Success!
Step 7/7 : RUN python3 setup.py build
---> Running in e0b375516d7e
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/bard
copying bard/config.py -> build/lib.linux-x86_64-3.6/bard
copying bard/ffprobemetadata.py -> build/lib.linux-x86_64-3.6/bard
copying bard/__init__.py -> build/lib.linux-x86_64-3.6/bard
copying bard/terminalcolors.py -> build/lib.linux-x86_64-3.6/bard
copying bard/musicdatabase.py -> build/lib.linux-x86_64-3.6/bard
copying bard/song.py -> build/lib.linux-x86_64-3.6/bard
copying bard/comparesongs.py -> build/lib.linux-x86_64-3.6/bard
copying bard/bard.py -> build/lib.linux-x86_64-3.6/bard
copying bard/utils.py -> build/lib.linux-x86_64-3.6/bard
copying bard/normalizetags.py -> build/lib.linux-x86_64-3.6/bard
copying bard/__main__.py -> build/lib.linux-x86_64-3.6/bard
running build_ext
building 'bard_ext' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/bard
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 -DMAJOR_VERSION=1 -DMINOR_VERSION=0 -D_GLIBCXX_PARALLEL -I/usr/include/boost -I/usr/include/python3.6m -c bard/bard_ext.cpp -o build/temp.linux-x86_64-3.6/bard/bard_ext.o -std=gnu++17 -fopenmp -Ofast -march=native -mtune=native -funroll-loops
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/bard/bard_ext.o -lboost_python-py36 -o build/lib.linux-x86_64-3.6/bard_ext.cpython-36m-x86_64-linux-gnu.so
running build_scripts
creating build/scripts-3.6
copying and adjusting scripts/bard -> build/scripts-3.6
changing mode of build/scripts-3.6/bard from 644 to 755
Removing intermediate container e0b375516d7e
---> 337f54c11afe
Successfully built 337f54c11afe
Successfully tagged bard:latest
Great! Congrats, you're probably the first person to build Bard (apart from me :) )
Since I actually didn't test a clean installation yet and I don't currently have much time to work on this, I'll give you here an example config file you can put at ~/.config/bard
. You can change all paths to something that make sense to you (the database should be created automatically, you shouldn't have to worry about that).
{
"tmpdir": "/tmp/",
"databasePath": "/home/antonio/.local/share/bard/music.db",
"musicPaths": [
"/home/antonio/music",
"/home/antonio/music2"
],
"translatePaths": false,
"pathTranslationMap": [],
"immutableDatabase" : false,
"username" : "antonio"
}
Thanks! I will need that too.
There are a few dependencies probably missing in the setup.py
and also the __main__.py
should be this:
# -*- coding: utf-8 -*-
from bard.bard import main # was: from bard import main
main()
Dependencies: pydub, gmpy, numpy, dbus-python (not sure if it should be installed that way...),
FROM debian:testing
ADD https://raw.githubusercontent.com/guilhem/apt-get-install/master/apt-get-install /usr/bin/
RUN chmod +x /usr/bin/apt-get-install
RUN apt-get-install libboost-python-dev python3-setuptools build-essential libchromaprint-dev ca-certificates ffmpeg python3-dbus libgmp-dev
RUN python3 /usr/lib/python3/dist-packages/easy_install.py pyacoustid mutagen Pillow pydub numpy gmpy
ADD . /src
WORKDIR /src
RUN python3 setup.py build
VOLUME /data
VOLUME /music
RUN mkdir -p ~/.config && echo '{"databasePath":"/data/music.db","musicPaths":["/music"]}' > ~/.config/bard
CMD ["python3", "-mbard"]
(not yet finished but better... will finish another day)
You can install the scripts/bard
file to /usr/bin
to execute bard nicely, but yes, you're right I should update __main__.py
too. Btw, thanks for the list of missing dependencies! I just removed some unused code so gmpy
isn't actually needed anymore.
Inactive, closing
I would like to try things out but I didn't succeed to compile the code properly.
Here is what I installed:
Then I ran:
And I ended up with:
I'm running on Debian on WSL