Compiling Interface on UbuntuStudio 15.10


#1

Just to share my experience with compiling the interface on UbuntuStudio 15.10 (wily) using the offline installers of Qt. If failed with Qt 5.6.0 due to missing Qt5Webkit but compiled with the offline installer for 5.5.1.

Take note that this uses the offline binary installers and I did not compile qt from source. The test machine is a core i7 with gtx 980ti gpu.

Note that it has been reported elsewhere that there are issues with respect to missing qtwebchannel in the repo packages including ppa prevents use of the packages in compiling interface but it has been reported to work for the server.

This build instruction is for the interface .

Failed build

Qt 5.6.0 runtime from http://www.qt.io/download-open-source/ produces the ff. error on compile of hifi due to missing Qt5WebKit.

CMake Warning at /opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
Could not find a package configuration file provided by "Qt5WebKitWidgets"
with any of the following names:

Qt5WebKitWidgetsConfig.cmake
qt5webkitwidgets-config.cmake

Add the installation prefix of “Qt5WebKitWidgets” to CMAKE_PREFIX_PATH or
set “Qt5WebKitWidgets_DIR” to a directory containing one of the above
files. If “Qt5WebKitWidgets” provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
interface/CMakeLists.txt:46 (find_package)

CMake Warning at interface/CMakeLists.txt:46 (find_package):
Found package configuration file:

/opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5/Qt5Config.cmake

but it set Qt5_FOUND to FALSE so package “Qt5” is considered to be NOT
FOUND. Reason given by package:

Failed to find Qt5 component “WebKitWidgets” config file at
"/opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsConfig.cmake"

Successful build

1. Install QT using the offline installer

I used Qt 5.5.1 for Linux 64-bit with a filename qt-opensource-linux-x64-5.5.1.run from a qt mirror at something like http://mirror url/pub/qtproject/official_releases/qt/5.5/5.5.1/.

I found the mirror url on the (info) link from http://www.qt.io/download-open-source/ . Replace the url before /pub/qtproject/official_releases/qt/5.5/5.5.1/ .

2. Run qt installer as root in a terminal

sudo ./qt-opensource-linux-x64-5.5.1.run

This should open the installer. Skip the account creation. Install all.
If you installed it as root, it should install qt at /opt/Qt5.5.1/

3. At the end of the .bashrc file of your root folder insert:

export QT_CMAKE_PREFIX_PATH=/opt/Qt5.5.1/5.5/gcc_64/lib/cmake

For the root account

sudo root gedit /root/.bashrc

If you need to do this for your regular account

gedit ~/.bashrc

Check by issuing in terminal

sudo env

and see if QT_CMAKE_PREFIX_PATH is set

Otherwise close the terminal and open it again.

4. Install packages

sudo apt-get install git build-essential cmake libssl-dev libsdl2-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-jackd2-dev libxrandr-dev libglew-dev

5. Clone the repo.

git clone https://github.com/highfidelity/hifi.git

6. Make the build directory.

mkdir build
cd build

7. Run cmake.

cmake (path to hifi source downloaded from github)

8. To build the interface inside build directory

sudo make interface

9. If you want to build server parts

sudo make assignment-client
sudo make domain-server

6. Run interface from a terminal with a regular account

sudo chown -R . build

As regular account

cd build/interface
./interface

It successfully compiled and ran as of March 27, 2016 but I’ve experience segmentation fault when I open and close the additional menus and dialogue boxes.


Has anyone gotten web entities to work on linux?
#2

I have posted a direct link to the qt 5.5.1 deb for hifi in another post but I will link it here too:
https://qt-files.obj.space/Qt_5.5.1_official_amd64.deb

Just download that, then do dpkg -i Qt_5.5.1_official_amd64.deb

Then nano ~/.bashrc and add this to the end of it
export QT_CMAKE_PREFIX_PATH=/usr/local/Qt-5.5.1_official/5.5/gcc_64/lib/cmake

That saves you the trouble of needing the other installer which requires a GUI, which doesnt seem to be a problem in your case but this works for everyone.


#3

Hi, could you specify which ubuntu version you use? It is systemd or upstart? I try follow your steps on ubuntu 16.04, but pop out: “QXcbConnection: Could not connect to display”. After I search on forums, seems it is hard for install qt on systemd ubuntu. Do you have and idea to figure it out?