Re: Chipmunk warning: high GJK iterations
Posted: Thu Dec 03, 2015 2:11 pm
Try adding "-fno-fast-math" to the compiler flags for cpRobust.c. (Click the project > Build Phases > Compile Sources)
The version of clang that comes with Xcode 7+ broke a risky optimization I had used in the GJK and EPA algorithms to avoid needing arbitrary thresholds. I was relying on an inlined function to generate the exact same results when inlined in different places. The fix was to move the two functions to a separate file where unsafe math optimizations were not allowed. It fixes the problem without requiring me to add thresholds, and without measurably affecting performance. It did make the build a little more complicated though.
I would *highly* recommend compiling Chipmunk as a static library or adding the Chipmunk project to yours as a subproject. It avoids build problems like this and makes it easy to integrate bug fixes. Really I would recommend this for any library.
The version of clang that comes with Xcode 7+ broke a risky optimization I had used in the GJK and EPA algorithms to avoid needing arbitrary thresholds. I was relying on an inlined function to generate the exact same results when inlined in different places. The fix was to move the two functions to a separate file where unsafe math optimizations were not allowed. It fixes the problem without requiring me to add thresholds, and without measurably affecting performance. It did make the build a little more complicated though.
I would *highly* recommend compiling Chipmunk as a static library or adding the Chipmunk project to yours as a subproject. It avoids build problems like this and makes it easy to integrate bug fixes. Really I would recommend this for any library.