Unreal4.8: Cannot compile on Ubuntu, error: argument unused during compilation

Hi, I’m trying to compile Unreal Engine 4.8 on Ubuntu 14.04.

I followed the instructions in A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
I downloaded the source code from GIthub and ./Setup.sh, ./GenerateProjectFiles.sh work well.

But there are errors when trying to make the project.

phoenix@tegra-ubuntu:~/unreal/UnrealEngine-4.8$ make
bash "/home/phoenix/unreal/UnrealEngine-4.8"/Engine/Build/BatchFiles/Linux/Build.sh CrashReportClient Linux Development  
Building CrashReportClient...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Building UnrealHeaderTool...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Performing 21 actions (1 in parallel)
[1/21] Compile CorePrivatePCH.h
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[2/21] Compile Module.Json.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[3/21] Compile Module.Projects.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[4/21] Compile Module.CoreUObject.1_of_4.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[5/21] Compile Module.CoreUObject.3_of_4.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[6/21] Compile Module.CoreUObject.2_of_4.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[7/21] Compile Module.CoreUObject.4_of_4.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[8/21] Compile Module.UnrealHeaderTool.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
[9/21] Compile Module.ScriptGeneratorPlugin.cpp
clang: error: argument unused during compilation: '-mmmx'
clang: error: argument unused during compilation: '-msse'
clang: error: argument unused during compilation: '-msse2'
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: so
Total build time: 5.19 seconds
UnrealHeaderTool failed for target 'CrashReportClient' (platform: Linux, module info: /home/phoenix/unreal/UnrealEngine-4.8/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/CrashReportClient/Development/UnrealHeaderTool.manifest).
make: *** [CrashReportClient] Error 5

I googled but cannot find any similar problems, also tried make -Wno-error=unused-command-line-argument but still meet the same error.

can anyone help me with that?

Thanks!

Hi,

I solved the problem using the method metioned here: Error compiling ShaderCompileWorker - Platform & Builds - Epic Developer Community Forums

This error occurs when you have ccache setup to run instead of clang. ccache tries to make two calls, one to preprocess, one to compile, gcc does ignore the presence of the preprocessor options happily but clang barfs at them.

Add ’ -Qunused-arguments’ (with space in front) f.e. to “Engine/Source/Programs/UnrealBuildTool/Linux/LinuxToolChain.cs” at line 220 like this:

if (Architecture.StartsWith(“x86_64”))
{
->>>> Result += " -Qunused-arguments -mmmx -msse -msse2";

This is good to know. See, you omitted a very important part (that you used ccache - you might be the first one who tried this) in the original post, so we had no idea what could be wrong :slight_smile: Granted, removing -mmx -msse -msse2 is probably a good idea.

Hi @RCL, could you tell me how to use clang instead of ccache. I just follow the instructiuons but I cannot find where to set the clang up. It shows the clang version when ./Generate… and nothing related to ccache shown. But as you said I’m still in ccache instead of clang. So I’m still confused how to disable the ccache. uninstall it?

If you weren’t intentionally using ccache then no idea what was different for you. Anyway, feel free to delete that line as it is indeed unnecessary. I removed those arguments in the main branch.

Hi @RCL, thanks for your reply but I still think I need to fix the ccache problem cause there are several more issues I cannot solve: Build Unreal 4.8 on Ubuntu error: static_assert failed - Platform & Builds - Epic Developer Community Forums