• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). Come here to have fun, be ready to be teased and not take online life too seriously. We now measure and review equipment for free! Click here for details.

Help needed: compiling sox (linux) [solved]

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
1,563
Likes
3,346
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)?
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
12,852
Likes
19,519
@mansr might be able to help.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
3,889
Likes
8,741
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.
 
OP
KSTR

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
1,563
Likes
3,346
Location
Berlin, Germany
@mansr, thank you very much.

Re automake, I knew it would be simple but failed googling. Works like a charm.

Re internal integer format, OK, I see, no way.
 
Top Bottom