Skip to topic | Skip to bottom

You are here: ProductDocumentation > MaxUBSDK > IncludingCFM
ProductDocumentation.IncludingCFM r1.2 - 05 Apr 2006 - 04:36 - DavidZicarelli topic end


Start of topic | Skip to actions

Including CFM versions of your object on PowerPC

The MaxCFMAdaptor.shlb and MaxAudioCFMAdaptor.shlb libraries were developed to allow external objects from previous versions to work with Max 4.6 running on the PowerPC processor. We've also made a provision for including CFM code for PowerPC in your Mach-O object, so Max can use it if the user has installed the CFMAdaptor libraries. This allows the CFM code to be used if desired while avoiding conflicts between two different external object files in the search path.

Why would you want to do this? In certain situations, we've observed that Code Warrior does a better job optimizing PowerPC signal processing loops than GCC. The performance difference can be as much as 30%, but is often far less, or non-existent, so before you go to the trouble of including CFM code, you should first determine whether GCC is producing inferior PowerPC code. Bottom line: you have Code Warrior and want to include a CFM version of your object for use with Max 4.6 running on PowerPC, it is possible.

Note that this feature only works with Max 4.6. You can write your PowerPC Mach-O object for use with Max 4.5.x but versions prior to 4.6 will not be able to find and load the CFM code inside a Mach-O bundle. Finally, this feature is only availble for optimizing Max or MSP objects, and will not be available for Jitter objects, where our tests indicate a smaller gain from Code Warrior's PowerPC optimizations versus those of GCC.

Building a CFM Code Resource for Max 4.6

First, you'll need to set up your Code Warrior project to produce a code resource instead of of a shared library. Assuming you already have a Code Warrior project set up, follow these steps to add a code resource target to your project.

  1. Click on the Targets tab in your project window. You will see a list of your targets (or target, if you have only one).
  2. Choose Create Target... from the Project menu.
  3. Click the Clone Existing Target radio button and choose the name of your target from the menu. Name your target something like "Resource" and click OK.
  4. Click on the red-and-white target icon next to your newly created Resource target so that it has the black arrow pointing into it.
  5. Choose Resource Settings from the Edit menu.
  6. Make the Target Setting panel visible. Assuming that the linker is set to Macintosh PowerPC (this is the setting for CFM), the only thing you need to worry about here is the Output Directory. It's best to ensure that your Output Directory is the same as your Xcode project's folder. We suggest keeping your Xcode project file in the same folder as your Code Warrior project. If this is how you have your projects set up, you can just click the Clear button to set the output directory to the project directory.
  7. Make the PPC Target preference panel visible.
  8. Choose Code Resource from the Project type: menu. A number of new text entry fields will appear.
  9. Change the File Name to something ending in .rsrc, for example, myobject.rsrc. This is very important.
  10. Leave the Sym Name and Resource Name fields blank.
  11. You can backspace to clear the Creator and Type fields. These are not important.
  12. Set the ResType to Ocfm (that's the letter O, not a zero).
  13. Set the ResID to 1
  14. Choose None from the Header Type menu. Your object will probably not link unless the Header Type is set to None. Note: The Flatten Resources option in the Code Warrior PPC Target preferences pane supposedly builds a data-fork code resource file. This is nice and modern, but it doesn't work on any version of Code Warrior as far as we can tell. Thus, you are forced to build a traditional resource file with a resource fork. It's not really a problem, since Xcode has no trouble reading these files and producing a data-fork resource file in your Mach-O external object bundle. (If you don't know the difference between the two types of resource files, don't worry about it.)
  15. Click the Save button and close the project settings window.
  16. Build your new Resource target. Verify that there is a file with the specified name (ending in .rsrc) in your project folder.
  17. Open your Xcode project.
  18. Drag the new .rsrc file into your project, moving it into the Resources folder.
  19. Build your Xcode project. You should now have a file called .rsrc in your bundle's Resources folder. This resource file contains your CFM code, and Max will find it when loading your external on a PowerPC machine if CFM support is enabled.

Next: Running Xcode from the Shell

Return to the Max/MSP Universal Binary SDK Table of Contents

-- DavidZicarelli - 05 Apr 2006
to top

-->

You are here: ProductDocumentation > MaxUBSDK > IncludingCFM

to top

Copyright © 2007 Cycling '74. All Rights Reserved.

...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT...WEBCOPYRIGHT... porn free porn