Linux c++ Plugin doesn't run on Amazon Linux

Hi there,

I am having issues with running an Unreal Engine 4 game with GameLift integrated on an amazon linux server.

It appears that the .SO file doesn’t have what it needs to run.

I built the SO file as instructed in the readme on an Ubuntu server.

/local/game/CharAnim/Binaries/Linux/CharAnimServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /local/game/CharAnim/Binaries/Linux/../../Pl ugins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
/local/game/CharAnim/Binaries/Linux/CharAnimServer: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /local/game/CharAnim/Binaries/Linux/../../Plug ins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
/local/game/CharAnim/Binaries/Linux/CharAnimServer: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /local/game/CharAnim/Binaries/Linux/../../Plug ins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
/local/game/CharAnim/Binaries/Linux/CharAnimServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /local/game/CharAnim/Binaries/Linux/../../Pl ugins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
/local/game/CharAnim/Binaries/Linux/CharAnimServer: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /local/game/CharAnim/Binaries/Linux/../../Pl ugins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)

Can this be looked into please?

Hello @awjh,

This looks like a GCC version mismatch between the one used to compile on Ubuntu and the version installed on AMAZON_LINUX.

Found this article that might help.

What are the versions you currently use? (gcc --version)

Hope this helps.

Alexis

I am currently trying to build the SDK on a Amazon Linux ec2 instance, what a terrible experience.

Firstly, the SDK doesn’t support the default cmake version installed on Amazon Linux.

Secondly, curl by default doesn’t have SSL enabled so when it downloads dependencies for the SDK it fails.

Any assistance would be great.

gcc --version
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-amazon-linux/4.8.3/lto-wrapper
Target: x86_64-amazon-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-amazon-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-x86_64-amazon-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-amazon-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)

Cheers

Building the game is done on Windows. I build for the game’s Linux Server on Windows. I used an Ubuntu VPS to build the SDK, as I was unable to do this on Windows, and that’s where the first compatibility issues came. I also tried (and failed) to build the SDK on a Amazon Linux EC2 instance (which I assume is the best way to do this to get compatibility?).

Hi @awjh,

Any luck on this?

I’d like to better understand your workflow.

My understanding is that you build the SDK on Ubuntu and also build your Unreal game on Ubuntu.
Then, you create a standalone build of your game and upload it to GameLift, is that right?

Alexis

Any advise? How would you suggest I build the .so files to run on amazon linux if amazon linux can’t even build it?

@Alexis can you please help with this issue? I am getting nowhere. Where do you guys recommend we build the SDK to run on Amazon Linux if Amazon Linux wont even build it?

Hi @awjh

I’ll try and reproduce the issue over here and get back to you as soon as I find a workaround.

Alexis

Hello @awjh,

I just finished a round of tests.

Here’s what I did to get around the “GLIBCXX” errors you are experiencing.

First, I spun up an Ubuntu VM. I’m using Ubuntu 14.04.

On that machine, I have the default versions for:

  • cmake version 3.2.2
  • gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  • GNU Make 3.81
    I built the sdk using:
wget https://s3-us-west-2.amazonaws.com/gamelift-release/GameLift_04_11_2017.zip
unzip GameLift_04_11_2017.zip
cd GameLift-SDK-Release-3.1.5/GameLift-Cpp-ServerSDK-3.1.5/
mkdir out
cd out
cmake .. -DBUILD_FOR_UNREAL=1 make

I took libaws-cpp-sdk-gamelift-server.so and copied it over to my Windows box.

After that, I built a Linux flavored Unreal Server from Windows following the steps described here: https://wiki.unrealengine.com/Compiling_For_Linux

I am on Unreal 4.13, so I used the v7 of their toolset.

Once I had my standalone build, I uploaded it to a vanilla Amazon_Linux box.

From there, I ran ‘ldd’ on the executable (GameLiftFPSServer in my case).

Here’s the outputs:

	ldd GameLiftFPSServer linux-vdso.so.1 => (0x00007fff135c0000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd1ddb23000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fd1dd91f000)
libaws-cpp-sdk-gamelift-server.so => /tmp/UnrealFromWin/LinuxNoEditor/GameLiftFPS/Binaries/Linux/./libaws-cpp-sdk-gamelift-server.so (0x00007fd1dd3a1000)
librt.so.1 => /lib64/librt.so.1 (0x00007fd1dd198000)
libm.so.6 => /lib64/libm.so.6 (0x00007fd1dce96000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd1dcad4000)
/lib64/ld-linux-x86-64.so.2 (0x00005639fb377000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd1dc8bd000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fd1dc5b8000)

So, as you can see, both installed libstdc++ and libc libraries are found and loaded properly.

Hopefully this helps you. Let me know if that all made sense.

Cheers!

Alexis

1 Like

Oddly enough I just experienced this myself when building the GameLiftServerSDK for Unreal Engine. Although the library files may build successfully, you can still experience similar issues to what OP encountered after uploading a game server build with the generated libaws-cpp-sdk-gamelift-server.so to GameLift and creating a fleet with that build. Keep in mind that you won’t specifically see errors like those in OP’s original post until you ssh into a Amazon Linux EC2 instance in your fleet (in the FAILED state) and try to run the server executable from there.

To fix this, if you are cross compiling the GameLiftServerSDK library files for Linux from Windows using the Ubuntu Windows Subsystem For Linux, make sure to get Ubuntu 18.04 LTS, not regular Ubuntu (which defaults to version 20.04) or Ubuntu 20.04 LTS, from the Microsoft Store. If you use a newer version of Ubuntu (20.04 for e.g.), the versions of cmake, gcc, and make are too new for the Amazon Linux EC2 instances. The newest versions of these same tools for Ubuntu 18.04, according to the Advanced Package Tool (APT), are as follows:

  • cmake version 3.10.2
  • gcc (Ubuntu 7.5.0-3ubuntu~18.04)
  • GNU Make 4.1

Building the GameLift Server SDK, specifically version 4.0.0, with these utilities on the Ubuntu 18.04 environment worked for me.

1 Like

Thanks Chrisgong, that solve my problem !