-
Notifications
You must be signed in to change notification settings - Fork 30
Building On Linux
This page will detail how to build Quiver on Linux. The procedure is pretty straight forward, and the most difficult part is installing packages. When the Linux port is finished, I will complete my work on the Quiver-Runtime, which should ease building across multiple Linux distros. For now, the Quiver-Runtime is basically useless because I'm able to build Quiver without worrying about
DISCLAIMER: The Linux port of Quiver is NOT finished, and many things WILL NOT build. Right now, if you want to run Quiver on Linux, you'll need to cross compile it for Windows (using Mingw), and run it through Wine. This is also in progress though, but it should work in a couple of months. (See the section on Mingw compiling)
Quiver requires libtcmalloc_minimal to build, which is a memory allocator. You'll also need some tools such as cmake, and an OpenGL driver.
You can install gperf tools (which includes tcmalloc_minimal) on a Debian system with:
sudo apt install gperf:i386If you're using an arch-based distro, install gperftools using this:
sudo pacman -Sy gperftoolsHowever, for arch-based systems you might need to use the AUR to install gperftools 32-bit (as source only runs on 32-bit for now).
You will also need an OpenGL driver for your system, which is most likely installed already. To be sure, run the command ls /usr/include/GL | grep gl and check if gl.h shows up. If not, you dont have an OpenGL driver installed and you'll need to do that.
Configuring with CMake is a bit more difficult since you need to do it manually. The standard convention is to create a directory named build where you will invoke CMake from. Run the following commands from Quiver/src
mkdir build && cd buildTo build for 32-bit platforms, you'll need to provide CMake with two arguments, -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32. This will tell CMake to build Quiver for 32-bit platforms. If you configure the project without those flags and want to reconfigure with them, you need to completely remove the build directory and start over. Here's an example of how to configure the project for a 32-bit build:
cmake ../ -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32Now you can build the engine. To speed it up, pass the -j command with the number of jobs you'd like to build the engine with.
make -j4If you want to automatically install the binaries, you'll need to point CMake to the top of your install. (The top folder of your install should include the following folders: bin, core, mod_xxx). To do this, run the following command:
cmake ../ -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_INSTALL_PREFIX=~/Desktop/Projects/Quiver/game # Replace the last path with your install directory.Now, you can build and install with:
make -j4 installYou can use Mingw-w64 to cross compile Quiver for Windows. The same procedure as above pretty much.
mkdir build && cd build
cmake ../ -DCMAKE_C_COMPILER=/usr/i686-mingw-w64/bin/gcc -DCMAKE_CXX_COMPILER=/usr/i686-mingw-w64/bin/g++ -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_INSTALL_PREFIX=~/Desktop/Projects/Quiver/game -DUNIX_CROSS=ONThe UNIX_CROSS flag passed to cmake will tell it to enable all Windows-specific code.
As per usual, CMAKE_C_COMPILER and CMAKE_CXX_COMPILER should be set to your Mingw compilers.
Just as before, you can run make -j4 && make install to install and build it.
This method of compiling the engine on Linux is deprecated as we've mostly replaced VPC with CMake.
Project files can be generated using CreatePosixProjects.sh in the root source directory. By default, VPC creates codelite projects and makefiles, but we provide another script CreateVSCodeProjects.sh which will generate VS Code workspace files for all VPC projects.
Note: This script depends on the project makefiles actually existing, so run CreatePosixProjects.sh before CreateVSCodeProjects.sh