I am using Linux Mint 18 which seems to have libopus 1.1.2 in the default repositories. I downloaded opus-1.1.3.tar.gz from http://opus-codec.org, extracted it and built it as follows:
sudo make install
I also built the latest opus-tools (opus-tools 0.1.9) the same way.
The problem is when I run "opusenc file.flac file.opus" the command line states "Encoding using libopus 1.1.2 (audio)". Also when I check the version of libopus used to create the file by typing "strings file.opus | grep opus" the output is as follows:
ENCODER=opusenc from opus-tools 0.1.9E
So my question is, how can I ensure that libopus 1.1.3 is used by opusenc? Am I building it correctly? It seems to install ok and I compiled the latest libvorbis 1.3.5 this way and confirmed that my ogg vorbis files were indeed created using libvorbis 1.3.5.
I'd really appreciate if someone can confirm if they have successfully installed libopus 1.1.3 in Linux and can help with this query.
Without bothering you with too much ELF trivia.
You can either:
You can export LD_LIBRARY_PATH if you want opusenc and other tools to just pick the newer library. But that could be dangerous if you installed other self-compiled libraries there.
Ideally, you would switch to a rolling release distribution with a simple package manager, like Arch.
Then, all your packages would be already updated. And you can build packages yourself when needed, instead of (make install)ing stuff directly which is considered bad practice, and a stability hazard.
This might seem obvious, but have you run ldconfig since you plonked your new libraries down?
Many Linux distros now use /etc/ld.so.conf (and files in /etc/ld.so.conf.d) to define the paths to search for shared libraries. Typically this will contain /usr/local/lib, but not always. The paths /usr and /usr/lib are typically "hard-coded" defaults, but entries in LD_LIBRARY_PATH and in /etc/ld.so.conf will be checked first.
You can use the ldd command to check which shared libraries a given program (or library) will use when it runs. Handy when you're trying to get things like this set up.
Hopefully, all that ELF trivia will let you force (err... I meant properly configure) your new library into use. As a last resort, you can uninstall the libopus package, but you might need to do a bunch of messing to get round the dependencies. Or better yet, build the new one into a proper deb package and install that (replace 1.1.2) instead of doing a simple make install which always leads to trouble in the end.
opus: configure && make && make install will install it to /usr/local
opus-tools: configure will use pkg-config to search for opus.
pkg-config --modversion opus
will probably only find the system-installed opus in /usr, the old version.
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ pkg-config --modversion opus
should however find 1.1.3 that you manually installed to /usr/local.Pass that PKG_CONFIG_PATH to configure of opus-tools.
After make and install the command
should show something like libopus.so.0 => /usr/local/lib/libopus.so.0
Thank you very much Xnor and Lithopsian!
I was not really familiar with ldconfig at all (and am still a bit sketchy on it so will read up on it some more) but between both of your replies I managed to get opusenc to use the version of libopus (1.1.3) located in /usr/local/lib. Thanks for all your help!
your reply has nothing to do with picking the right library at run-time. rpath is not enabled by default.
I must be very dumb but I'm trying to compile Opus 1.3.1 and after
sudo make install
-bash: /usr/bin/opusenc: No such file or directory
Won't work. I'm compiling opus-1.3.1.tar.gz and opus-tools-0.2.tar.gz... is there something else I need to compile or I'm doing something wrong?