• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Help needed: compiling sox (linux) [solved]

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,690
Likes
6,012
Location
Berlin, Germany
Hi,
I'd need some help from more experienced linux programmers than me.
I'm trying to compile the SoX audio utility, using the repo/branch https://github.com/ckolivas/sox/tree/cksox which has some nice changes implemented in the "rate" module, also I want to add some new functionality, notably a time-domain block averaging, a "multiply" command (for modulation) and I hope to fix one sore bug, the clipping at 0dBFS which makes no sense at all when the output format is any of floating point types.

To compile, I've followed the instructions from https://audiodigitale.eu/?p=25 . While this does compile successfully (I'm on Ubuntu 18.04 LTS), it produces an in-tree build which is a disaster IHMO. While the .gitignore is set up properly to ignore the in-tree build artifacts I'd still would prefer to have a seperate build directory. Is there a way this build tool can be used for a separate build dir?

The next question: the only build system I have any experience with is CMake where seperate build dir is easy. The repo provides cmake files but it fails in the linking step. I've managed to handle the "pthread" issue but after that link errors (unknown symbols) still keep coming. Anybody have used cmake to compile sox successfully?

And a final question: I really hate dynamic libraries for tools like this. IMHO, such tools must be completely self-contained with all libraries linked statically so I just can simply copy the final executable to a new system without have to care about the libs. I took me half an hour to actually locate the libsox path on my system... The audiodigitale link has a section related to static linking for freeBSD and the guy has announced a version for linux, too, but it is not there right now. Any hints how to to manage that (CMake version preferred, again)?
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,700
Location
Hampshire
I can only help with the official git repo. To build in a separate directory, simply make it the current directory before invoking the configure script, like this:
Code:
$ cd /path/to/build/dir
$ /path/to/sox/configure --disable-shared
$ make

The cmake support was broken and has been removed. The automake based build has been tested on Linux, several BSDs, and Solaris.

I hope to fix one sore bug, the clipping at 0dBFS which makes no sense at all when the output format is any of floating point types.
Unfortunately, the SoX internal format is 32-bit integer. Changing that would be a lot of work.
 
Top Bottom