Can I have SSE with MingW32?

Post Reply
Maximinus
Posts: 3
Joined: Wed Jan 28, 2015 6:41 pm

Can I have SSE with MingW32?

Post by Maximinus »

Hello,

I love this library, it's great. I'm trying to have an SSE-enabled version of the library, I understand it may be faster. My development environment is MinGW32 with gcc (tdm-1) 4.7.1. I compile the Bullet library with cmake, recipe "Unix Makefiles", and I link my project against the libBullet*.a.

I think SSE is not supported with MinGW, as I read in btScalar.h that it needs _MSC_VER >= 1400 or APPLE.

The short version of my question would then be "how can I have SSE support while still using gcc for my project compilation?".

An additional bonus question would be "am I correct in assuming that the STATUS_FLOAT_MULTIPLE_TRAPS signals I receive can not be thrown by/related to the Bullet library with my setup where it is not SSE-enabled?" (as STATUS_FLOAT_MULTIPLE_TRAPS is thrown when there are SSE divisions by zero).


I did try to define BT_USE_SSE and BT_USE_SIMD_VECTOR3 to enable SSE with MinGW, but could not have it work. I defined SIMD_FORCE_INLINE and ATTRIBUTE_ALIGNED(x) as per this thread http://www.bulletphysics.org/Bullet/php ... php?t=5091. It also needed a "-msse -msse2" in the CXX_FLAGS of cmake. This did allow me to compile the library, but then after I link my program against this, it fails at runtime with a memory access violation at btAlignedAllocDefault().

There were two variants for this approach :
- #define SIMD_FORCE_INLINE inline
This one does compile correctly but fails at runtime as mentioned above.

- #define SIMD_FORCE_INLINE __attribute__ ((always_inline))
This one does not compile, gcc outputs this
BulletDynamics/Character/btKinematicCharacterController.cpp:414:1: internal compiler error: Segmentation fault

I tried something different : compiling the Bullet library with VS 2012, and linking my gcc project against it. It led to numerous problems. I've read a few times on the internet "do not mix C++ libs compiled with Visual Studio and GCC", but anyway, I could not have this to work.

My limited understanding of this field only allows me to conclude that I can't make this work, so I ask the question here : can I have SSE for the Bullet library with gcc/MinGW32?

Thank you for your time, have a good day
Post Reply