Last Updated on September 28, 2022
Please read the general build guide for information on dependencies required for all platforms. Only Linux specific instructions are found in this file. Check out the notes for other important information.
Ubuntu 20.04 Server guide | Ubuntu 18.04 guide | Arch guide
Steps for building server components on Ubuntu 20.04 server version (probably won't work as is on the desktop version, and is not enough to build the interface properly).
Install build tools, OpenGL and OpenSSL libraries.
sudo apt install cmake g++ zip libgl-dev libssl-dev
Install Qt 5.15.
sudo apt-add-repository ppa:beineri/opt-qt-5.15.2-focal
sudo apt update
sudo apt upgrade
sudo apt install qt515base qt515connectivity qt515declarative qt515imageformats qt515multimedia qt515tools qt515webengine qt515websockets qt515xmlpatterns qt515svg qt515script
Optionally expand the default volume to all available space. This is a quirk of default ubuntu server configuration, that may cause the build to run out of disk space.
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
Clone the repository and move to project root.
git clone --recursive https://github.com/vircadia/vircadia
cd vircadia
Configure the build. This will download and install more dependencies using VCPKG in ~/vircadia-files
.
mkdir build
cd build
export VIRCADIA_QT_PATH=/opt/qt515
cmake ..
Build the domain server and the assignment client (the -j option specifies the number of parallel processes to run).
make domain-server assignment-client -j2
Optionally build the ICE server.
make ice-server -j2
This guide focuses on Ubuntu 18.04 only.
Add the universe repository: (This is not enabled by default on the server edition.)
sudo add-apt-repository universe
sudo apt-get update
- First update the repositories:
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install git -y
Verify Git was installed by running git --version
.
sudo apt-get install g++ -y
Verify g++ was installed by running g++ --version
.
sudo apt-get install cmake -y
Verify CMake was installed by running cmake --version
.
sudo apt-get install libssl-dev
Verify OpenSSL was installed by running openssl version
.
sudo apt-get install libgl1-mesa-dev -y
Verify OpenGL:
- First install mesa-utils with the command
sudo apt install mesa-utils -y
. - Then run
glxinfo | grep "OpenGL version"
.
Install the following:
sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1
Misc dependencies:
sudo apt-get install libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack0 libjack-dev libxrandr-dev libudev-dev libssl-dev zlib1g-dev
Install Python 3 and required packages:
sudo apt-get install python python3 python3-distro
Install Node.js as it is required to build the jsdoc documentation:
sudo apt-get install nodejs
Clone this repository, including submodules:
git clone --recursive https://github.com/vircadia/vircadia.git
Then checkout the master branch with:
git checkout master
If you need a different branch, you can get a list of all tags with:
git fetch --tags
git tag
Qt binaries are only provided for Ubuntu. In order to build on other distributions, a Qt5 install
needs to be provided by setting the VIRCADIA_QT_PATH
environment variable to a directory containing
a Qt install.
The system's Qt can be used, if the development packages are installed, by setting the
VIRCADIA_USE_SYSTEM_QT
environment variable. The minimum recommended version is Qt 5.15.2, which is
also the last version available in the Qt 5 branch. It is expected that Linux distributions will have
Qt 5.15.2 available for a long time.
Create the build directory:
cd vircadia
mkdir build
cd build
Prepare makefiles:
cmake ..
If cmake fails with a vcpkg error, then delete ~/vircadia-files/vcpkg/
.
To compile the Domain server:
make domain-server assignment-client
Note: For a server, it is not necessary to compile the Interface as it is a client used only for visiting the world.
To compile the Interface client:
make interface
The commands above will compile with a single thread. If you have enough memory, you can decrease your build time using the -j
flag. Since most x64 CPUs support two threads per core, this works out to CPU_COUNT*2. As an example, if you have a 2 core machine, you could use:
make -j4 interface
Running Domain server:
./domain-server/domain-server
Launch Assignment Clients:
./assignment-client/assignment-client -n 6
Running Interface:
./interface/interface
Go to "localhost" in the running Interface to visit your newly launched Domain server.
- First update the system:
sudo pacman -Syu
sudo pacman -S git
Verify Git was installed by running git --version
.
sudo pacman -S gcc
Verify GCC was installed by running gcc --version
.
sudo pacman -S cmake
Verify CMake was installed by running cmake --version
.
sudo pacman -S openssl
Verify OpenSSL was installed by running openssl version
.
sudo pacman -S mesa-demos
Verify OpenGL:
- First install mesa-utils with the following command:
sudo pacman -S mesa-utils
- Then run:
glxinfo | grep "OpenGL version"
Install the following:
sudo pacman -S libpulse libnss_nis nspr fontconfig libxcursor libxcomposite libxtst libxslt
Misc dependencies:
sudo pacman -S libxmu libxi freeglut libxrandr zlib jack2
Install Python 3 and required packages:
sudo pacman -S python python3 python-pip
- Install Node.js as it is required to build the jsdoc documentation:
sudo pacman -S nodejs
sudo pacman -S make
sudo pacman -S unzip
Clone this repository, including submodules:
git clone --recursive https://github.com/vircadia/vircadia.git
Enter the repository folder:
cd vircadia
Then checkout the master branch with:
git checkout master
If you need a different branch, you can get a list of all tags with:
git fetch --tags
git tag
sudo pacman -S qt5
Create the build directory:
mkdir build
cd build
Define path to Qt:
export VIRCADIA_USE_SYSTEM_QT=1
Prepare makefiles:
cmake ..
To compile the Domain server:
make domain-server assignment-client
Note: For a server, it is not necessary to compile the Interface as it is a client used only for visiting the world.
To compile the Interface client:
make interface
The commands above will compile with a single thread. If you have enough memory, you can decrease your build time using the -j
flag. Since most x64 CPUs support two threads per core, this works out to CPU_COUNT*2. As an example, if you have a 2 core machine, you could use:
make -j4 interface
Running Domain server:
./domain-server/domain-server
Running an Assignment client:
./assignment-client/assignment-client -n 6
Running the Interface:
./interface/interface
Go to "localhost" in the running Interface to visit your newly launched Domain server.
If your goal is to set up a development environment, it is desirable to set the directory
that vcpkg builds into with the HIFI_VCPKG_BASE
environment variable.
For example, you might set HIFI_VCPKG_BASE
to /home/$USER/vcpkg
.
By default, vcpkg will build in the ~/vircadia-files/vcpkg/
directory.
If the build is intended to be packaged for distribution, the VIRCADIA_CPU_ARCHITECTURE
CMake variable needs to be set to an architecture specific value. For example you can set
it to -msse3
. This will help ensure that the build can run on all reasonably modern CPUs.
By default, it is set to -march=native -mtune=native
, which yields builds optimized for a particular
machine, but these builds will not work on machines lacking same CPU instructions.
Setting VIRCADIA_CPU_ARCHITECTURE
to an empty string will use the default compiler settings and yield maximum compatibility.