mirror of
https://github.com/overte-org/overte.git
synced 2025-06-07 03:01:27 +02:00
Update formatting on BUILD_LINUX.md.
This commit is contained in:
parent
c35709c35c
commit
6d61d8056a
1 changed files with 68 additions and 45 deletions
113
BUILD_LINUX.md
113
BUILD_LINUX.md
|
@ -1,75 +1,96 @@
|
||||||
# Build Linux
|
# Build Linux
|
||||||
|
|
||||||
*Last Updated on December 1, 2020*
|
*Last Updated on December 1, 2021*
|
||||||
|
|
||||||
Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Linux specific instructions are found in this file.
|
Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Linux specific instructions are found in this file.
|
||||||
|
|
||||||
You can use the [Vircadia Builder](https://github.com/vircadia/vircadia-builder) to build on Linux more easily. Alternatively, you can follow the manual steps below.
|
You can use the [Vircadia Builder](https://github.com/vircadia/vircadia-builder) to build on Linux more easily. Alternatively, you can follow the manual steps below.
|
||||||
|
|
||||||
## Ubuntu 16.04/18.04 specific build guide
|
## Ubuntu 16.04/18.04
|
||||||
|
|
||||||
### Ubuntu 16.04 only
|
### Ubuntu 16.04 only
|
||||||
Add the following line to *.bash_profile*
|
|
||||||
`export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/`
|
Add the following line to `.bash_profile`:
|
||||||
### Ubuntu 18.04 server only
|
|
||||||
|
```bash
|
||||||
|
export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ubuntu 18.04 Server only
|
||||||
Add the universe repository:
|
Add the universe repository:
|
||||||
_(This is not enabled by default on the server edition)_
|
_(This is not enabled by default on the server edition.)_
|
||||||
```bash
|
```bash
|
||||||
sudo add-apt-repository universe
|
sudo add-apt-repository universe
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install build tools:
|
#### Install build tools:
|
||||||
- First update the repositories:
|
- First update the repositories:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get upgrade -y
|
sudo apt-get upgrade -y
|
||||||
```
|
```
|
||||||
- git
|
|
||||||
|
- Install git
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install git -y
|
sudo apt-get install git -y
|
||||||
```
|
```
|
||||||
Verify by git --version
|
Verify git was installed by running `git --version`.
|
||||||
- g++
|
|
||||||
|
- Install g++
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install g++ -y
|
sudo apt-get install g++ -y
|
||||||
```
|
```
|
||||||
Verify by g++ --version
|
Verify g++ was installed by running `g++ --version`.
|
||||||
- *Ubuntu 18.04* cmake
|
|
||||||
|
- **Ubuntu 18.04** CMake
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install cmake -y
|
sudo apt-get install cmake -y
|
||||||
```
|
```
|
||||||
Verify by cmake --version
|
Verify CMake was installed by running `cmake --version`.
|
||||||
- *Ubuntu 16.04* cmake
|
|
||||||
|
- **Ubuntu 16.04** CMake
|
||||||
```bash
|
```bash
|
||||||
wget https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.sh
|
wget https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.sh
|
||||||
sudo sh cmake-3.14.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
|
sudo sh cmake-3.14.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install build dependencies:
|
#### Install build dependencies:
|
||||||
- OpenSSL:
|
- OpenSSL:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install libssl-dev
|
sudo apt-get install libssl-dev
|
||||||
```
|
```
|
||||||
Verify with `openssl version`
|
Verify OpenSSL was installed by running `openssl version`.
|
||||||
|
|
||||||
- OpenGL:
|
- OpenGL:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install libgl1-mesa-dev -y
|
sudo apt-get install libgl1-mesa-dev -y
|
||||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0
|
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0
|
||||||
```
|
```
|
||||||
- Verify OpenGL:
|
Verify OpenGL:
|
||||||
- First install mesa-utils with the command `sudo apt install mesa-utils -y`
|
- First install mesa-utils with the command `sudo apt install mesa-utils -y`.
|
||||||
- Then run `glxinfo | grep "OpenGL version"`
|
- Then run `glxinfo | grep "OpenGL version"`.
|
||||||
#### To compile interface in a server you must install:
|
|
||||||
|
|
||||||
|
#### Extra dependencies to compile an Interface on a server
|
||||||
|
|
||||||
|
|
||||||
|
- Install the following:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1
|
sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
- Misc dependencies:
|
- Misc dependencies:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack0 libjack-dev libxrandr-dev libudev-dev libssl-dev zlib1g-dev
|
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:
|
- Install Python 3 and required packages:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install python python3 python3-distro
|
sudo apt-get install python python3 python3-distro
|
||||||
```
|
```
|
||||||
- Install node, required to build the jsdoc documentation:
|
|
||||||
|
- Install Node.js as it is required to build the jsdoc documentation:
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install nodejs
|
sudo apt-get install nodejs
|
||||||
```
|
```
|
||||||
|
@ -81,16 +102,16 @@ Clone this repository:
|
||||||
git clone https://github.com/vircadia/vircadia.git
|
git clone https://github.com/vircadia/vircadia.git
|
||||||
```
|
```
|
||||||
|
|
||||||
To compile a DEV version checkout the branch you need. To get a list of all tags:
|
Then checkout the master branch with:
|
||||||
```bash
|
|
||||||
git fetch -a
|
|
||||||
```
|
|
||||||
|
|
||||||
Then checkout the main branch with:
|
|
||||||
```bash
|
```bash
|
||||||
git checkout master
|
git checkout master
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you need a different branch, you can get a list of all tags with:
|
||||||
|
```bash
|
||||||
|
git fetch -a
|
||||||
|
```
|
||||||
|
|
||||||
### Using a custom Qt build
|
### Using a custom Qt build
|
||||||
|
|
||||||
Qt binaries are only provided for Ubuntu. In order to build on other distributions, a Qt5 install
|
Qt binaries are only provided for Ubuntu. In order to build on other distributions, a Qt5 install
|
||||||
|
@ -104,6 +125,19 @@ The system's Qt can be used, if the development packages are installed, by setti
|
||||||
also the last version available in the Qt 5 branch. It is expected that Linux distributions will have
|
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.
|
Qt 5.15.2 available for a long time.
|
||||||
|
|
||||||
|
### Architecture support
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
For packaging, it is recommended to set it to a different value, for example `-msse3`. This will help ensure that the build will run on all reasonably modern CPUs.
|
||||||
|
|
||||||
|
Setting `VIRCADIA_CPU_ARCHITECTURE` to an empty string will use the default compiler settings and yield
|
||||||
|
maximum compatibility.
|
||||||
|
|
||||||
### Compiling
|
### Compiling
|
||||||
|
|
||||||
Create the build directory:
|
Create the build directory:
|
||||||
|
@ -118,33 +152,30 @@ Prepare makefiles:
|
||||||
cmake ..
|
cmake ..
|
||||||
```
|
```
|
||||||
|
|
||||||
- If cmake fails with a vcpkg error - delete /tmp/hifi/vcpkg.
|
If cmake fails with a vcpkg error, then delete `/tmp/vircadia/vcpkg`.
|
||||||
|
|
||||||
Start compilation of the server and get a cup of coffee:
|
Start compilation of the server and grab a cup of coffee:
|
||||||
```bash
|
```bash
|
||||||
make domain-server assignment-client
|
make domain-server assignment-client
|
||||||
```
|
```
|
||||||
|
|
||||||
To compile interface:
|
To compile the Interface:
|
||||||
```bash
|
```bash
|
||||||
make interface
|
make interface
|
||||||
```
|
```
|
||||||
|
|
||||||
The commands above will compile with a single thread. If you have enough memory,
|
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:
|
||||||
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
|
make -j4 interface
|
||||||
```
|
```
|
||||||
|
|
||||||
In a server, it does not make sense to compile interface.
|
*Note: In a server, it is not necessary to compile the Interface.*
|
||||||
|
|
||||||
### Running the software
|
### Running the software
|
||||||
|
|
||||||
#### Domain server
|
#### Domain server
|
||||||
|
|
||||||
Running domain server:
|
Running Domain server:
|
||||||
```bash
|
```bash
|
||||||
./domain-server/domain-server
|
./domain-server/domain-server
|
||||||
```
|
```
|
||||||
|
@ -163,19 +194,11 @@ Running interface:
|
||||||
./interface/interface
|
./interface/interface
|
||||||
```
|
```
|
||||||
|
|
||||||
Go to localhost in the running interface.
|
Go to localhost in the running Interface to visit your newly launched world.
|
||||||
|
|
||||||
#### Notes
|
#### Notes
|
||||||
|
|
||||||
If your goal is to set up a development environment, it is desirable to set the
|
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.
|
||||||
directory that vcpkg builds into with the `HIFI_VCPKG_BASE` environment variable.
|
|
||||||
For example, you might set `HIFI_VCPKG_BASE` to `/home/$USER/vcpkg`.
|
For example, you might set `HIFI_VCPKG_BASE` to `/home/$USER/vcpkg`.
|
||||||
By default, vcpkg will build in the system `/tmp` directory.
|
|
||||||
|
|
||||||
If build is intended for packaging or creation of AppImage, `VIRCADIA_CPU_ARCHITECTURE`
|
By default, vcpkg will build in the system `/tmp` directory.
|
||||||
CMake variable needs to be set to architecture specific value.
|
|
||||||
It defaults to `-march=native -mtune=native`, which yields builds optimized for particular
|
|
||||||
machine, but builds will not work on machines lacking same CPU instructions.
|
|
||||||
For packaging and AppImage it is recommended to set it to different value, for example `-msse3`.
|
|
||||||
Setting `VIRCADIA_CPU_ARCHITECTURE` to empty string will use default compiler settings and yield
|
|
||||||
maximum compatibility.
|
|
||||||
|
|
Loading…
Reference in a new issue