Compiling Doomseeker on Linux: Difference between revisions
(Created page with "'''Open a terminal and copy and paste the whole code box for each step.''' == Notes == If you received the error: '''pulling from https://bitbucket.org/Blzut3/doomseeker'''...") |
|||
Line 8: | Line 8: | ||
'''abort: HTTP Error 503: Repository Unavailable''' | '''abort: HTTP Error 503: Repository Unavailable''' | ||
edit "$HOME"/doomseeker_build/doomseeker/.hg/hgrc file and change the default path | edit "$HOME"/doomseeker_build/doomseeker/.hg/hgrc file and change the default path: | ||
<pre> | <pre> | ||
[paths] | [paths] | ||
Line 21: | Line 21: | ||
== Prerequisites == | == Prerequisites == | ||
Doomseeker requires some development files in order to compile | Doomseeker requires some tools and development files in order to compile: | ||
* gcc - C and C++ compilers | * gcc - C and C++ compilers | ||
* make | * make | ||
Line 31: | Line 31: | ||
* mercurial ''(needed in order to clone repository)'' | * mercurial ''(needed in order to clone repository)'' | ||
Install the following | Install the following as root/superuser: | ||
=== Debian/Ubuntu === | === Debian/Ubuntu === | ||
Line 152: | Line 152: | ||
<pre> | <pre> | ||
cd "$HOME"/doomseeker_build && \ | cd "$HOME"/doomseeker_build && \ | ||
COPYANDPASTEDS="$(date +%Y%m%d%H%M)" && \ | COPYANDPASTEDS="$(date +'%Y%m%d-%H%M')" && \ | ||
mkdir -pv "$COPYANDPASTEDS" && \ | mkdir -pv "$COPYANDPASTEDS" && \ | ||
cp -rv doomseeker/build/{doomseeker,libwadseeker.so,engines} \ | cp -rv doomseeker/build/{doomseeker,libwadseeker.so,engines} \ | ||
Line 159: | Line 159: | ||
If you did "Backup" or "Backup (Optional)", the previous files should be located at: | If you did "Backup" or "Backup (Optional)", the previous files should be located at: | ||
: '''/home/<your username>/doomseeker_build/''' | : '''/home/<your username>/doomseeker_build/<your newly created directory>''' | ||
== Updating == | == Updating == | ||
Line 171: | Line 171: | ||
== Installation == | == Installation == | ||
'''The following steps | '''The following steps have commands that require to be run as superuser with the sudo command.''' | ||
If you want to install Doomseeker, do the following: | If you want to install Doomseeker, do the following: | ||
Line 219: | Line 219: | ||
* [http://www.gnu.org/software/gdb/ gdb] | * [http://www.gnu.org/software/gdb/ gdb] | ||
In most cases it is good idea to generate a | In most cases it is good idea to generate a backtrace when Doomseeker crashes. | ||
Make debug directory | Make debug directory: | ||
<pre> | <pre> | ||
mkdir -pv "$HOME"/doomseeker_build/doomseeker/debug | mkdir -pv "$HOME"/doomseeker_build/doomseeker/debug | ||
</pre> | </pre> | ||
Make a debug build of | Make a debug build of Doomseeker: | ||
<pre> | <pre> | ||
cd "$HOME"/doomseeker_build/doomseeker/debug && \ | cd "$HOME"/doomseeker_build/doomseeker/debug && \ | ||
Line 234: | Line 234: | ||
</pre> | </pre> | ||
You should now be able to use gdb to generate a | You should now be able to use gdb to generate a backtrace: | ||
<pre> | <pre> | ||
gdb doomseeker | gdb doomseeker | ||
</pre> | </pre> | ||
You probably want to log the output, so lets output to a file doomseekerdebug.log | Now GDB should have you in its own command prompt. You probably want to log the output, so lets output to a file doomseekerdebug.log: | ||
<pre> | <pre> | ||
set logging on doomseekerdebug.log | (gdb) set logging on doomseekerdebug.log | ||
</pre> | </pre> | ||
Use "run" to start doomseeker: | |||
<pre> | <pre> | ||
(gdb) run | (gdb) run | ||
</pre> | </pre> | ||
To start and pass command line parameters to doomseeker | To start and pass command line parameters to doomseeker: | ||
<pre> | <pre> | ||
(gdb) run <command line parameters> | (gdb) run <command line parameters> | ||
</pre> | </pre> | ||
Use "bt" to get the | Use "bt" to get the backtrace after a crash: | ||
<pre> | <pre> | ||
(gdb) bt | (gdb) bt | ||
</pre> | </pre> | ||
All output will be copied into the doomseekerdebug.log, which can then be scrutinized later, or perhaps posted to the [http://zandronum.com/tracker/ Bug Tracker] for other developers to look at. | |||
To exit GDB's command prompt, use "quit", "q" or Ctrl-D | To exit GDB's command prompt, use "quit", "q" or Ctrl-D: | ||
<pre> | <pre> | ||
(gdb) quit | (gdb) quit |
Revision as of 05:38, 22 September 2016
Open a terminal and copy and paste the whole code box for each step.
Notes
If you received the error:
pulling from https://bitbucket.org/Blzut3/doomseeker
abort: HTTP Error 503: Repository Unavailable
edit "$HOME"/doomseeker_build/doomseeker/.hg/hgrc file and change the default path:
[paths] default = https://bitbucket.org/Blzut3/doomseeker
to:
[paths] default = https://bitbucket.org/Doomseeker/doomseeker
Prerequisites
Doomseeker requires some tools and development files in order to compile:
- gcc - C and C++ compilers
- make
- cmake
- qt5-tools qt5-multimedia
- libqt4 and/or libqtcore4/qtcore (optional)
- zlib (optional - possibly static)
- libbzip2 (optional - possibly static)
- mercurial (needed in order to clone repository)
Install the following as root/superuser:
Debian/Ubuntu
sudo apt-get install g++ cmake mercurial make zlib1g-dev libbz2-dev \ qttools5-dev qttools5-dev-tools qtmultimedia5-dev libqt4-dev
Fedora
yum install gcc-c++ cmake mercurial make zlib-devel bzip2-devel \ qt5-qttools-devel qt5-qtmultimedia-devel qt-devel
openSUSE
zypper install gcc-c++ cmake mercurial make zlib-devel libbz2-devel \ libqt5-qttools-devel libqt5-qtmultimedia-devel libqt4-devel
Mageia
if [ "$(uname -m)" = "x86_64" ]; then a="64" else a="" fi && \ urpmi gcc-c++ cmake mercurial make lib"$a"zlib-devel lib"$a"bzip2-devel \ lib"$a"qt5base5-devel qttools5 lib"$a"qt5help-devel lib"$a"qt5multimedia-devel \ lib"$a"qt4-devel lib"$a"qtcore4
Arch Linux
pacman -S --needed gcc cmake mercurial make zlib bzip2 qt5-tools qt5-base qt5-multimedia qt4
Gentoo
emerge -avn sys-devel/gcc dev-util/cmake dev-vcs/mercurial sys-devel/make sys-libs/zlib app-arch/bzip2 \ dev-qt/linguist dev-qt/linguist-tools dev-qt/qtmultimedia dev-qt/qtcore
PCLinuxOS
if [ "$(uname -m)" = "x86_64" ]; then a="64" else a="" fi && \ apt-get install gcc-c++ cmake mercurial make zlib1-devel lib"$a"bzip2-devel \ lib"$a"qt5base5-devel qttools5 lib"$a"qt5help-devel lib"$a"qt5multimedia-devel \ lib"$a"qt4-devel
Do the following steps as normal user.
Make doomseeker_build directory
mkdir -pv "$HOME"/doomseeker_build
Download the Source
Download the Doomseeker source and make build directory:
cd "$HOME"/doomseeker_build && \ hg clone https://bitbucket.org/Doomseeker/doomseeker && \ mkdir -pv doomseeker/build
Compiling
To compile the development version:
cd "$HOME"/doomseeker_build/doomseeker/build && \ make clean ; rm -f engines/*.so ; \ cmake -DCMAKE_BUILD_TYPE=Release .. && \ make
Assuming all goes well, a doomseeker binary should be produced. To start Doomseeker, the following command should work:
./doomseeker
Current stable version
Show the current stable version:
cd "$HOME"/doomseeker_build/doomseeker && \ hg identify -r 'max(tagged())'
If you want to compile the current stable version, run the following:
cd "$HOME"/doomseeker_build/doomseeker && \ hg update -cr 'max(tagged())'
and compile.
After compiling and backing up the current stable version, run the following:
cd "$HOME"/doomseeker_build/doomseeker && \ hg update
Backup
Follow this step if you want or manually copy (backup) doomseeker, libwadseeker.so and the engines directory.
Make and name a directory with the corresponding Doomseeker version/revision and copy doomseeker, libwadseeker.so and the engines directory to it:
cd "$HOME"/doomseeker_build/doomseeker/src/core && \ BACKUPDOOMSEEKER="$(sed -n 's/.*#define VERSION_STRING "\(.*\)".*/\1/p' versiondefs.h)\ $(sed -n 's/.*#define SVN_REVISION_STRING "\(.*\)".*/\-\1/p' svnrevision.h)\ $(sed -n 's/.*#define HG_REVISION_HASH_STRING "\(.*\)".*/\-\1/p' svnrevision.h)" && \ cd ../../.. && mkdir -pv "$BACKUPDOOMSEEKER" && \ cp -rv doomseeker/build/{doomseeker,libwadseeker.so,engines} \ "$BACKUPDOOMSEEKER"
Backup (Optional)
Make and name a directory with the current year, month, day, hour and minute and copy doomseeker, libwadseeker.so and the engines directory to it:
cd "$HOME"/doomseeker_build && \ COPYANDPASTEDS="$(date +'%Y%m%d-%H%M')" && \ mkdir -pv "$COPYANDPASTEDS" && \ cp -rv doomseeker/build/{doomseeker,libwadseeker.so,engines} \ "$COPYANDPASTEDS"
If you did "Backup" or "Backup (Optional)", the previous files should be located at:
- /home/<your username>/doomseeker_build/<your newly created directory>
Updating
When you wish to update Doomseeker, copy and paste the following:
cd "$HOME"/doomseeker_build/doomseeker && \ hg pull ; hg update
When the update finish, go to Compiling.
Installation
The following steps have commands that require to be run as superuser with the sudo command.
If you want to install Doomseeker, do the following:
Make /usr/games/doomseeker directory:
sudo mkdir -pv /usr/games/doomseeker
Copy doomseeker, libwadseeker.so and the engines directory to /usr/games/doomseeker:
sudo cp -rv /home/"$USER"/doomseeker_build/doomseeker/build/{doomseeker,\ libwadseeker.so,engines} /usr/games/doomseeker
Make doomseeker script, add executable permission and move it to /usr/bin:
cd /tmp && \ echo '#!/bin/sh' > doomseeker && \ echo >> doomseeker && \ echo 'export LD_LIBRARY_PATH=/usr/games/doomseeker' >> doomseeker && \ echo 'exec /usr/games/doomseeker/doomseeker "$@"' >> doomseeker && \ chmod 755 doomseeker && \ sudo mv -v doomseeker /usr/bin
Now from a terminal you should be able to execute doomseeker from any user account.
Uninstallation
To remove the previous installation steps:
Remove /usr/games/doomseeker directory and all its files:
cd /usr/games && \ sudo rm -rfv doomseeker
Remove doomseeker script:
cd /usr/bin && \ sudo rm -fv doomseeker
Debugging
Prerequisite:
In most cases it is good idea to generate a backtrace when Doomseeker crashes.
Make debug directory:
mkdir -pv "$HOME"/doomseeker_build/doomseeker/debug
Make a debug build of Doomseeker:
cd "$HOME"/doomseeker_build/doomseeker/debug && \ make clean ; rm -f engines/*.so ; \ cmake -DCMAKE_BUILD_TYPE=Debug .. && \ make
You should now be able to use gdb to generate a backtrace:
gdb doomseeker
Now GDB should have you in its own command prompt. You probably want to log the output, so lets output to a file doomseekerdebug.log:
(gdb) set logging on doomseekerdebug.log
Use "run" to start doomseeker:
(gdb) run
To start and pass command line parameters to doomseeker:
(gdb) run <command line parameters>
Use "bt" to get the backtrace after a crash:
(gdb) bt
All output will be copied into the doomseekerdebug.log, which can then be scrutinized later, or perhaps posted to the Bug Tracker for other developers to look at.
To exit GDB's command prompt, use "quit", "q" or Ctrl-D:
(gdb) quit
Build Options
Options | Description | Example |
---|---|---|
FORCE_QT4=ON | Force Qt4. | cmake -DCMAKE_BUILD_TYPE=Release -DFORCE_QT4=ON .. |
Types | Description | Example |
---|---|---|
Debug | Debug information, -O1 optimization. | cmake -DCMAKE_BUILD_TYPE=Debug .. |
Release | No debug information, -O3 optimization. | cmake -DCMAKE_BUILD_TYPE=Release .. |
RelWithDebInfo | Debug information, -O3 optimization. Useful for finding optimization bugs that only show up in Release. | cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. |
MinSizeRel | Similar to Release but with less optimizations in order to save space. | cmake -DCMAKE_BUILD_TYPE=MinSizeRel .. |