annotate build/README.osx @ 354:e85513153c71

Initialise rate to 0. Otherwise there's a danger plugins will change the SampleType (e.g. to VariableSampleRate) but not set the rate because they don't think they need it (when in fact it needs to be set to 0)
author Chris Cannam
date Thu, 28 Mar 2013 15:49:17 +0000
parents c70e1ceb1eff
children 14b34e85523b
rev   line source
cannam@239 1
cannam@239 2 The Vamp Plugin SDK -- Platform Notes for OS/X
cannam@239 3 ==============================================
cannam@239 4
Chris@334 5 Prerequisites
Chris@334 6 -------------
Chris@334 7
Chris@334 8 You must have Xcode installed, with the command-line build tools.
Chris@334 9
Chris@334 10 (If you are using Xcode 4, you may have to go to Preferences ->
Chris@334 11 Downloads -> Components and install the Command Line Tools component.)
Chris@334 12
Chris@334 13 You must have libsndfile (http://www.mega-nerd.com/libsndfile/)
Chris@334 14 installed in order to build the command-line host successfully. But
Chris@334 15 you do not need libsndfile if you only want to build plugins.
Chris@334 16
Chris@334 17
cannam@239 18 Building at the command line
cannam@239 19 ----------------------------
cannam@239 20
cannam@239 21 To build the SDK, example plugins, and command-line host:
cannam@239 22
cannam@291 23 $ make -f build/Makefile.osx
cannam@239 24
Chris@334 25 To build only the SDK and example plugins (for example if you do not
Chris@334 26 have libsndfile installed):
cannam@239 27
cannam@291 28 $ make -f build/Makefile.osx sdk examples
cannam@239 29
cannam@254 30 See the comments at the top of Makefile.osx for more information about
cannam@254 31 the libraries and other targets that are built in this way.
cannam@254 32
Chris@334 33 If you are using an IDE such as Xcode, you may prefer to simply add
Chris@334 34 the vamp-sdk and src/vamp-sdk (for plugins) or vamp-hostsdk and
Chris@334 35 src/vamp-hostsdk (for hosts) directories to your existing project.
Chris@334 36
Chris@334 37 If you are using OS/X 10.6 or older, use Makefile.osx.106 instead of
Chris@334 38 Makefile.osx.
cannam@239 39
cannam@239 40
cannam@239 41 Installing the Example Plugins
cannam@239 42 ------------------------------
cannam@239 43
cannam@239 44 To install the example plugins so you can load them in Vamp hosts,
cannam@239 45 copy the files
cannam@239 46
cannam@239 47 examples/vamp-example-plugins.dylib
cannam@239 48 and
cannam@239 49 examples/vamp-example-plugins.cat
cannam@239 50
cannam@239 51 to
cannam@239 52 /Library/Audio/Plug-Ins/Vamp/
cannam@239 53 or
cannam@239 54 $HOME/Library/Audio/Plug-Ins/Vamp/
cannam@239 55
cannam@239 56
cannam@239 57 Plugin Linkage
cannam@239 58 --------------
cannam@239 59
cannam@292 60 Vamp plugins are distributed as dynamic libraries (.dylib). An OS/X
cannam@292 61 dynamic library has a formal installed name, which is recorded in the
cannam@292 62 library's header: you will need to ensure that this matches the
cannam@292 63 plugin's filename (e.g. vamp-example-plugins.dylib) by using the
cannam@292 64 -install_name <name> option at link time. The Makefile.osx provided
cannam@292 65 with the SDK contains an example of this.
cannam@292 66
cannam@292 67 A well-packaged Vamp plugin library should export exactly one public
cannam@239 68 symbol, namely the Vamp API entry point vampGetPluginDescriptor.
cannam@239 69
cannam@239 70 The default for the OS/X linker is to export all of the symbols in the
cannam@239 71 library. This will work (the host will be able to load the plugin),
cannam@239 72 but it unnecessarily pollutes the host's symbol namespace, it may
cannam@239 73 cause symbol collisions in some esoteric circumstances, and it
cannam@239 74 increases the amount of time the plugin takes to load.
cannam@239 75
cannam@239 76 To improve this behaviour, you can instruct the linker to export only
cannam@239 77 the one required symbol using a symbols list file. To do this, place
cannam@239 78 the single line
cannam@239 79
cannam@239 80 _vampGetPluginDescriptor
cannam@239 81
cannam@239 82 (with leading underscore) into a text file, and then use the
cannam@239 83 -exported_symbols_list option to the linker to tell it to refer to
cannam@239 84 this file. All other symbols will then be properly hidden.
cannam@239 85
cannam@239 86 The Makefile.osx included in this SDK uses this method to manage
cannam@239 87 symbol visibility for the included example plugins, using the file
cannam@239 88 build/vamp-plugin.list. There are other methods that will work too,
cannam@239 89 but this one is simple and has the advantage of requiring no changes
cannam@239 90 to the code.
cannam@239 91
cannam@291 92
cannam@291 93 Test Your Plugins
cannam@291 94 -----------------
cannam@291 95
cannam@291 96 The Vamp Plugin Tester is a vital utility which you can use to test
cannam@291 97 your plugins for common problems. It can help you if you're having
cannam@291 98 problems getting your plugin to work at all, and you're strongly
cannam@291 99 advised to use it before you release anything. Download it from the
cannam@291 100 Vamp plugins site now!
cannam@291 101