Software/ThirdParty/Guides/Epic/UnrealEngine

From RCS Wiki
Revision as of 00:26, 18 August 2018 by TimothyPearson (talk | contribs) (Use internal PhysX sources)
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

=================================================================================
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 build
mkdir -p Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/
cd Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/compiler/cmake/linux
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Debug .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Checked .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Profile .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Release .
make
cp -Rp *.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/
cd $UE4_ROOT_DIR
cd Engine/Source/ThirdParty/PhysX3/APEX_1.4/compiler/cmake/linux
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DCMAKE_BUILD_TYPE=Debug .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DCMAKE_BUILD_TYPE=Checked .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DCMAKE_BUILD_TYPE=Profile .
make
GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DCMAKE_BUILD_TYPE=Release .
make
cp -Rp *.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/

# Build engine
make

# Build engine
make