Software/ThirdParty/Guides/Epic/UnrealEngine

From RCS Wiki
Revision as of 03:19, 17 August 2018 by TimothyPearson (talk | contribs)
Jump to navigation Jump to search

Unreal Engine 4 on Debian Buster, OpenPOWER Edition

Required OS dependencies

clang-4.0 dos2unix autotools-dev automake cmake libtool libc++-dev libc++abi-dev libx11-dev libxext-dev libegl1-mesa-dev mesa-common-dev libgl1-mesa-dev libgles2-mesa-dev libglib2.0-dev libglu1-mesa-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxrender-dev libvulkan-dev libxcursor-dev libxt-dev libxi-dev libxv-dev libwebsockets-dev freeglut3-dev wayland-protocols x11proto-input-dev x11proto-randr-dev x11proto-scrnsaver-dev x11proto-xinerama-dev

Required OS setup

update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 100

Build Instructions

=================================================================================
PhysX-3.4
https://developer.nvidia.com/physx-source-github

Use POWER version from:
https://github.com/kb9vqf/PhysX-3.4 , branch v3.4.0
=================================================================================

Build process:

cd PhysX-3.4
cd PhysX_3.4/Source/compiler/linux64
make
cd ../../../..
cd APEX_1.4/compiler/linux64
make

=================================================================================
UE4
https://www.unrealengine.com/en-US/ue4-on-github

Use POWER version from:
https://github.com/kb9vqf/UnrealEngine
=================================================================================

Build process:

# Environment
export TARGET_ARCH=powerpc64le-unknown-linux-gnu
export UE4_ROOT_DIR=$PWD

# Low level shared libraries and applications
cd Engine/Source/ThirdParty/elftoolchain/build/Linux/libelf
./build_native
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/elftoolchain/build/Linux/libdwarf
./build_native
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/Breakpad/build/Linux
./BuildBreakpad.sh
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/zlib
../libcurl/BUILD.EPIC.sh
cd OpenSSL/OpenSSL_1_0_2h
./config
TARGET_ARCH= make depend
TARGET_ARCH= make
mkdir ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH}
cp -Rp libcrypto.a ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH}/
cp -Rp libssl.a ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH}/
cd ../..
cd zlib/v1.2.8/build
TARGET_ARCH= ./Build.sh
mkdir ../lib/Linux/${TARGET_ARCH}
cp -Rp libz.a ../lib/Linux/${TARGET_ARCH}/
cp -Rp libz_fPIC.a ../lib/Linux/${TARGET_ARCH}/
cd ../..
cd libcurl/curl-7_48_0
./buildconf
LDFLAGS=-L${PWD}/../../OpenSSL/OpenSSL_1_0_2h LD_LIBRARY_PATH=${PWD}/../../OpenSSL/OpenSSL_1_0_2h ./configure --with-zlib=${PWD}/../../zlib/v1.2.8 --with-ssl=${PWD}/../../OpenSSL/OpenSSL_1_0_2h --prefix=$PWD --enable-static --enable-shared --enable-threaded-resolver --enable-hidden-symbols --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-telnet --disable-tftp --disable-dict --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual --disable-idn
LDFLAGS=-L${PWD}/../../OpenSSL/OpenSSL_1_0_2h LD_LIBRARY_PATH=${PWD}/../../OpenSSL/OpenSSL_1_0_2h make
mkdir ../../../libcurl/7_48_0/lib/Linux/${TARGET_ARCH}
cp -Rp lib/.libs/libcurl.a ../../../libcurl/7_48_0/lib/Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/FreeType2/FreeType2-2.6
cmake .
make
mkdir Lib/Linux/${TARGET_ARCH}
cp -Rp libfreetype.a Lib/Linux/${TARGET_ARCH}/
cp -Rp libfreetype_fPIC.a Lib/Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/libPNG/libPNG-1.5.2
cmake -DPNG_STATIC=ON .
make
mkdir lib/Linux/${TARGET_ARCH}
cp -Rp libpng15.a lib/Linux/${TARGET_ARCH}/libpng.a
cd $UE4_ROOT_DIR
cd Engine/Source/Programs/BreakpadSymbolEncoder
./BuildBreakpadSymbolEncoderLinux.sh
cp -Rp BreakpadSymbolEncoder ../../../Binaries/Linux/BreakpadSymbolEncoder
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/glslang/Build/Linux
./build.sh
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/MikkTSpace
cmake .
make
mkdir lib/Linux/${TARGET_ARCH}
cp -Rp libMikkTSpace.a lib/Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/CEF3/cef_binary_3.2623.1395.g3034273_linux64
cp -Rp ../cef_source/cef_paths2.gypi .
cd ../Build/Linux/
./build.sh
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/VHACD/build/Linux
mkdir ../../Lib/Linux/${TARGET_ARCH}/
make
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/libWebSockets/libwebsockets_src
cmake .
make
mkdir -p ../libwebsockets/lib/Linux/${TARGET_ARCH}/Release/
cp -Rp lib/libwebsockets.a ../libwebsockets/lib/Linux/${TARGET_ARCH}/Release/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/ForsythTriOO
cmake -DCMAKE_BUILD_TYPE=Release .
make
mkdir Lib/Linux/${TARGET_ARCH}/
cp -Rp libForsythTriOptimizer.a Lib/Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/Kiss_FFT/kiss_fft129
mkdir -p Lib/Linux/Release/${TARGET_ARCH}/
cmake .
make clean
make
cp -Rp ../Lib/Linux/Release/${TARGET_ARCH}/*.a Lib/Linux/Release/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/SpeedTree/SpeedTreeSDK-v7.0/Source/Core/Linux
mkdir -p ../../../Lib/Linux/${TARGET_ARCH}/Release
cp -Rp ../../../../Lib/Linux/${TARGET_ARCH}/Release/*.a ../../../Lib/Linux/${TARGET_ARCH}/Release/
cmake .
make clean
make
cd $UE4_ROOT_DIR

# Header fixup
cd Engine/Source/ThirdParty/zlib/v1.2.8/include/Linux/
cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/OpenSSL/1_0_2h/include/Linux/
cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/libcurl/7_48_0/include/Linux/
cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/libWebSockets/libwebsockets/include/Linux/
cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu
cd $UE4_ROOT_DIR

# Mid level shared libraries and general setup
./Setup.sh
./GenerateProjectFiles.sh

# ICU fixup
cd Engine/Source/ThirdParty/ICU/icu4c-53_1/Linux/powerpc64le-unknown-linux-gnu
mkdir lib
mv *.a lib
cd $UE4_ROOT_DIR

# Opus fixup
cd Engine/Source/ThirdParty/libOpus/opus-1.1
mkdir Linux/${TARGET_ARCH}
cp -Rp .libs/libopus.a Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR

# NVIDIA PhysX install
mkdir Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu
cp -Rp <NVIDIA PhysX libraries>/PhysX_3.4/Bin/linux64/libPhysX3*.so Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/
cp -Rp <NVIDIA PhysX libraries>/PxShared/bin/linux64/lib* Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/
cd Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/
mv libPhysX3CharacterKinematicCHECKED_x64.so libPhysX3CharacterKinematicCHECKED.so
mv libPhysX3CharacterKinematicDEBUG_x64.so libPhysX3CharacterKinematicDEBUG.so
mv libPhysX3CharacterKinematicPROFILE_x64.so libPhysX3CharacterKinematicPROFILE.so
mv libPhysX3CharacterKinematic_x64.so libPhysX3CharacterKinematic.so
mv libPhysX3CHECKED_x64.so libPhysX3CHECKED.so
mv libPhysX3CommonCHECKED_x64.so libPhysX3CommonCHECKED.so
mv libPhysX3CommonDEBUG_x64.so libPhysX3CommonDEBUG.so
mv libPhysX3CommonPROFILE_x64.so libPhysX3CommonPROFILE.so
mv libPhysX3Common_x64.so libPhysX3Common.so
mv libPhysX3CookingCHECKED_x64.so libPhysX3CookingCHECKED.so
mv libPhysX3CookingDEBUG_x64.so libPhysX3CookingDEBUG.so
mv libPhysX3CookingPROFILE_x64.so libPhysX3CookingPROFILE.so
mv libPhysX3Cooking_x64.so libPhysX3Cooking.so
mv libPhysX3DEBUG_x64.so libPhysX3DEBUG.so
mv libPhysX3GpuCHECKED_x64.so libPhysX3GpuCHECKED.so
mv libPhysX3GpuDEBUG_x64.so libPhysX3GpuDEBUG.so
mv libPhysX3GpuPROFILE_x64.so libPhysX3GpuPROFILE.so
mv libPhysX3Gpu_x64.so libPhysX3Gpu.so
mv libPhysX3PROFILE_x64.so libPhysX3PROFILE.so
mv libPhysX3_x64.so libPhysX3.so
mv libPxFoundationCHECKED_x64.so libPxFoundationCHECKED.so
mv libPxFoundationDEBUG_x64.so libPxFoundationDEBUG.so
mv libPxFoundationPROFILE_x64.so libPxFoundationPROFILE.so
mv libPxFoundation_x64.so libPxFoundation.so
mv libPxPvdSDKCHECKED_x64.so libPxPvdSDKCHECKED.so
mv libPxPvdSDKDEBUG_x64.so libPxPvdSDKDEBUG.so
mv libPxPvdSDKPROFILE_x64.so libPxPvdSDKPROFILE.so
mv libPxPvdSDK_x64.so libPxPvdSDK.so
cd $UE4_ROOT_DIR
cp -Rp <NVIDIA PhysX libraries>/APEX_1.4/lib/linux64/lib* Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/
cp -Rp <NVIDIA PhysX libraries>/PhysX_3.4/Lib/linux64/lib* Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/
cp -Rp <NVIDIA PhysX libraries>/PxShared/lib/linux64/lib* Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/

# Build engine
make

# Install NVIDIA PhysX shared libraries to host
cp -Rp Engine/Source/ThirdParty/PhysX3/Lib/Linux/powerpc64le-unknown-linux-gnu/*.so /usr/lib/
cp -Rp <NVIDIA PhysX libraries>/PhysX_3.4/Bin/linux64/libPhysX3*.so /usr/lib/
cp -Rp <NVIDIA PhysX libraries>/PhysX_3.4/Lib/linux64/lib* /usr/lib/