physx-rs icon indicating copy to clipboard operation
physx-rs copied to clipboard

Compile error with Xcode 12.5 on Mac M1

Open repi opened this issue 4 years ago • 3 comments

The current version we have of the PhysX C++ codebase fails to build with Xcode 12.5 that was released 3 days ago, Xcode 12.4 still works though.

Could be aarch64-specific as looks like error is in Neon-related (but may be more errors):

  cargo:warning=/Users/repi/.cargo/git/checkouts/physx-rs-4169d2249480eec2/52eb263/physx-sys/PhysX/physx/source/foundation/include/unix/neon/PsUnixNeonInlineAoS.h:3582:10: 
  error: argument value 2 is outside the valid range [0, 1]
  cargo:warning=                return vdupq_lane_f32(vget_low_f32(a), index);
  cargo:warning=                       ^                               ~~~~~

No point in filing issues on Nvidia, they haven't even closed this 1.5y old issue on Xcode 11 compile errors: https://github.com/NVIDIAGameWorks/PhysX/issues/183

repi avatar Apr 29 '21 20:04 repi

According to the error message, the argument index passed to vdupq_lane_f32 should be in [0, 1] and it is int. So I replaced

if(index < 2)
{
	return vdupq_lane_f32(vget_low_f32(a), index);
}

by

if(index == 0)
{
    return vdupq_lane_f32(vget_low_f32(a), 0);
}
else if(index == 1)
{
    return vdupq_lane_f32(vget_low_f32(a), 1);
}

Then there was another similar error in BSplatElement and I did the same thing. After that I can successfully build with Xcode 12.5.

chy123chy avatar Dec 01 '21 02:12 chy123chy

I don't think you should change low->high. Here's the local patch we did:

https://github.com/EmbarkStudios/PhysX/commit/dc5059fb1acbf6a710c50f538b727a851c2d1139

hrydgard avatar Dec 01 '21 07:12 hrydgard

Sorry I copied the wrong code, actually I did the same as your patch. I have correted it above.

chy123chy avatar Dec 01 '21 10:12 chy123chy

This was fixed a while back, and the fix was ported to the physx 5 code that this repo is now based upon after #183

Jake-Shadle avatar Mar 04 '23 08:03 Jake-Shadle