Requirments
To run SmartBody on iOS devices you will need:
- Mac computer, where you should have fairly recent mac operating system.
- iOS device on which the software should also be recent.
- Apple developing ID which allows you to develop on your devices.
- XCode whose downloads require apple ID, it's also the porter where you download the application onto your device.
To be more clearly, all the things required for developing iOS application doesn't have to be all up-to-date, but they need to be matching versions and if you accidentally upgrade your device there's no backward compatibility. It's always a good habit to keep updating all your software.
Due to software version problem, the xcode version and location described below are yield to change.
Compiling with console
There's many steps in the following tables, but you can choose either build yourself or pre-built version can be found at trunk/ios/libs/iphoneos
Compiling using console | |
---|---|
1 | Cross compiling apr (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
2 | Cross compiling apr-util (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
3 | Cross compiling activemq-cpp-library (You can find prebuilt library at trunk/ios/libs/iphoneos)
Note: for smartbody iphone running on unity, we need to rename variables inside activemq-cpp-library decaf/internal/util/zip/*.c to avoid conflict symbols. If you don't want to do that, you can directly use the one under trunk/ios/activemq/activemq-cpp/libs/activemq-unity |
4 | Cross compiling xerces-c (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
5 | Cross compiling ODE (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
6 | Cross compiling clapack (Not required. If you chose not to cross compile, make sure you add Acceleration framework from xcode project)
-Go to clapack/CMakeLists.txt, comment out include(CTest) and add_subdirectory(TESTING)
|
7 | Cross compiling python (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
8 | Cross compiling libsndfile (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
9 | Cross compiling freealut (You can find prebuilt library at trunk/ios/libs/iphoneos)
|
10 | Cross compiling pocket sphinx (Not required) Download from http://www.rajeevan.co.uk/pocketsphinx_in_iphone/. The steps are on the website. P.S.
|
Compiling with XCode
Libraries
Compiling using Xcode4 | |
---|---|
1 | Build bonebus
|
2 | Build boost libraries (You can find prebuilt library at trunk/ios/libs/iphoneos, version 1.51)
|
3 | Build steersuite
|
4 | Build vhmsg
|
5 | Build vhcl
|
6 | Build wsp
|
7 | Build smartbody-lib (Currently including boost1.5, python2.65)
P.S. This xcode project needs maintenance by the developer to make sure it incorporates all the file from SmartBody core. |
8 | Build smartbody-dll
|
9 | Build vhwrapper-dll (Not required, for Unity only)
|
Applications
Once those steps have been completed, you can build any of three applications:
- smartbody-openglES - a simple example of using SmartBody with OpenGL
- smartbody-ogre - an example of using SmartBody with the Ogre3D rendering engine
- smartbody-unity - The Unity3D game engine connected to SmartBody.
Make sure that your iOS device is connected and follow any of the three applications below:
Building smartbody-openglES | |
---|---|
1 | Build smartbody-openglES Go to trunk/ios/applications/minimal, open smartbody-iphone.xcodeproj, build and run. P.S. Under smartbody-openglES project Frameworks, you should see all the libraries existing. If not, go over previous steps to check if anything is wrong |
Building smartbody-ogre | |
---|---|
1 | Build ogre iphone
|
2 | Build smartbody ogre application
p.s.
|
Building smartbody-unity | |
---|---|
1 | Check out the project
|
2 | Build unity project into xcode
|
3 | Compile xcode project and run
|
Notes
- smartbody-iphone.xcworkspace needs to change if there's file changes under SmartBoby.
- vhwrapper.h and vhwrapper.cpp are copied from VH svn, they are used to build smartbody unity application. So if these two files got changed outside, they have to be copied over again and modifies maybe needed to make it working.
- Since python26 has only been built for iOS device, SmartBody won't be available on iPhone simulator for now.
Comments:
You can compile the libraries using Xcode 4.3 and iOS SDK 5.1. (note that Xcode 4.0.2 will not run on Lion) I managed to compile apr, apr-util, and activemq-cpp. You need to modify the script files, though. 1. you need to replace the "/Developer" path prefix for DEVROOT with "/Applications/Xcode.app/Contents/Developer" 2. change the SDK version to 5.1 3. for the iphoneos scripts, replace the compiler variables with export CPP="$DEVROOT/usr/bin/gcc -E" the trick here is to define cpp as "gcc -E" ![]() |
It is convenient to build fat libraries for iOS development: then you do not have to worry about including the correct library when selecting between simulator and device targets. After you build libraries for both device and simulator, run something like this with $1 set to the trunk/ios/libs: ROOT_DIR=$1 for l in `ls "$ROOT_DIR/iphoneos/"` It will generate .a files in trunk/ios/libs that you can include in your project. ![]() |
Yeah, it is good to build fat libraries. I think I ran into problem trying to build python for simulator targets. Same problem happens with few particular libraries. So I kept it separate to make all the libraries consistent. ![]() |
Thanks for the tips. I think there's a third way we can solve this problem, build gcc 4.2 from source ![]() |
Here are my results of testing these steps. Environment: Used pre-compiled libraries instead of building my own (\trunk\ios\libs) Updated Xcode project files to include the latest smartbody C++ files. Committed headers of the 3rd party libs in the 'Compiling using console' section Committed boost binaries to svn Started with 'Compiling using Xcode4' section. Recommendations: - Headers and libs have been committed to /trunk/ios. We should modify the header locations to pull from - We should also use vhwrapper-dll in the VH repo to prevent duplication.
svn revisions:
![]() |
![]() |
A better way to build boost is to use boost.sh from https://gitorious.org/~galbraithjoseph/boostoniphone/galbraithjosephs-boostoniphone. It check a version of boost from boost svn repository, compiles boost into a framework that can be used by XCode or other build tools. It also builds a universal library for OSX in the same pass. You can find the script locally at https://svn.ict.usc.edu/svn_vh/branches/mNL/3rd_party/boost/ ![]() |