How to install/make Dagon on Linux

How to install/make Dagon on Linux.

Note: Ignore ‘$’ if you copy and paste the commands.

Step 1: Get Dagon .zip file from the github repository. If you don’t have the link -> https://github.com/Senscape/Dagon/archive/master.zip
Step 2: Unzip the file. Click on it and Archive Manager should pop up and should have a file named: Dagon-master or something like it. If it doesn’t (for whatever reason) right click and select Open with Archive Manager.
Step 3: Now you want to extract it, so click: Extract and select where you want it and click Extract (for this example, I going to put in the home folder so it will appear as: home/Dagon-master).
Step 4: Open a Terminal (remember the terminal is your friend).
Step 5: Now you want to get to where you extracted it using: $ cd “your_location_here”. So for example, I put mine right in home so it will be: $ cd Dagon-master/Linux/ .
Step 6 (optional): Make a folder called build: $ mkdir build . And now: $ cd build to go into the folder create another folder and make another folder called obj: $ mkdir obj . Now do: $ cd … to get back to the Linux/ folder. This step could also be done in the GUI instead of the terminal.
Step 7: Now comes the most difficult part and the part where it took me almost an hour. In the terminal type: $ make -f Makefile . If it compiles with no errors skip to Step 8. If it doesn’t and has an error like:

gcc -O2 -Wall -static -I …/Dagon -I otherSources -I /usr/include/freetype2 -I /usr/include/lua5.1 -c …/Dagon/DGAudio.cpp -o build/obj/DGAudio.o
In file included from …/Dagon/DGConfig.h:20:0,
from …/Dagon/DGAudio.h:20,
from …/Dagon/DGAudio.cpp:17:
…/Dagon/DGPlatform.h:61:38: fatal error: X11/extensions/xf86vmode.h: No such file or directory
compilation terminated.
make: *** [build/obj/DGAudio.o] Error 1

Don’t freak, you just don’t have the libraries. So, you need: libxxf86vm-dev, libopenal-dev, libogg-dev, libvorbis-dev, libtheora-dev, lua5.1-dev, libfreetype6-dev, libglew1.6-dev. If you don’t have any of them (or have some of them but not all) you’ll need to the ones your missing. So to cover all bases you can type:

$ sudo apt-get install libxxf86vm-dev
$ sudo apt-get install libopenal-dev
$ sudo apt-get install libogg-dev
$ sudo apt-get install libvorbis-dev
$ sudo apt-get install libtheora-dev
$ sudo apt-get install lua5.1-dev
$ sudo apt-get install libfreetype6-dev
$ sudo apt-get install libglew1.6-dev

Note: (For 64-bit computer, you need these below)

$ sudo apt-get install libglew1.6:i386 liblua5.1-0:i386 libogg0:i386 libvorbisfile3:i386 libtheora0:i386

It will ask you for your password and when it prompts for [Y/n] type: y and hit enter. If it says you already have it up to date move on. Once you have done all of these type: $ make -f Makefile again. If it still doesn’t work and gives you an error, make sure you have done everything in this tutorial and check the forums for help.

Step 8: Congrats you made it! You can close the terminal now and in your directory and open it by clicking on it (dagon) in your directory under: build/. Now if you have problems they will appear in the .log file in the same directory. Enjoy.

Note: If you getting a black screen when you start the program and the log says you have a bad config file, you are probably on a 64-bit system; to fix it redo step 7 with the 64-bit step as well.

Great stuff. This should go on the wiki!

Kudos :smiley:

Interesting how-to, however, on Ubuntu 12.04 and newer, there exists a problem with the dependency “libglew1.6-dev”, when you go to download it, it will actually download, “libglew-dev” which has different calls than the 1.6-dev does. I still get the exact error message than it can’t find the “libglew1.6-dev” dependency. Therefore it gives me an error when I try to build.

By the way, to cut down on the instruction you gave people, there is no need to create the build and obj directories, they are created during the make (build) process anyhow.

To download the file you have listed, instead of having multiple lines “sudo apt-get install”, try this instead.

sudo apt-get install libxxf86vm-dev libopenal-dev libogg-dev libvorbis-dev libtheora-dev lua5.1-dev libfreetype6-dev libglew1.6-dev

You highlight it with your mouse and/or keyboard, hit CTRL+C and in terminal hit CTRL+ALT+V to paste that whole line of stuff, then hit ENTER. Enter your password for your current account you’re using and if it asks you if it’s okay to install something, hit ENTER to allow it to.

I think if we were to use a “general” version of this libglew-dev dependency, we’d all be better off, as it’s available for all platforms in this form, including portables and Microsoft Windows, not just Apple Macintosh and Linux.

Canonical is under the assumption that if you’re using Ubuntu 12.04 or great you have OpenGL 2.0 graphics capability or better, however they do have support for the OpenGL 1.2 ~ 1.6 but that only gets loaded if you have that hardware. If you have better, you’re going to have trouble getting the older GL stacks. One of the reasons for this is, the way in which Linux graphics in OpenGL is created is based on what you hardware’s optimum OpenGL capability is. Most Ubuntu 12.04 LTS users have OpenGL 2.0 and higher, at least.

Another problem is this, even if you manage to get the version 1.6 of this dependency on your system and do a build, there is no guarantee it will work on the current drivers of the default installation of this operating system after the build is complete, even if it doesn’t give you any errors.

My current rig I use to do programming and building applications is:

Gigabyte motherboard; GA-MA78GM-US2H
Phenom II x6 1100T
16 GiB RAM PC2-800 MHz (running CL4-4-4-12-16 timing)
On-board ATI-3200 graphics, does OpenGL 3.2 (despite Linux reports it as OpenGL 3.3)
ATI-3200 core is clocked at 950 MHz (default is 500 MHz)
Using a customized and tweaked FGLRX legacy driver that works with Steam Games so I don’t get various errors with Steam related games not supporting various OpenGL calls (when it obviously does).

I have a lot more stats but that’s what’s important, what I’ve just listed.

[quote=“TimeTrx, post:1, topic:602”]How to install/make Dagon on Linux.

Note: Ignore ‘$’ if you copy and paste the commands.

Step 1: Get Dagon .zip file from the github repository. If you don’t have the link -> https://github.com/Senscape/Dagon/archive/master.zip
Step 2: Unzip the file. Click on it and Archive Manager should pop up and should have a file named: Dagon-master or something like it. If it doesn’t (for whatever reason) right click and select Open with Archive Manager.
Step 3: Now you want to extract it, so click: Extract and select where you want it and click Extract (for this example, I going to put in the home folder so it will appear as: home/Dagon-master).
Step 4: Open a Terminal (remember the terminal is your friend).
Step 5: Now you want to get to where you extracted it using: $ cd “your_location_here”. So for example, I put mine right in home so it will be: $ cd Dagon-master/Linux/ .
Step 6 (optional): Make a folder called build: $ mkdir build . And now: $ cd build to go into the folder create another folder and make another folder called obj: $ mkdir obj . Now do: $ cd … to get back to the Linux/ folder. This step could also be done in the GUI instead of the terminal.
Step 7: Now comes the most difficult part and the part where it took me almost an hour. In the terminal type: $ make -f Makefile . If it compiles with no errors skip to Step 8. If it doesn’t and has an error like:

gcc -O2 -Wall -static -I …/Dagon -I otherSources -I /usr/include/freetype2 -I /usr/include/lua5.1 -c …/Dagon/DGAudio.cpp -o build/obj/DGAudio.o
In file included from …/Dagon/DGConfig.h:20:0,
from …/Dagon/DGAudio.h:20,
from …/Dagon/DGAudio.cpp:17:
…/Dagon/DGPlatform.h:61:38: fatal error: X11/extensions/xf86vmode.h: No such file or directory
compilation terminated.
make: *** [build/obj/DGAudio.o] Error 1

Don’t freak, you just don’t have the libraries. So, you need: libxxf86vm-dev, libopenal-dev, libogg-dev, libvorbis-dev, libtheora-dev, lua5.1-dev, libfreetype6-dev, libglew1.6-dev. If you don’t have any of them (or have some of them but not all) you’ll need to the ones your missing. So to cover all bases you can type:

$ sudo apt-get install libxxf86vm-dev
$ sudo apt-get install libopenal-dev
$ sudo apt-get install libogg-dev
$ sudo apt-get install libvorbis-dev
$ sudo apt-get install libtheora-dev
$ sudo apt-get install lua5.1-dev
$ sudo apt-get install libfreetype6-dev
$ sudo apt-get install libglew1.6-dev

Note: (For 64-bit computer, you need these below)

$ sudo apt-get install libglew1.6:i386 liblua5.1-0:i386 libogg0:i386 libvorbisfile3:i386 libtheora0:i386

It will ask you for your password and when it prompts for [Y/n] type: y and hit enter. If it says you already have it up to date move on. Once you have done all of these type: $ make -f Makefile again. If it still doesn’t work and gives you an error, make sure you have done everything in this tutorial and check the forums for help.

Step 8: Congrats you made it! You can close the terminal now and in your directory and open it by clicking on it (dagon) in your directory under: build/. Now if you have problems they will appear in the .log file in the same directory. Enjoy.

Note: If you getting a black screen when you start the program and the log says you have a bad config file, you are probably on a 64-bit system; to fix it redo step 7 with the 64-bit step as well.[/quote]

Here is an update, I did get another copy straight from the GIT mainline and it compiles correctly however now I have a different problem. I would change some stuff but then I don’t know how you accept or deny coding for this Dagon project. I am aware of how to use GIT been using it for a couple years now.

The errors I get are referring to linker errors:

/usr/bin/ld: build/obj/DGSystemUnix.o: undefined reference to symbol ‘[email protected]@GLIBC_2.1
/usr/bin/ld: note: ‘[email protected]@GLIBC_2.1’ is defined in DSO /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [build/dagon] Error 1

While, I could add it, this may cause breakage in someone else’s compile and linking, I am trying to avoid that scenario.

New update, I figured a quick fix that I haven’t pushed to GIT yet is this. If you’re on Linux and are having trouble with pthreads and symbols can’t be read, errors in linking, please change your “Makefile” in the Linux directory to this.

LIBS:= -lXxf86vm -lGL -lGLU -lGLEW -lopenal -llua5.1 -lfreetype -logg -lvorbis -lvorbisfile -ltheora -lm -lX11 -lstdc++ -lpthread

You actually need the “-lphtread” as an included library for this project, not all gcc / g++ installations have that automatically inserted as a system included LIB.

Now, what will happen is this, when it’s done compiling and linking, you then go to the /build/ directory and you will find the “gadon” executable in there.

To start it, to test that it actually works is to type, “./gadon” in terminal without the double-quotes.

I will give this a go with the actual interactive demo for Asylum and see if I run into any bugs.
Note: I am quite aware of all the bugs in the Linux version of this game engine so I will attempt to discern the difference between the engine and the actual game bugs in the correct section in this forum.

Here is an update, I copied the newly created “Dagon” that I built with the new LIB include -lpthread and it now works on Ubuntu 12.04 and above. I would suggest to change this and recompile and link this so that people with Debian and Ubuntu can then use this file to launch the game.

I’m investigating the sound bug people have been talking about on this site, I believe the sound buffer is still too small and it’s also got problems syncronizing with the audio engine and manager. I assume once we hammer out all the warnings and errors, the sound bugs will actually start to disappear, although increasing the size of the audio stream buffer isn’t a bad idea either. Will fiddle with the source a bit to see the optimum setting for it and recompile.

Hey Quantum! As I told you when replying to your email (very detailed and helpful, thank you very much!), I’m confident that the new experimental Dagon will build much better on Linux. In fact, I forgot to mention that I’m supporting Premake instead of plain makefiles now. Should be much easier to support.

As for the audio bug, I’m linking against OpenAL soft now. I’m not sure how this library is resolved on Linux, but it could make a difference. In any case, I agree, the initial audio buffer might be too small.