[5069da3] | 1 | .. highlight:: bash |
---|
| 2 | |
---|
| 3 | .. _building: |
---|
| 4 | |
---|
| 5 | Building aubio |
---|
| 6 | ============== |
---|
| 7 | |
---|
| 8 | .. note:: |
---|
| 9 | To download a prebuilt version of aubio, see :ref:`download`. |
---|
| 10 | |
---|
| 11 | aubio uses `waf`_ to configure, compile, and test the source. |
---|
| 12 | A copy of waf is included in aubio tarball, so all you need is a terminal, |
---|
| 13 | a compiler, and a recent version of python installed. |
---|
| 14 | |
---|
| 15 | .. note:: |
---|
| 16 | Make sure you have all the :ref:`requirements` you want before building. |
---|
| 17 | |
---|
| 18 | Latest release |
---|
| 19 | -------------- |
---|
| 20 | |
---|
| 21 | The **latest stable release** can be downloaded from https://aubio.org/download:: |
---|
| 22 | |
---|
[6f6c336] | 23 | $ curl -O http://aubio.org/pub/aubio-<version>.tar.bz2 |
---|
| 24 | $ tar xf aubio-<version>.tar.bz2 |
---|
| 25 | $ cd aubio-<version>/ |
---|
[5069da3] | 26 | |
---|
| 27 | Git repository |
---|
| 28 | -------------- |
---|
| 29 | |
---|
| 30 | The **latest git branch** can be obtained with:: |
---|
| 31 | |
---|
| 32 | $ git clone git://git.aubio.org/git/aubio |
---|
[6f6c336] | 33 | $ cd aubio/ |
---|
[5069da3] | 34 | |
---|
| 35 | The following command will fetch the correct `waf`_ version (not included in |
---|
| 36 | aubio's git):: |
---|
| 37 | |
---|
| 38 | $ ./scripts/get_waf.sh |
---|
| 39 | |
---|
| 40 | .. note:: |
---|
| 41 | |
---|
| 42 | Windows users without `Git Bash`_ installed will want to use the following |
---|
| 43 | commands instead: |
---|
| 44 | |
---|
| 45 | .. code:: bash |
---|
| 46 | |
---|
| 47 | $ curl -fsS -o waf https://waf.io/waf-1.8.22 |
---|
| 48 | $ curl -fsS -o waf.bat https://raw.githubusercontent.com/waf-project/waf/master/utils/waf.bat |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | Compiling |
---|
| 52 | --------- |
---|
| 53 | |
---|
| 54 | To compile the C library, examples programs, and tests, run:: |
---|
| 55 | |
---|
| 56 | $ ./waf configure |
---|
| 57 | |
---|
| 58 | Check out the available options using ``./waf configure --help``. Once |
---|
| 59 | you are done with configuration, you can start building:: |
---|
| 60 | |
---|
| 61 | $ ./waf build |
---|
| 62 | |
---|
| 63 | To install the freshly built C library and tools, simply run the following |
---|
| 64 | command:: |
---|
| 65 | |
---|
| 66 | $ sudo ./waf install |
---|
| 67 | |
---|
| 68 | .. note:: |
---|
| 69 | Windows users should simply run ``waf``, without the leading ``./``. For |
---|
| 70 | instance: |
---|
| 71 | |
---|
| 72 | .. code:: bash |
---|
| 73 | |
---|
| 74 | $ waf configure build |
---|
| 75 | |
---|
[4e2173e] | 76 | |
---|
| 77 | Running as a user |
---|
| 78 | ----------------- |
---|
| 79 | |
---|
| 80 | To use aubio without actually installing, for instance if you don't have root |
---|
| 81 | access to install libaubio on your system, |
---|
| 82 | |
---|
| 83 | On Linux or macOS, sourcing the script ``scripts/setenv_local.sh`` should help:: |
---|
| 84 | |
---|
| 85 | $ source ./scripts/setenv_local.sh |
---|
| 86 | |
---|
| 87 | This script sets ``LD_LIBRARY_PATH``, for libaubio, and ``PYTHONPATH`` for the |
---|
| 88 | python module. |
---|
| 89 | |
---|
| 90 | On Linux, you should be able to set ``LD_LIBRARY_PATH`` with:: |
---|
| 91 | |
---|
| 92 | $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/build/src |
---|
| 93 | |
---|
| 94 | On Mac OS X, a copy or a symlink can be made in ``~/lib``:: |
---|
| 95 | |
---|
| 96 | $ mkdir -p ~/lib |
---|
| 97 | $ ln -sf $PWD/build/src/libaubio*.dylib ~/lib/ |
---|
| 98 | |
---|
| 99 | Note on Mac OS X systems older than El Capitan (10.11), the ``DYLD_LIBRARY_PATH`` |
---|
| 100 | variable can be set as follows:: |
---|
| 101 | |
---|
| 102 | $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/build/src |
---|
| 103 | |
---|
[5069da3] | 104 | Cleaning |
---|
| 105 | -------- |
---|
| 106 | |
---|
| 107 | If you wish to uninstall the files installed by the ``install`` command, use |
---|
| 108 | ``uninstall``:: |
---|
| 109 | |
---|
| 110 | $ sudo ./waf uninstall |
---|
| 111 | |
---|
| 112 | To clean the source directory, use the ``clean`` command:: |
---|
| 113 | |
---|
| 114 | $ ./waf clean |
---|
| 115 | |
---|
| 116 | To also forget the options previously passed to the last ``./waf configure`` |
---|
| 117 | invocation, use the ``distclean`` command:: |
---|
| 118 | |
---|
| 119 | $ ./waf distclean |
---|
| 120 | |
---|
| 121 | .. _waf: https://waf.io/ |
---|
| 122 | |
---|
| 123 | .. _Git Bash: https://git-for-windows.github.io/ |
---|
| 124 | |
---|
[4e2173e] | 125 | .. _xcode-frameworks-label: |
---|
| 126 | |
---|
| 127 | .. include:: xcode_frameworks.rst |
---|
| 128 | |
---|
| 129 | .. include:: android.rst |
---|