vizor-games / InfraworldRuntime

A solution that enables Unreal Engine 4 to work with Google gRPC services from either C++ or Blueprints.
Apache License 2.0
169 stars 56 forks source link

Error when build platform is Linux. #6

Open LucasNova opened 5 years ago

LucasNova commented 5 years ago

My environment and setup

VisualStudio: 2017 Platform: Windows 10 UnrealEngine: Custom compiled from github 4.21.2

Issue

Hi, you was make a great job guys. Your plugin compiling for me with Windows platform selected, but when i trying to change and compile Linux platform(dedicated server), compiler throw next errors

<gamedir>/Plugins/InfraworldRuntime/GrpcIncludes/third_party/protobuf/src\google\protobuf/stubs/port.h(98,10): error : non-portable path to file '<ByteSwap.h>'; specified path differs in case from file name on disk [-Werror, -Wnonportable-include-path]
#include <byteswap.h> // IWYU pragma: export
         ^~~~~~~~~~~~
         <ByteSwap.h>

<gamedir>/Plugins/InfraworldRuntime/GrpcIncludes/third_party/protobuf/src\google\protobuf/stubs/port.h(481,47): error : use of undeclared identifier 'bswap_16'
... //other similar errors about undeclared identifier bswap16/bswap32/bswap64

My attempts to fix

I was try to rename byteswap to ByteSwap but nothing did changes. I think clang(v12_clang-6.0.1-centos7) compiler can't understand how include this file.

Also i was try add warning flag in BuildTool for non-portable path to file error, but undeclared identifier errors not gone.

Additional

I just took precompiled binaries from your latest releases. Binaries for Windows and Linux too. I put them to GrpcLibraries and GrpcPrograms folders for both platforms.

RChehowski commented 5 years ago

Hello there @LucasNova thanks for choosing our library! We don't do linux builds on windows machines, so the first thing I personally can recommend is to try to build your dedicated server on linux dedicated node (or virtual machine) it seems to work fine.

Both grpc and protobuf were hard to be built for UE4. There are many macros in the port.h source file, and I don't know what UE4 exactly exports. Maybe there's no available byteswap.h at all in the cross-compilation mode. But if you think you've found a solution - feel free to comment.

Hope this helped. Sincerely, Roman.

LucasNova commented 5 years ago

Thanks @RChehowski , i'll check building on Linux machine soon as possible. I'll post here about my progression. Who knows, maybe i'll find windows solution later.

tomwpid commented 4 years ago

Hey!

First of all thank you for the great work you've done on this plugin, it has really helped me get to grips with integrating gRPC into UE4.

I encountered the same issue with byteswap.h when cross compiling for Linux on Windows and it seems to be because the UE4 Core module includes a ByteSwap.h. This is then picked up instead of the version in the Linux cross compile tool chain and because the ByteSwap.h in the Core module doesn't define bswap_16, bswap_32 or bswap_64 you get those errors.

I'm open to suggestions on how best to fix this, however, one way that works is to perform the following modification to the port.h header.

// google/protobuf/stubs/port.h
//
// ByteSwap.h is defined in the UE4 core module and conflicts with cross compile version.
//
// Original code
//
// #include <byteswap.h>  // IWYU pragma: export
//
// New code
//
#include <bits/byteswap.h> 
#define bswap_16(x) __bswap_16 (x)
#define bswap_32(x) __bswap_32 (x)
#define bswap_64(x) __bswap_64 (x)

Hope that helps somebody!

burakakca commented 2 years ago

I'm tring to run InfraruntimeExaple on Linux (Ubuntu 18.04) UE4.27.2

Running /home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project="/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/InfraworldDemo.uproject" -TargetType=Editor -Progress

Running Mono...

Fixing inconsistent case in filenames.
Setting up Mono
~/Desktop/UnrealEngine-4.27.2-release/Engine ~/Desktop/UnrealEngine-4.27.2-release/Engine/Binaries/Linux
Using 'git status' to determine working set for adaptive non-unity build (/home/brtx/Desktop/UnrealEngine-4.27.2-release).
Using 'git status' to determine working set for adaptive non-unity build (/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27).
Creating makefile for InfraworldDemoEditor (no existing makefile)
Headers:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcIncludes/include
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcIncludes/third_party/protobuf/src
Libs:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libaddress_sorting.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libares.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgpr.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc++.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc++_core_stats.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc++_error_details.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc++_reflection.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc++_unsecure.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc_cronet.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc_plugin_support.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpc_unsecure.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libgrpcpp_channelz.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libprotobuf.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libprotoc.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/GrpcLibraries/Linux/libz.a
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/InfraWorldRuntime.Build.cs: warning: Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "Public/ChannelCredentials.h") from UE 4.21 onwards.
@progress push 5%
Creating makefile for UnrealHeaderTool (no existing makefile)
@progress push 5%
@progress pop
------- Build details --------
Using toolchain located at '/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu'.
Using clang (/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version '11.0.1' (string), 11 (major), 0 (minor), 1 (patch)
Using bundled libc++ standard C++ library.
Using lld linker
Using llvm-ar : /home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar
Using fast way to relink  circularly dependent libraries (no FixDeps).
------------------------------
Parsing headers for InfraworldDemoEditor
  Running UnrealHeaderTool "/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/InfraworldDemo.uproject" "/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Intermediate/Build/Linux/B4D820EA/InfraworldDemoEditor/Development/InfraworldDemoEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Programs/UnrealBuildTool/Log_UHT.txt"
LogInit: Display: Loading text-based GConfig....
Reflection code generated for InfraworldDemoEditor in 2.5961344 seconds
@progress pop
------- Build details --------
Using toolchain located at '/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu'.
Using clang (/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version '11.0.1' (string), 11 (major), 0 (minor), 1 (patch)
Using bundled libc++ standard C++ library.
Using lld linker
Using llvm-ar : /home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar
Using fast way to relink  circularly dependent libraries (no FixDeps).
------------------------------
Building InfraworldDemoEditor...
[Upgrade]
[Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
[Upgrade]     bLegacyPublicIncludePaths = false                 => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
[Upgrade]     ShadowVariableWarningLevel = WarningLevel.Error   => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
[Upgrade]     PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs   => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
[Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in InfraworldDemoEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
[Upgrade]
Performing 13 actions (12 in parallel)
[8/13] Compile InfraworldDemoCharacter.gen.cpp
[3/13] Compile InfraworldDemo.cpp
[7/13] Compile InfraworldDemo.init.gen.cpp
[5/13] Compile InfraworldDemoGameMode.cpp
[6/13] Compile VizorDemonstration.cpp
[1/13] Compile Module.InfraworldRuntime.cpp
[10/13] Compile VizorDemonstration.gen.cpp
[2/13] Compile Module.InfraworldRuntime.gen.cpp
[4/13] Compile InfraworldDemoCharacter.cpp
[9/13] Compile InfraworldDemoGameMode.gen.cpp
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/InfraworldDemo/VizorDemonstration.gen.cpp:8:
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Source/InfraworldDemo/VizorDemonstration.h:13:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Public/RpcClient.h:139:40: error: copying member subobject of type 'TAtomic<FRunnableThread *>' invokes deleted constructor
    TAtomic<FRunnableThread*> Thread = nullptr;
                                       ^~~~~~~
/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Source/Runtime/Core/Public/Templates/Atomic.h:590:2: note: 'TAtomic' has been explicitly marked deleted here
        TAtomic(TAtomic&&) = delete;
        ^
1 error generated.
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/InfraworldRuntime/Module.InfraworldRuntime.cpp:5:
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Private/RpcClient.cpp:16:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Public/RpcClient.h:139:40: error: copying member subobject of type 'TAtomic<FRunnableThread *>' invokes deleted constructor
    TAtomic<FRunnableThread*> Thread = nullptr;
                                       ^~~~~~~
/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Source/Runtime/Core/Public/Templates/Atomic.h:590:2: note: 'TAtomic' has been explicitly marked deleted here
        TAtomic(TAtomic&&) = delete;
        ^
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Source/InfraworldDemo/VizorDemonstration.cpp:8:
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Source/InfraworldDemo/VizorDemonstration.h:13:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Public/RpcClient.h:139:40: error: copying member subobject of type 'TAtomic<FRunnableThread *>' invokes deleted constructor
    TAtomic<FRunnableThread*> Thread = nullptr;
                                       ^~~~~~~
/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Source/Runtime/Core/Public/Templates/Atomic.h:590:2: note: 'TAtomic' has been explicitly marked deleted here
        TAtomic(TAtomic&&) = delete;
        ^
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Source/InfraworldDemo/VizorDemonstration.cpp:14:10: fatal error: 'Wrappers/proto\vizor_demonstration/vizor_demonstration.pb.hpp' file not found
#include "Wrappers/proto\vizor_demonstration/vizor_demonstration.pb.hpp"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/InfraworldRuntime/Module.InfraworldRuntime.gen.cpp:5:
In file included from /home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/InfraworldRuntime/RpcClient.gen.cpp:8:
/home/brtx/Desktop/infraworld/InfraworldRuntimeExample 4.27/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Public/RpcClient.h:139:40: error: copying member subobject of type 'TAtomic<FRunnableThread *>' invokes deleted constructor
    TAtomic<FRunnableThread*> Thread = nullptr;
                                       ^~~~~~~
/home/brtx/Desktop/UnrealEngine-4.27.2-release/Engine/Source/Runtime/Core/Public/Templates/Atomic.h:590:2: note: 'TAtomic' has been explicitly marked deleted here
        TAtomic(TAtomic&&) = delete;
        ^
1 error generated.
1 error generated.
yajokboy commented 2 years ago

@burakakca

Current you can compile Infraruntime on Linux ??

because I found issue like you when I compile cross platform on window

ActionGraph.IsActionOutdated: VirtualWorld.target: Produced item "VirtualWorld.target" doesn't exist. ActionGraph.IsActionOutdated: Module.InfraworldRuntime.cpp: Produced item "Module.InfraworldRuntime.cpp.o" doesn't exist. ActionGraph.IsActionOutdated: UE4API.pb.cc: Produced item "UE4API.pb.cc.o" doesn't exist. ActionGraph.IsActionOutdated: UE4API.pb.cc: Produced item "UE4API.pb.cc.d" doesn't exist. ActionGraph.IsActionOutdated: Module.InfraworldRuntime.cpp: Produced item "Module.InfraworldRuntime.cpp.d" doesn't exist. ActionGraph.IsActionOutdated: Module.InfraworldRuntime.gen.cpp: Produced item "Module.InfraworldRuntime.gen.cpp.d" doesn't exist. ActionGraph.IsActionOutdated: Module.VirtualWorld.cpp: Produced item "Module.VirtualWorld.cpp.d" doesn't exist. ActionGraph.IsActionOutdated: Module.VirtualWorld.gen.cpp: Produced item "Module.VirtualWorld.gen.cpp.d" doesn't exist. BuildMode.Build: Building VirtualWorld... ParallelExecutor.ExecuteActions: Building 9 actions with 16 processes... ParallelExecutor.ExecuteActions: [1/9] SharedPCH.Engine.ShadowErrors.h ParallelExecutor.ExecuteActions: [2/9] Module.InfraworldRuntime.gen.cpp ParallelExecutor.ExecuteActions: In file included from D:/WorkingOutput/VW/VirtualWorld/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4/Development/InfraworldRuntime/Module.InfraworldRuntime.gen.cpp:5: ParallelExecutor.ExecuteActions: In file included from D:/WorkingOutput/VW/VirtualWorld/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4/Inc/InfraworldRuntime/RpcClient.gen.cpp:8: ParallelExecutor.ExecuteActions: D:\WorkingOutput\VW\VirtualWorld\Plugins\InfraworldRuntime\Source\InfraworldRuntime\Public\RpcClient.h(139,40): error: copying member subobject of type 'TAtomic' invokes deleted constructor ParallelExecutor.ExecuteActions: TAtomic Thread = nullptr; ParallelExecutor.ExecuteActions: ^~~ ParallelExecutor.ExecuteActions: D:\WorkingOutput\VW\UE_4.27\Engine\Source\Runtime\Core\Public\Templates\Atomic.h(590,2): note: 'TAtomic' has been explicitly marked deleted here ParallelExecutor.ExecuteActions: TAtomic(TAtomic&&) = delete; ParallelExecutor.ExecuteActions: ^ ParallelExecutor.ExecuteActions: 1 error generated. ParallelExecutor.ExecuteActions: [3/9] Module.InfraworldRuntime.cpp ParallelExecutor.ExecuteActions: In file included from D:/WorkingOutput/VW/VirtualWorld/Plugins/InfraworldRuntime/Intermediate/Build/Linux/B4D820EA/UE4/Development/InfraworldRuntime/Module.InfraworldRuntime.cpp:5: ParallelExecutor.ExecuteActions: In file included from D:/WorkingOutput/VW/VirtualWorld/Plugins/InfraworldRuntime/Source/InfraworldRuntime/Private/RpcClient.cpp:16: ParallelExecutor.ExecuteActions: D:\WorkingOutput\VW\VirtualWorld\Plugins\InfraworldRuntime\Source\InfraworldRuntime\Public\RpcClient.h(139,40): error: copying member subobject of type 'TAtomic' invokes deleted constructor ParallelExecutor.ExecuteActions: TAtomic Thread = nullptr; ParallelExecutor.ExecuteActions: ^~~ ParallelExecutor.ExecuteActions: D:\WorkingOutput\VW\UE_4.27\Engine\Source\Runtime\Core\Public\Templates\Atomic.h(590,2): note: 'TAtomic' has been explicitly marked deleted here ParallelExecutor.ExecuteActions: TAtomic(TAtomic&&) = delete; ParallelExecutor.ExecuteActions: ^ ParallelExecutor.ExecuteActions: 1 error generated. ParallelExecutor.ExecuteActions: [4/9] UE4API.pb.cc ...

burakakca commented 2 years ago

@yajokboy the problem still continues