building Ardour in Debian

Hi folks,

After several months of tries, formats and installs, maybe I’m ready to customize Linux for this pc.

First goal is to make some music in Ardour, and “project” is based on Lenny, with some applis from Testing, and important stuff build home with many attention !

In this view, need to make the good choices, and have some questions about best versions for Ardour 2.8 >> scons FREESOUND=1 LV2=1

Is there a magic option to have (or not !) in the 2.6.29.1-rt8 kernel to make it better for Ardour ?

In building Jack from sources, did I have to download Jack1 or Jack2 ?

If build kernel first, then Jack, then all audio applis and libraries, and at last build Ardour, did I make the good choice, or chronology is not important ?

Thanks for helping, and great work in Ardour. Ho, forget to say : good news we can read above the blue “Thanks!” on the right of this page… :slight_smile:

Fred

Hi,

First of all: Unless you are a programmer with lots of experience in C/C++ and a real UNIX hero, too, I recommend you try really hard to get a Linux distribution with a ready-to-run Ardour binary package (maybe ubuntu?).

However, if you’re still sure you want to build it, here is how my build of ardour 2.7.1 was done:

Hardware: Lenovo T60 (laptop)
OS: custom-installed Debian 5 (uname -a: Linux fireant 2.6.26-1-amd64 #1 SMP Sat Jan 10 17:57:00 UTC 2009 x86_64 GNU/Linux)

First, I installed the x11 development headers, the x11 render extension headers, libasound, libz, libexpat, libjpeg, libgpg-error and libgcrypt from the Debian distribution DVD.

The destination for my build of ardour was /usr/local/ardour, you’ll have to replace that with whatever destination directory you’d like to use.

I built the following source packages in the order they are listed here:
boost_1_39_0.tar.gz
libxml2-2.7.3.tar.gz
libxslt-1.1.22.tar.gz
liblo-0.26.tar.gz
fftw-3.2.1.tar.gz
libsamplerate-0.1.7.tar.gz
pixman-0.15.2.tar.gz
libpng-1.2.35.tar.gz
tiff-3.8.2.zip
jasper-1.900.1.zip
xrender-0.8.3.tar.gz
libart_lgpl-2.3.20.tar.gz
freetype-2.3.9.tar.gz
fontconfig-2.6.0.tar.gz
libsndfile-1.0.19.tar.gz
jack-audio-connection-kit-0.116.2.tar.gz
aubio-0.3.2.tar.gz
raptor-1.4.18.tar.gz
liblrdf-0.4.0.tar.gz
glib-2.20.1.tar.gz
cairo-1.8.6.tar.gz
atk-1.26.0.tar.gz
pango-1.24.2.tar.gz
gtk±2.16.1.tar.gz
libglade-2.6.3.tar.gz
libgnomecanvas-2.9.1.tar.gz
libsigc+±2.2.3.tar.gz
glibmm-2.20.0.tar.gz
cairomm-1.8.0.tar.gz
pangomm-2.24.0.tar.gz
gtkmm-2.16.0.tar.gz
scons-1.2.0.tar.gz (nothing to compile, just unpack it)
ardour-2.7.1.tar.bz2

  1. SET ENVIRONMENT VARIABLES:
    BEFORE you start to compile the packages, set the neccessary environment variables:

export CFLAGS="-fPIC -I/usr/local/ardour/include -L/usr/local/ardour/lib -L/usr/local/ardour/lib64"
export CXXFLAGS="-fPIC -I/usr/local/ardour/include -L/usr/local/ardour/lib -L/usr/local/ardour/lib64"
export PATH="/usr/local/ardour/bin:${PATH}"
export LD_LIBRARY_PATH="/usr/local/ardour/lib:/usr/local/ardour/lib64"
export LD_RUN_PATH="/usr/local/ardour/lib:/usr/local/ardour/lib64"
export PKG_CONFIG_PATH="/usr/local/ardour/lib/pkgconfig:/usr/local/ardour/lib64/pkgconfig"

  1. CREATE DESTINATION DIRECTORY AND COPY BOOST:
    mkdir /path/to/destination/directory
    cd /path/to/destination/directory
    mkdir include
    cp -R /path/to/boost_1_39_0/boost ./include/

  2. START BUILDING according to build order:
    ./configure --prefix=/path/to/destination/directory
    make
    make install

If you have multiple processors, you can also use make -j n where n is the number of jobs to run in parallel.
I commonly use two jobs per CPU-thread, so for example that would be make -j 16 for a 4-processor dual-core machine.
Don’t overdo it unless you have lots of memory.

  1. FFTW must be compiled and installed twice:
    fftw needs to be compiled at least twice, each time with different settings
  1. ./configure --disable-single
  2. ./configure --enable-single
    (I also built the double-precision version, using ./configure --enable-long-double; so that would be another build of fftw)
    after each build and install, use “make distclean” before changing the settings and compiling again
  1. LIBLRDF needs some patching:
    in liblrdf’s “examples” directory, the ladspa header file is missing, so you need to create a link before you compile liblrdf, otherwise the build fails:
    cd examples && ln -s …/src/ladspa.h ./ldaspa.h

  2. XRENDER needs some more patching:
    xrender’s configure script is broken, so it creates an empty “-I” parameter for gcc (without specifying an include path)
    in xrender’s configure script, near line 9144, replace the following line:
    RENDER_CFLAGS="-I$x_includes"
    with:
    RENDER_CFLAGS=""
    then, 3 lines below, delete the following line:
    CPPFLAGS="$CPPFLAGS $RENDER_CFLAGS"

for compiling xrender, you also have to tell pkg-config that you really have X11 installed
Debian does not seem to provide an x11.pc configuration file for pkg-config, so either you get it from somewhere else, or you fake it (in the latter case, add -lX11 to the “Libs” line, like:
Libs: -L${libdir} -lX11

after compiling xrender, check the Cflags entry in it’s pkgconfig-file (xrender.pc)
if you see an “-I” with no more text behind it, delete the “-I”, otherwise later builds of other libraries may fail silently until MUCH later, when the ardour build suddenly fails because of unrelocatable symbols

  1. GTK+ needs some workarounds:
    GTK+ configure script forgets the link against libm (the math library), so before compiling GTK+, change CFLAGS and CXXFLAGS:
    export CFLAGS="-fPIC -I/usr/local/ardour/include -L/usr/local/ardour/lib -L/usr/local/ardour/lib64 -lm"
    export CXXFLAGS="-fPIC -I/usr/local/ardour/include -L/usr/local/ardour/lib -L/usr/local/ardour/lib64 -lm"

after building GTK+, UNDO that change (set it to what it was before)

(generally, expect trouble building GTK-related stuff - atk, pango, cairo, glib, glibmm, cairomm, pangomm, etc. - it breaks all the time for numerous reasons, so I can’t tell you how to do a failsafe compile … good luck.)

  1. FINALLY - BUILDING ARDOUR
    FINALLY, after building AND installing (make install) all the libraries, you can build ardour using scons.

Unfortunately, scons seems to break the environment, so pkg-config doesn’t work when called from scons.
As a workaround, create a wrapper script around pkg-config:
mv pkg-config pkg-config-bin
vi pkg-config:
#!/bin/bash

export PKG_CONFIG_PATH=/usr/local/ardour/lib/pkgconfig:/usr/local/ardour/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig

pkg-config-bin $*

After that, everything should work. Now build ardour using scons:
chmod 0755 scons-1.2.0/scripts/*
scons-1.2.0/scripts/scons PREFIX=/path/to/destination/directory
and after that completes successfully:
scons-1.2.0/scripts/scons install

Don’t forget to delete the pkg-config wrapper script and to rename pkg-config-bin back to pkg-config after all the work is done.

Another hint:
DO NOT RUN THE BUILD PROCESS OF ANY PACKAGE AS ROOT (unless you want to scrap every other application on your system)
first, create the destination directory and chown it to your unprivileged user account. then build the packages and install them, after that recursively chown the whole destination directory back to user root / group root.
I’ve seen people unintentionally update, for example, their GTK libraries, breaking everything from GNOME to Firefox on their machine. Repairing that isn’t too much fun.

I hope this information is helpful.

regards,
Robert

@stratojaune:
I’d recommend a complete different strategy to compile ardour on lenny as graphbobby explained. In my view he does to much stuff to get it working like it should.

The way i’d do it:

  • add a new line which is the unstable branch of debian to your sources.list in /etc/apt/sources.list

  • install build-essential via apt

  • create a directory where you want to build ardour

  • do a ssb (simple sid backport) for ardour (2.8.x is included in sid)
    ** apt-get build-dep ardour
    ** apt-get source -t unstable -b ardour
    ** dpkg -i ardour*deb

  • in case you run into troubles, try to learn more about package management :wink:

  • i’m not sure if this description will work flawless, but it will work with slight adjusts, (or maybe do some more ssb’s for ardour depencies)

The way to do a ssb is much more comfortable than compiling most depencies or ardour from scratch (except you want a bleeding edge ardour version from svn). Be aware that you can run into simple depending problems, but the advantages you get with this method are:

  1. everything managed through your package manager
  2. with apt-get build-dep ardour you will install (nearly) all depencies and the correct -dev packages which are neede for building ardour.
  3. using the deb-src package for ardour from unstable is really no problem, and the result is a debian package for your architecture and your debian release.
  4. there will (in the best case) just be one package which is not in lenny, in this case ardour.

If you need more information on that topic, try to search for ssb (simple sid backport), or post the resulting errors/failure outputs here, but I can’t say when I’ll have the time to reply.

Thank you guys for those very verbose answers, but, did this match to questions ??? :-))

Want to say I really apreciate all the time you spend on your keyboards to tell all these things, but if remember the help wanted :

(“Is there a magic option to have (or not !) in the 2.6.29.1-rt8 kernel to make it better for Ardour ? / In building Jack from sources, did I have to download Jack1 or Jack2 ? / If build kernel first, then Jack, then all audio applis and libraries, and at last build Ardour, did I make the good choice, or chronology is not important ?”)

…I have a giant “?” above the head… you just confirm that building Ardour at last is a good choice…

@ robert : I’m not any kind of hero, just want to learn and make it work, no matter how many times it takes, will do it.
@ hg87 : thanx for ssb tip, it could be faster than run scons and take what error message says needed ! Will tell you when tried…

Thanks again for your time sharing,
Peace --fred