Setup Ubuntu 14.10 for HF Compile


#1

It’s became increasingly difficult to support HiFi compiling on Ubuntu 14.04, so, much as I prefer to stick with long term support releases, I’ve converted to 14.10 and now using QT at version = to HiFi builds vs one behind as on old setup.

Here’s the quick and dirty steps to setup Ubuntu 14.10 Desktop leading to compiling assignment-client, domain-server and interface. This was tested on a clean install with an ancient Dell Laptop leading to a fully functional stack and Interface (albeit with interface running at a staggering 2 frames/second).

Start with dependency install

sudo apt-get install qt5-default build-essential git cmake qtscript5-dev libglm-dev libssl-dev qttools5-dev qtmultimedia5-dev libqt5svg5-dev libqt5webkit5-dev freeglut3-dev libxmu-dev libxi-dev libxrender-dev libsdl2-dev libquazip-qt5-dev screen

Make a directory if you like to help keep things organized. I use $HOME/build

mkdir $HOME/build
cd $HOME/build

Pull in HiFi source, gverb and qxmpp

git clone https://github.com/highfidelity/hifi.git
git clone https://github.com/highfidelity/gverb.git
git clone https://github.com/qxmpp-project/qxmpp.git

Build qxmpp

cd $HOME/build/qxmpp
qmake
make
sudo make install

If you want to clean up some space run
make clean

The install will generate an error at end when it tries to generate HTML documentation - harmless, ignore it, don’t panic - carry on.

Create symlinks for gverb

cd $HOME/build
ln -s $HOME/build/gverb/include $HOME/build/hifi/interface/external/gverb/include
ln -s $HOME/build/gverb/src $HOME/build/hifi/interface/external/gverb/src

Next we have to obtain a new dependency about to be introduced - Intel Threaded Building Blocks. I’m going to go with a binary install downloaded from Intel’s project site. I also did it from source - so if you want that, have at it.

wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb43_20141204oss_lin.tgz

tar zxvf tbb43_20141204oss_lin.tgz

sudo mv tbb43_20141204oss /opt

Next we need to define an environment variable

export TBB_ROOT_DIR='/opt/tbb43_20141204oss'

It’s probably a good idea to add that to your shell config as it’s going to stop you building HiFi if not defined. It you want to do this do;

nano $HOME/.profile

Go to end of file and add the line;

export TBB_ROOT_DIR='/opt/tbb43_20141204oss'

Hit Control O then Control X to save and exit.

Now create a directory to compile in so we don’t pollute HiFi’s source tree

mkdir $HOME/build/compile
cd $HOME/build/compile
cmake ../hifi/

You should see no errors at this point, other than missing bits for leapmotion, vissage etc. Again - ignore those and carry on.

make assignment-client
make domain-server
make interface

If that all goes well you’re ready to setup a run area for your newly compiled bits. The following is based on my way of doing things.

mkdir $HOME/run
mkdir $HOME/run/resources
cp $HOME/build/compile/assignment-client/assignment-client $HOME/run
cp $HOME/build/compile/domain-server/domain-server $HOME/run
cp $HOME/build/compile/interface/interface $HOME/run

Next it’s important to populate resources with bits both domain-server and interface need to run proper. My choice is to symlink the resources from HiFi’s source tree - this keeps it automatically up to date.

cd $HOME/run/resources
ln -s $HOME/build/hifi/domain-server/resources/web $HOME/run/resources/web
ln -s $HOME/build/hifi/domain-server/resources/describe-settings.json $HOME/run/resources/describe-settings.json
ln -s $HOME/build/hifi/interface/resources/config $HOME/run/resources/config
ln -s $HOME/build/hifi/interface/resources/html $HOME/run/resources/html
ln -s $HOME/build/hifi/interface/resources/icons $HOME/run/resources/icons
ln -s $HOME/build/hifi/interface/resources/images $HOME/run/resources/images
ln -s $HOME/build/hifi/interface/resources/info $HOME/run/resources/info
ln -s $HOME/build/hifi/interface/resources/mention-sounds $HOME/run/resources/mention-sounds
ln -s $HOME/build/hifi/interface/resources/meshes $HOME/run/resources/meshes
ln -s $HOME/build/hifi/interface/resources/shaders $HOME/run/resources/shaders
ln -s $HOME/build/hifi/interface/resources/sounds $HOME/run/resources/sounds
ln -s $HOME/build/hifi/interface/resources/styles $HOME/run/resources/styles
ln -s $HOME/build/hifi/interface/resources/visage $HOME/run/resources/visage

$HOME/resources is where your voxel, metavoxel and entity data will be saved.

To run stack (your own domain) execute the following;

cd $HOME/run
screen -dmS d ./domain-server
screen -dmS a ./assignment-client -n 5

To run interface execute the following;

cd $HOME/run
./interface

To terminate stack do this;

screen -r d
type a single Control C
screen -r a

WAIT about 30 seconds or more before you terminate assignment-client, this can avoid some unpredictable nastiness with models being lost from build.

type a single Control C

Done. Good luck and happy HiFing :smile:

If you want to see what assignment or domain is doing but not terminate after screen -r d (or a) then instead of Control C type Control A D which will detach the screen session leaving the server running.

Some of the lines seem to wrap no matter what I do - the longer lines creating the sym links especially, watch for that.


#2

One warning - if not installing on a clean 14.10 install you may have QT4 libraries hanging about. Interface will (usually) ignore those and prefer QT5. QXmpp will not, it will use 4 without some care leading to a segfault when Interface loads.

The workaround for that is to do (likely other ways as well, this is just what I found to work)

cd $HOME/build/qxmpp
qtchooser -qt=5 -run-tool=qmake
make
sudo make install

This was the best of many worse solutions found for keeping something locked to QT5 without ruining other parts of system/programs.

One other note for the unaware. To keep your source trees up to do do;

cd $HOME/build/hifi
git pull
cd $HOME/build/gverb
git pull
cd $HOME/build/qxmpp
git pull

It’s usually a good idea to empty the build directory and run cmake anew when doing a new compile after sources update. It takes a couple extra minutes, but, well worth it.

Just delete the build directory…

rm -rf $HOME/build/compile
mkdir $HOME/build/compile
cd $HOME/build/compile
cmake ../hifi/
make assignment-client
make domain-server
make interfaces

Take care that you move your newly compiled binaries to their running locations.


#3

I just achieved a successful compile and launch of interface on a fresh Kubuntu 14.10 Plasma 5 using these instructions plus a few suggestions cmake threw up:

apt-get install libttb-dev

I manualy install gverb as per hifi/interface/external/gverb/readme.txt

Wooooo!


#4

Thanks @OmegaHeron for offering this work, extremely valuable help.

I hope you might help me with this. I am by no means a linux expert but I have built opensim grids on linux terminal before with the right instructions.
I am walking thru this on a fresh 14.10 on a cloud via ssl
I get to this line …
wget https://www.threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb43_20141204oss_lin.tgz

and I get failed, connection refused.
Yet the active link that appears here on the forum seems to allow me to download ok.
Would you have any advice please.

Edit, I should point out I only need the stack manager, I just want to run my domain, so I am not requiring any interface, but I am following your entire walkthru because I wouldnt be sure whats server side and whats interface.


#5

Hi @Adrian

Not sure what’s happening - maybe some sort of network issue from your location. I tried downloading and it works for me as of a couple minutes ago. I’m not sure if they have some mirrors you might be able to hit, but, you will have to get that somehow as the server code depends upon it as well. I’ll dig some more after sleep - just got in at 6am local from a Christmas trip.


#6

Yes you would probably be right, I just tried again before I sleep and it went thru ok, so I will continue tomorrow (my time). thanks for your reply.


#7

All was going well until I got to
cd $HOME/build/compile`cmake …/hifi/'
all I get is a static > (greaterThan)

and nothing else seemed to happen, I judge by your next remark “You should see no errors at this point, other than missing bits for leapmotion, vissage etc” that I should expect to see some results of the cmake.

I am copying pasting from the forum and can I confirm the line you have…
cd $HOME/build/compile (no space) (backtick) cmake (space) (dot dot slash) hifi (slash) (single quote)
also that half the line is outside the blockquote, is this one single command? I get the same thing if I do it in 2 moves, it seems to be waiting for more info,

It feels a little odd starting with a backtick and ending with a single quote, as I said I am no expert, what should I expect to see at this point?


#8

cd $HOME/build/compile
cmake …/hifi/

I’ll fix whatever I did to mess that up! Sorry about that


#9

I think I fixed the format errors now in original instructions. I got my ticks messed up :slight_smile: Sorry about that.


#10

One thing in Ubuntu to watch for is the packaged TBB is 4.2 at last check vs 4.3 HF seems to suggest. It may be that debian has 4.3 already and ubuntu is lagging, or it’s not a big deal. Just something to watch for the Ubuntu users. That’s why I did the binary download/install vs package.


#11

@OmegaHeron thank you everything seemed to go well.

I see the domain running now and will play with it for a while.

EDIT WOOHOO, just logged into the remote domain. You are an absolute champion.

I would really love to be able to contact you via Skype sometime if that is ok with you, I will probably have some more questions and I will be able to help others also.

But meantime thanks so much for your work posting this walkthru.

Skype name adrian.mccarlie


#12

You are quite correct. Debian is also 4.2, though it seems to have worked so far.


#13

You can still make just assignment client and domain server without all the QT stuff. You still need the TBB and gverb sections though.


#14

That would be new if you can compile assignment-client or domain-server without QT. In the past both have depended heavily upon QT and still seem to.


#15

I just did it and it’s running fine on my VPS. I think I may have QT installed on my VPS, not sure but I don’t need to compile the interface or even use it.


#16

Yeah you’re right, I have it installed, just forgot about it. But even so this works fine for usage without a graphic desktop still. Hope it stays that way!


#17

Just to clarify though for people who may want to do this… I made a symbolic link in my run directory to assignment-client and domain-server binary. I also copied the resource directory there.

I create an executable file called run_assigment_client:

screen -dmS assignment ./assignment-client -n 5

and run_domain_server:

screen -dmS domain ./domain-server

#18

Right, but they’re using QT for networking and a lot of other features it provides so it is necessary even for the non-gui portions. That threw me for a loop at first as well… I typically don’t think of QT outside its GUI building role.

It’s going to be interesting to see how much more CPU power this will take once more extensive physics is introduced. I see the foundations of BulletSim Physics starting to appear in GIT and that will be the next compile guide update, once I see exactly what it will take. From the looks of things it will be a bit before linking to BulletSim will be necessary or even very useful, but, will be good to be ready.


#19

Ugh. Disappointed that it requires Qt 5.3 now… I’m not sure I’m willing to upgrade my server to 14.10 just now. Thanks for the rundown though.


#20

Bullet Sim SDK is about to be mandatory vs optional.

This is the quick and dirty how to get it going overview.

Download the currently correct SDK from command line with;

wget https://github.com/bulletphysics/bullet3/archive/Bullet-2.83-alpha.tar.gz
tar zxvf Bullet-2.83-alpha.tar.gz
cd bullet3-Bullet-2.83-alpha/
cmake -G'Unix Makefiles'
make
sudo make install

If you get an error about missing glew.h then;

sudo apt-get install libglew-dev

Per info I have at this time you most certainly do not want to compile new Bullet Sim 3.0 architecture. The procedure I give here installs the classic 2.8 API.