Proper building process with current XCode

Post Reply
p1p1
Posts: 2
Joined: Thu Aug 20, 2015 6:53 pm

Proper building process with current XCode

Post by p1p1 »

Hello, everybody!

I am new to Bullet, though I have some experience with 2d physics engines like Box2d and Chipmunk.
I decided to switch my iOS game to Bullet because I want more advanced control over destruction of my objects, therefore I need advanced breakable joints.
I am currently doing very first steps in learning Bullet, and my questions are mostly about the integration process...

As far as I know, there are two options for including Bullet into an existing project – by building and linking with a static library or by including the sources directly into the project (almost the same as static linking).
As soon as I tried building Bullet on my MacOS, I immediately ran into several questions and 'issues' with target architectures and version numbers.

The XCode build process (for MacOS X / iOS) involves generating xcode4 targets. I don't really understand why using outdated version numbers, current XCode version is 6 already.
Next, whatever I do, my libraries are named with _x64_ suffix, even when building Bullet after 'make'ing with --ios option.
I suppose, this is just naming, and can be ignored, though that is somewhat confusing.

I tried the second way of integrating by including all of Bullet sources into my iOS project directly, without building an intermediate library.
All of that compiled successfully, but I get a lot of warnings from LLVC about deprecated code, unused variables, functions and entities and skipped code paths, that seems odd to me.
I don't really understand the process of building for target ARM devices (iPhone, iPad and various Androids).
What do I have to specify to use optimized ARM math for vectors and matrices with Bullet ?
Do i need to define BT_USE_NEON myself, when directly including the sources into my project? What other '#defines' are there to look for?
What is the proper setup of #defines for building a static library for 32-bit ARM6 iOS on my 64bit Mac OS X ?
What is the proper setup of #defines for building a static library for 64-bit ARM7/ARM8/ARM64 iOS on my 64bit Mac OS X ?

Code: Select all

iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3FindSeparatingAxis.h
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3FindSeparatingAxis.h:19:13: Unused variable 'vertex'
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h:115:6: Unused variable 'numContacts'
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h:196:8: Unused variable 'curMaxDist'
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h:402:11: Unused variable 'distance'
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h:466:6: Unused variable 'numContactsOut'
iOS/Bullet/Bullet3Collision/NarrowPhaseCollision/shared/b3ContactConvexConvexSAT.h:465:6: Unused variable 'contactCapacity'
iOS/Bullet/LinearMath/btAlignedObjectArray.h
iOS/Bullet/LinearMath/btAlignedObjectArray.h:214:10: 'register' storage class specifier is deprecated
iOS/Bullet/LinearMath/btAlignedObjectArray.h:241:10: 'register' storage class specifier is deprecated
iOS/Bullet/LinearMath/btAlignedObjectArray.h:254:10: 'register' storage class specifier is deprecated
iOS/Bullet/LinearMath/btAlignedObjectArray.h:270:10: 'register' storage class specifier is deprecated
iOS/Bullet/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp
iOS/Bullet/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp:513:37: Code will never be executed
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:34:13: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int'
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:73:14: Implicit conversion loses integer precision: 'long' to 'int'
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:78:15: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int'
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:561:13: Unused variable 'brokenDNA'
iOS/Bullet/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:773:17: Code will never be executed
iOS/Bullet/Bullet3Dynamics/ConstraintSolver/b3Point2PointConstraint.cpp
iOS/Bullet/Bullet3Dynamics/ConstraintSolver/b3Point2PointConstraint.cpp:86:12: Unused variable 'a1a'
iOS/Bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
iOS/Bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:184:21: Unused function 'gResolveSingleConstraintRowGeneric_sse4_1_fma3'
iOS/Bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp:241:21: Unused function 'gResolveSingleConstraintRowLowerLimit_sse4_1_fma3'
iOS/Bullet/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.h
iOS/Bullet/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.h:968:13: Unused variable 'resultNormal'
iOS/Bullet/Bullet3Collision/BroadPhaseCollision/b3DynamicBvh.h:1027:14: Unused variable 'resultNormal'
iOS/Bullet/Bullet3Common/b3Vector3.cpp
iOS/Bullet/Bullet3Common/b3Vector3.cpp:393:13: Variable 'x' may be uninitialized when used here
iOS/Bullet/Bullet3Common/b3Vector3.cpp:393:15: Variable 'y' may be uninitialized when used here
...
// many more
These kind of warnings are all over Bullet sourcetree. How do you silence them properly?
Say, for b3File, I can probably rewrite buffer sizes for standard typing, that's an easy case, but I am not sure about all other variables and stuff inside the physics engine itself.
What troubles me most – with this kind of code quality, how can I be sure that I am getting proper code paths for desired target architectures? (especially when speaking of ARM vector instructions)
The ExampleBrowser is building with same warnings, though it succeeds and works seemingly ok. But still, the warnings confuse me a lot. Do all developers get same warnings when building Bullet with XCode?
Can anyone clarify these questions? I guess there's plenty of iOS lazy guys like me, who would also like to integrate Bullet into their lazy projects...
But do I really have to reverse-engineer it to be sure of how it works?
Post Reply