Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unreal Engine 4 with Qt-Creator
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 595
Location: Florida

PostPosted: Thu Feb 04, 2016 6:22 pm    Post subject: Unreal Engine 4 with Qt-Creator Reply with quote

So, as things are now, these two are mutually exclusive - UE4 requires clang <=clan-3.5, while qt-creator requires clang ~clang-3.7. Gentoo does not slot clang/llvm, so you cannot have them both installed on your system. So what do you do?

Ideally, find a way to slot clang/llvm... but I'm not sure what the implications of this are.

The best I've been able to come up with is to install clang/llvm-3.5 to a user dir and work from that (which I have done successfully). Ideally, I would rather have the ebuild build it for me and install to my user dir, but it appears Gentoo's portage system does not support the ability to install to a user prefix (unless you also install all dependencies to the same prefix (see EPREFIX environment variable in man emerge)). Why would I want to use the ebuild? Because it handles USE flags appropriately, making sure I get the build I want with the capabilities I need. Unfortunately, every attempt I've made to use the ebuild has failed (EPREFIX=/home/myuser/unrealenginedeps wants to install all dependencies to the user folder, and passing the -O flag (ignore dependencies) causes it to fail immediately (cannot find python, which means it ignores the system libraries)).

So... no ebuild solution.

What about manually building from the source? That... actually worked. Dissecting the ebuild, I was able to apply all the patches successfully, run configure, and make and install to the user dir (note: all without root access), and I was then able to tell the unreal utilities to use the user-installed tools rather than the system tools (more on that below).

Let's take llvm-3.5.2 as an example. First, download all the required files:

Assume that you downloaded to "~/unrealdepfiles", and you will compile in "~/unrealdepbuild"
Code:
cd ~/unrealdepbuild
for src in llvm-3.5.2.src.tar.xz compiler-rt-3.5.2.src.tar.xz cfe-3.5.2.src.tar.xz clang-tools-extra-3.5.2.src.tar.xz ; do
tar xvf ~/unrealdepfiles/${src}
done
rm -f llvm-3.5.2.src/tools/clang llvm-3.5.2.src/projects/compiler-rt
mv cfe-3.5.2.src llvm-3.5.2.src/tools/clang
mv compiler-rt-3.5.2.src llvm-3.5.2.src/projects/compiler-rt
mv clang-tools-extra-3.5.2.src llvm-3.5.2.src/tools/clang/tools/extra
cd llvm-3.5.2.src

At this point, you'll install all the patches. For this, I'll say that the patches appear to require either a 'p0' or a 'p1' fairly randomly to be applied. Best I can say is to try one, and if it fails or asks for input, try the other. You'll want the following patches (from /usr/portage/sys-devel/llvm/files)
  • llvm-3.2-nodoctargz.patch
  • llvm-3.5-gcc-4.9.patch
  • llvm-3.5-gentoo-install.patch
  • llvm-3.5.2-gcc-5.1.patch
  • clang-3.5-gentoo-runtime-gcc-detection-v3.patch
  • clang-3.5-gentoo-install.patch
  • clang-3.4-darwin_prefix-include-paths.patch

Then run the following:
Code:
sed -e "/RUN/s/-warn-error A//" -i test/Bindings/Ocaml/*ml
sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${HOME}/unrealenginedeps|g" tools/clang/lib/Frontend/InitHeaderSearch.cpp
sed -i -e "/^CFLAGS /s@-Werror@-I${HOME}/unrealenginedeps/include@" projects/compiler-rt/make/platform/clang_*.mk
sed -i -e 's/xcrun/false/' utils/lit/lit/util.py
for file in Makefile.config.in Makefile.rules tools/llvm-config/llvm-config.cpp tools/clang/lib/Driver/Tools.cpp tools/clang/tools/scan-build/scan-build ; do
sed -e "s,@libdir@,${HOME}/unrealenginedeps/lib,g" -e "s,@PF@,llvm-3.5.2,g" -e "s,@EPREFIX@,${HOME}/unrealenginedeps,g" -i ${file}
done
rm tools/clang/test/Driver/cross-linux.c
./configure --disable-timestamps --enable-keep-symbols --enable-shared --with-optimize-option= --enable-optimized --enable-terminfo --prefix=${HOME}/unrealenginedeps
make REQUIRES_RTTI=1 GENTOO_LIBDIR=${HOME}/unrealenginedeps/lib && make -C tools REQUIRES_RTTI=1 GENTOO_LIBDIR=${HOME}/unrealenginedeps/lib && make install
Note: None of this should be done as root

Once this is done, create "${HOME}"/unrealenv.sh as follows:
Code:
#!/bin/bash
export PATH="${HOME}"/unrealenginedeps/bin:"${PATH}"
export LD_LIBRARY_PATH="${HOME}"/unrealenginedeps:"${HOME}"/unrealenginedeps/lib/clang/3.5.2/lib/linux:"${LD_LIBRARY_PATH}"

Now, follow the unreal engine for linux instructions, but before running any commands, run source "${HOME}"/unrealenv.sh, and everything should work like you'd expect. This way you get both qt-creator and unreal engine at the same time. Once you have installed successfully, you can remove both ~/unrealdepfiles and ~/unrealdepbuild
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
rogerx
Tux's lil' helper
Tux's lil' helper


Joined: 06 Apr 2004
Posts: 118

PostPosted: Sun Dec 11, 2016 6:31 pm    Post subject: Reply with quote

Looking over the >=llvm-3.7 ebuilds, and looks like they're doing everything manually instead of letting configure take care of things. (eg. Cannot easily enable "--enable-optimized" or "--enable-keep-symbols")

CMake is a nightmare in my opinion, and this llvm ebuild seems unreadable.

Linux from Scratch seems to still adhere to the "Keep it simple, Keep it stupid" solution; and continues to use configure && make for LLVM-3.7.1.
http://www.linuxfromscratch.org/blfs/view/7.9/general/llvm.html

Seems like Gentoo is starting to move to CMake, with plans of the distribution running under Windows and other platforms? (One of the main goals of CMake is portability.)
_________________
Roger
http://rogerx.freeshell.org/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum