annotate src/vamp-plugin-sdk-2.5/build/README.osx @ 56:af97cad61ff0

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