Skip to content

Instantly share code, notes, and snippets.

@fennecdjay
Created August 25, 2017 10:46
Show Gist options
  • Save fennecdjay/979dde50c3a5b9ecb64ce14b73e06cb4 to your computer and use it in GitHub Desktop.
Save fennecdjay/979dde50c3a5b9ecb64ce14b73e06cb4 to your computer and use it in GitHub Desktop.

Build / Configure Gwion

Table Of Content

Configure

float precision

Gwion can be built using either floator double as floating point type size.
By default, precision is set to float type.
You can change this behavior by passing --double to configure.

--no-double also sets precision to float type.

Drivers

for examples, we use xxx as the driver name.

drivers can be enabled using --xxx as argument.
Similarly, they can be disabled with --no-xxx

You can also set library path: --xxx_lib=/path/to/driver/library
Set driver include path using --xxx_inc=/path/to/driver/include/dir

Driver list

driver name default
spa on
sndfile on
alsa on
jack off
portaudio off
soundio off

there are also two mandatory drivers, which output no sound 😲

  • dummy : computes as fast as possible.
  • silent : computes as slow as realtime.

Don't forget you'll need the headers for your driver (e.g. xxx-dev on debian-like OS)

IMPORTANT

set default driver, otherwise Gwion will use dummy. To do so, use the --d_func flag, e.g.: --d_func=alsa to use alsa driver by default.

Common options

  • program name: --prog=xx (default gwion)
  • compiler : --cc=xxx (default gcc, but clang also works)
  • parser : --yacc=xxx (default yacc)
  • lexer : --lex=xxx (default bison)
  • prefix : --prefix=xxx (default /usr/local)

Instrumentation options

compile with debug flags (-g) using: --memcheck
add coverage instrumentation to the code with --coverage

Directories

Gwion uses a few directories at runtime These options need argument, e.g.: --xxx=dir_name

  • the place of plugins: add

All directories will be prefixed with $PREFIX/lib/Gwion/

Debug flags

This might concerns only people interrested in develloping Gwion.
get Gwion to output useful (in debugging proccess) messages passing it --debug-xxx
All debug flags are off by default.

Debug list

  • compile
  • operator
  • scan0
  • scan1
  • scan2
  • type (type checking phase)
  • emit
  • vm
  • instr (vm instruction)
  • shreduler (shred ordering)
  • stack

Make

Basically, all that is left to do is

make

The only environment variable affecting the operation is PREFIX

Except --(no-)double, everything can be set when running make, using environment variables.

Drivers can be set on using, e.g. for alsa : ALSA_D=1 or ALSA_D=on.
In the same way, then can be disabled with ALSA_D=0 or ALSA_D=off

Just capitalize the options name

to set instrumentation flags at make time, capitalize those and prefix them with "USE_", e.g.: USE_MEMCHECK=1 or USE_COVERAGE=on

Running tests

make tests

to run all tests, or

bash util/test.sh my_file_or_directory (.. other files/dirs ...)

to run specific ones. look here for more.

Install

maybe as root

make install

The only environment variable affecting the operation is PREFIX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment