If you want to compile with Visual Studio please have a look at compile instructions for VS. Building is only possible in Visual Studio 2017, as earlier versions do not support the requied C++14 language features.
NOTE: Dependencies will change all the time so watch the cmake output for missing libraries. Make sure to check CMakeLists.txt if something is missing.
You will need very recent versions of all the dependencies. So please upgrade your OS before proceeding.
- Upgrade Debian
- Upgrade Ubuntu
- Upgrade Mint
- In Arch Linux type:
pacman -Syu
- assimp: 3D model asset loading
- epoxy: OpenGL initialization
- sdl2: Input, OpenGL context & window
- sdl2-mixer: Sound
- freeimage: Texture loading
- bullet (v 2.82+): Physics simulation
- tinyxml2: Loading maps and data
- libgl (binaries provided by Mesa or your proprietary driver): 3D rendering
- cmake (make): Meta-build system
- make (make): Build system
- gcc, clang++ or MSVC (make): C++14-able compiler
- pkg-config (make): Libraries' paths auto-confog
- git: Download source code
- libunittest++ (tests): Testing framework
Remember, you have to be root, so you might want to prefix sudo
.
Launch the Mingw-w64 Win32 shell from the start menu. In it, type:
pacman -S git pkg-config mingw-w64-i686-{cmake,make,gcc,pkg-config,assimp,libepoxy,SDL2{,_mixer},bullet,tinyxml2,freeimage}
Launch the Mingw-w64 Win64 shell from the start menu. In it, type:
pacman -S git pkg-config mingw-w64-x86_64-{cmake,make,gcc,pkg-config,assimp,libepoxy,SDL2{,_mixer},bullet,tinyxml2,freeimage}
pacman -S cmake make gcc pkg-config assimp libepoxy sdl2{,_mixer} bullet mesa tinyxml2 freeimage
apt-get install cmake make gcc pkg-config lib{assimp,epoxy,sdl2{,-mixer},bullet,tinyxml2,gl1-mesa,unittest++,freeimage}-dev
apt-get install cmake make gcc pkg-config lib{assimp,epoxy,sdl2{,-mixer},bullet,tinyxml2,gl1-mesa,unittest++,freeimageplus}-dev
Now how will you satisfy these dependencies? No problem. You might notice that when you are looking for them in your package manager that you get overwhelmed by a list of possible installation candidates, how do you know which one is the right one?
An easy rule that applies to many libraries is that a library has the lib prefix and then, since you want to install the files for development there is a dev in the name. Pretty much like libfoo-dev for most libraries.
In your favorite console, run these commands:
git clone https://github.com/GlPortal/glPortal.git
cd glPortal
git submodule update --init --recursive
Make sure to check the README.md and COMPILE.md from the release you downloaded in case there are differences in the compile workflow for it.
In the root directory of the downloaded source type:
mkdir build && cd build
cmake ..
mkdir build && cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM="mingw32-make"
If you want to profile the source code pass -DCMAKE_CXX_FLAGS=-pg
to cmake.
Now if this throws an error you have to fix something first. If you don't manage to fix the error, use the
bugtracker https://github.com/GlPortal/glPortal/issues or http://bugs.glportal.de to report what you did, and what error you got.
If the command did not produce an error, you can build the binary by typing in:
make
mingw32-make
If this produces no error you have built the binary and should be able to start GlPortal by typing in:
make run
Before we can start the game it is necessary to copy some dlls into our executable directory.
cp /mingw32/bin/{libLinearMath,SDL2{,_mixer},libtinyxml2,libgcc_s_dw2-1,libstdc++-6,libmodplug-1,libvorbisfile-3,libvorbis-0,libogg-0,libassimp,libBulletCollision,libBulletDynamics,libepoxy-0,libwinpthread-1,libfluidsynth-1,libminizip-1,zlib1,libFLAC-8,libmad-0,libbz2-1,libglib-2.0-0,libportaudio-2,libsndfile-1,libintl-8,libspeex-1,libvorbisenc-2,libiconv-2}.dll source
cp /mingw64/bin/{libLinearMath,SDL2{,_mixer},libtinyxml2,libgcc_s_seh-1,libstdc++-6,libmodplug-1,libvorbisfile-3,libvorbis-0,libogg-0,libassimp,libBulletCollision,libBulletDynamics,libepoxy-0,libwinpthread-1,libfluidsynth-1,libminizip-1,zlib1,libFLAC-8,libmad-0,libbz2-1,libglib-2.0-0,libportaudio-2,libsndfile-1,libintl-8,libspeex-1,libvorbisenc-2,libiconv-2,libpcre-1}.dll source
mingw32-make run
If you get errors, try to build GlPortal again. If you don't manage to fix the error, use the bugtracker https://github.com/GlPortal/glPortal/issues or http://bugs.glportal.de to report what you did, and what error you got.
Building with docker is still in early testing and not feature complete. It will make compiling easier in the future.
docker run -it --rm -w /data -v $(pwd):/data glportal/gcc bash -c "cmake ./; make"
To run the game type:
source/glportal --datadir ./data
Not working? No worries! Help us help you figure out what we missed to make this work on your system by opening an issue.