Unit test build fails on OS X

Post Reply
drawtree
Posts: 7
Joined: Sat May 07, 2011 2:02 am

Unit test build fails on OS X

Post by drawtree »

I downloaded v2.82 r2722 (due to arm64 support) and library compilation is done well.
Anyway unit test project for OSX (x64_64) doesn't get built due to this error.

Code: Select all

...bullet-2.82-r2722/src/vectormath/sse/vec_aos.h:580:51: Constant expression evaluates to 2147483648 which cannot be narrowed to type 'int'
The source code at the position is this.

Code: Select all

VM_ATTRIBUTE_ALIGN16 static const int array[] = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
Here's full function code.

Code: Select all

VECTORMATH_FORCE_INLINE const Vector3 Vector3::operator -( ) const
{
	//return Vector3(_mm_sub_ps( _mm_setzero_ps(), mVec128 ) );

	VM_ATTRIBUTE_ALIGN16 static const int array[] = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
	__m128 NEG_MASK = SSEFloat(*(const vec_float4*)array).vf;
	return Vector3(_mm_xor_ps(get128(),NEG_MASK));
}
I see the commented out line which seems old code. And unit test project does work if I uncomment the first line and comment out all below three lines.

This seems a bug, though don't know the details, but I think it would be better to use fixed-sized integer type such as

Code: Select all

int16_t
.

Anyway, for workaround, is it fine to use the first line instead of below lines? And can I expect for a patch?
polyomino
Posts: 1
Joined: Fri Sep 05, 2014 9:14 pm

Re: Unit test build fails on OS X

Post by polyomino »

I'm new to btHappyFunTimes, but so far looks swell. cmake-->Xcode->running demo apps was instant satisfaction, which is very important in gaining my trust on alien code. +Like! And the API is very approachable too. Classy all around.

Next up, added all of bullet/src/ to a junk project. (Because I'm old-fashioned, and I like to have a source-code-only build if it happens to work out.)

Removed the OpenCL part, and did what drawtree^^^ suggested, and got a successful build at least.

So, anyway, wanted to bump this question... Source code bug? Safe swap?

Cheers. Hi.

Code: Select all

VECTORMATH_FORCE_INLINE const Vector3 Vector3::operator -( ) const
{
   return Vector3(_mm_sub_ps( _mm_setzero_ps(), mVec128 ) );

//   VM_ATTRIBUTE_ALIGN16 static const int array[] = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
//   __m128 NEG_MASK = SSEFloat(*(const vec_float4*)array).vf;
//   return Vector3(_mm_xor_ps(get128(),NEG_MASK));
}
Post Reply