Emeric Vigier | eebea67 | 2012-08-06 17:36:30 -0400 | [diff] [blame] | 1 | Install Instructions for libsamplerate |
| 2 | ====================================== |
| 3 | |
| 4 | The following instructions explain how to install libsamplerate under |
| 5 | Linux and other Unix like systems including Mac OSX. (For windows, |
| 6 | see http://www.mega-nerd.com/SRC/win32.html). |
| 7 | |
| 8 | Preliminaries |
| 9 | ------------- |
| 10 | 1) Included with libsamplerate is a command line program named |
| 11 | sndfile-resample which uses libnsdile: |
| 12 | |
| 13 | http://www.mega-nerd.com/libsndfile/ |
| 14 | |
| 15 | for file I/O. If you want to use sndfile-resample you need to |
| 16 | ensure that libsndfile is correctly installed first. If it is, the |
| 17 | command "pkg-config --cflags --libs sndfile" should print out |
| 18 | something like this: |
| 19 | |
| 20 | -lsndfile |
| 21 | |
| 22 | If pkg-config doesn't exist you will need need to install it. If |
| 23 | pkg-config cannot find libsndfile you may need install it. If you |
| 24 | install from from a Linux distribution package, make sure you also |
| 25 | install the libsndfile-devel package which contains the header files. |
| 26 | |
| 27 | If libsndfile is installed, you may need to set the PKG_CONFIG_PATH |
| 28 | environment variable. If libsndfile is installed in /usr/local/lib, |
| 29 | you will need to set PKG_CONFIG_PATH using: |
| 30 | |
| 31 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
| 32 | |
| 33 | Pkg-config should now work. If it doesn't you need to fix it if you |
| 34 | want to use sndfile-resample. |
| 35 | |
| 36 | 2) The included tests suite for libsamplerate needs libfftw3 which is |
| 37 | available here: |
| 38 | |
| 39 | http://www.fftw.org/ |
| 40 | |
| 41 | If FFTW3 is not available, libsamplerate should still compile and |
| 42 | install without problems but the test suite will not be as |
| 43 | comprehensive as it normally is. |
| 44 | |
| 45 | Building |
| 46 | -------- |
| 47 | Building and verifying libsamplerate is a four or five step process. |
| 48 | |
| 49 | 1) The first step is to run configure |
| 50 | |
| 51 | ./configure |
| 52 | |
| 53 | which should print out something like the following: |
| 54 | |
| 55 | checking build system type... |
| 56 | ... |
| 57 | ... |
| 58 | -=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- |
| 59 | |
| 60 | Configuration summary : |
| 61 | |
| 62 | Version : ..................... X.Y.Z |
| 63 | Enable debugging : ............ no |
| 64 | |
| 65 | Tools : |
| 66 | |
| 67 | Compiler is GCC : ............. yes |
| 68 | GCC major version : ........... 3 |
| 69 | |
| 70 | Extra tools required for testing and examples : |
| 71 | |
| 72 | Use FFTW : .................... yes |
| 73 | Have libsndfile : ............. yes |
| 74 | |
| 75 | Installation directories : |
| 76 | |
| 77 | Library directory : ........... /usr/local/lib |
| 78 | Program directory : ........... /usr/local/bin |
| 79 | Pkgconfig directory : ......... /usr/local/lib/pkgconfig |
| 80 | |
| 81 | Compiling some other packages against libsamplerate may require |
| 82 | the addition of "/usr/local/lib/pkgconfig" to the |
| 83 | PKG_CONFIG_PATH environment variable. |
| 84 | |
| 85 | There are a number of configure options. See the output of |
| 86 | configure when run with the --help command line option. |
| 87 | |
| 88 | 2) If all goes well with the above then compiling the library can be |
| 89 | done with |
| 90 | |
| 91 | make |
| 92 | |
| 93 | 3) When that has finished, the test suite can be run using: |
| 94 | |
| 95 | make check |
| 96 | |
| 97 | 4) The final step is to install the library. This step needs to be |
| 98 | carried out as the root user (or with sudo): |
| 99 | |
| 100 | make install |
| 101 | |
| 102 | This command will by default install the library in the directory |
| 103 | /usr/local/lib. It can in installed in other location by using the |
| 104 | --prefix option in step 1). |
| 105 | |
| 106 | 5) On linux, one more step is required, the registering of the library |
| 107 | with the system. This is done by running the following command |
| 108 | (also as the root user): |
| 109 | |
| 110 | ldconfig -v |
| 111 | |
| 112 | As a final test, you can run |
| 113 | |
| 114 | sndfile-resample |
| 115 | |
| 116 | to make sure everything is installed correctly. |
| 117 | |