Error in UnrealMathNeon.h when packaging for iOS

I’m running UE 4.15.1 on macOS 10.12.3 using Xcode 8.3.

When packaging a distribution build for iOS (I’ve only tried building for distribution), there is an error in the UnrealMathNeon.h file. I’ve pasted the error from the Output Log below. Due to an NDA I had to redact the name of the project and some source paths.

The issue begins whenever Engine.h is included in a file. The crash is happening on line 902 of /Engine/Source/Runtime/Core/Public/Math/UnrealMathNeon.h.

The specific error is “use of undeclared identifier ‘vcvt_f16_f32’”.

I need to be able to build for iOS. So this is a very high priority issue for my studio.

Although not reported as a bug, this other AnswerHub post seems related to this issue: https://answers.unrealengine.com/questions/582216/c-project-not-deploying-on-ios.html

UATHelper: Packaging (iOS): UnrealBuildTool: Reflection code generated for ProjectName in 6.6594988 seconds
UATHelper: Packaging (iOS): UnrealBuildTool: Performing 6 actions (8 in parallel)
UATHelper: Packaging (iOS): UnrealBuildTool: [3/6] clang++ ProjectName.cpp
UATHelper: Packaging (iOS): UnrealBuildTool: [2/6] clang++ ProjectNameBPFL.cpp
UATHelper: Packaging (iOS): UnrealBuildTool: [4/6] clang++ UELinkerFixups.cpp
UATHelper: Packaging (iOS): UnrealBuildTool: [1/6] clang++ ProjectName.generated.cpp
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from [redacted]/ProjectName/Source/ProjectName/Private/ProjectNameBPFL.cpp:3:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from [redacted]/ProjectName/Source/ProjectName/ProjectName.h:5:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Engine/Public/Engine.h:12:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Core.h:12:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/CoreMinimal.h:128:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/VectorRegister.h:17:
UATHelper: Packaging (iOS): UnrealBuildTool: /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/UnrealMathNeon.h:902:35: error: use of undeclared identifier 'vcvt_f16_f32'
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from [redacted]/ProjectName/Source/ProjectName/ProjectName.cpp:3:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from [redacted]/ProjectName/Source/ProjectName/ProjectName.h:5:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Engine/Public/Engine.h:12:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Core.h:12:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/CoreMinimal.h:128:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/VectorRegister.h:17:
UATHelper: Packaging (iOS): UnrealBuildTool: /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/UnrealMathNeon.h:902:35: error: use of undeclared identifier 'vcvt_f16_f32'
UATHelper: Packaging (iOS): UnrealBuildTool:         float16x4_t f16x4 = (float16x4_t)vcvt_f16_f32(Vec);
UATHelper: Packaging (iOS): UnrealBuildTool:                                          ^
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from [redacted]/ProjectName/Intermediate/Build/IOS/UE4/Inc/ProjectName/ProjectName.generated.cpp:8:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/CoreUObject/Public/UObject/GeneratedCppIncludes.h:5:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/CoreMinimal.h:128:
UATHelper: Packaging (iOS): UnrealBuildTool: In file included from /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/VectorRegister.h:17:
UATHelper: Packaging (iOS): UnrealBuildTool: /Users/Shared/UnrealEngine/UE_4.15/Engine/Source/Runtime/Core/Public/Math/UnrealMathNeon.h:902:35: error: use of undeclared identifier 'vcvt_f16_f32'
UATHelper: Packaging (iOS): UnrealBuildTool:         float16x4_t f16x4 = (float16x4_t)vcvt_f16_f32(Vec);
UATHelper: Packaging (iOS): UnrealBuildTool:                                          ^
UATHelper: Packaging (iOS): UnrealBuildTool:         float16x4_t f16x4 = (float16x4_t)vcvt_f16_f32(Vec);
UATHelper: Packaging (iOS): UnrealBuildTool:                                          ^
UATHelper: Packaging (iOS): UnrealBuildTool: 1 error generated.
UATHelper: Packaging (iOS): UnrealBuildTool: 1 error generated.
UATHelper: Packaging (iOS): UnrealBuildTool: 1 error generated.
UATHelper: Packaging (iOS): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: [redacted]/ProjectName/Binaries/IOS/ProjectName-IOS-Shipping
UATHelper: Packaging (iOS): UnrealBuildTool: Total build time: 93.47 seconds (Local executor: 0.00 seconds)
UATHelper: Packaging (iOS): CommandUtils.Run: Run: Took 94.042579s to run mono, ExitCode=5

I discovered the issue was with Xcode 8.3. Since there’s an update to the clang compiler in 8.3, I’m guessing that’s the culprit.

The workaround for now is to compile with Xcode 8.2.1. I was able to get a build to compile in 8.2.1, upload it to iTunes Connect, push a test build through TestFlight, and successfully launch the game on an iPhone.

In case anyone’s not familiar with how to change what version of Xcode is used to compile a UE4 project, I wrote up a tutorial on my studio’s website about how to do that: https://nacellegames.com/blog/2017/3/31/how-to-change-what-xcode-versions-for-compiling-unreal-engine-4-cpp-projects

Hope that helps!

(I also posted this on a forum about a similar issue: https://forums.unrealengine.com/showthread.php?140982-Can-t-Deploy-C-Project-on-iOS)

I’ve got the same error, also, it should be report issue, maibe in next update is fixed

But with Xcode 8.3.2 you have the same problems ?

Using Xcode 8.2.1 works. I haven’t tried any other Xcode versions. I won’t update Xcode until I know there’s a fix for this from Epic.

Thank you for the update! Looking forward to the fix being released.

Hello,

I’ve spoken with the team that ensures compatibility with programs such as XCode and they mentioned that this issue has already been fixed but the fix won’t be in until either a hotfix, if another is done, or 4.16. The bug report for this cannot be made public for privacy reasons but the number for the issue is UE-41313, if you need to make any inquiries.

Have a nice day!

Modified UnrealMathNeon.h and put this in. For some reason vcvt_f16_f32 is no longer available. So I’m thinking that assigning f16x4[0…3] to Vec[0…3] may function correctly
Since it’s a vector that stores 4 floats, if I’m not mistaken. Could be really wrong, but it seems to compile for mobile with this fine.:

Code:

template <bool bAligned>
FORCEINLINE void VectorStoreHalf4(VectorRegister Vec, void* RESTRICT Ptr)
{
	float16x4_t f16x4;

	for (int x=0;x<4;x++)
	{
		f16x4[x] = Vec[x];
	}

	if (bAligned)
	{
		vst1_u8( (uint8_t *)Ptr, f16x4 );
	}
	else
	{
		uint32_t buf[2];
		vst1_u8( (uint8_t *)buf, f16x4 );
		*(float32_t *)Ptr = buf[0]; 
	}
}

As 4.14 is is the last build you can run on older MAC’s it would be nice to put a fix in there too. Also - can we have the hotfix sooner rather than later… pretty please!

This bug (UE-41313) is marked as fixed in the Unreal Engine 4.15.2 hotfix (4.15.2 Hotfix Released - Announcements - Unreal Engine Forums)

great news then , i will give right now a try :smiley:

Thank you, ApolloSoftware. You saved me … a lot of time!