annotate build/README.osx @ 309:003147fdf42c vamp-plugin-sdk-v2.2

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