Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!  (Read 10592 times)

vikisonline

  • Escaped Lunatic
    • View Profile

I use debian wheezy so this guide is mainly for that. However it will work on most debian based distros as well (ubuntu/mint/etc).
It should also work on other distributions if you alter the install commands to that of your distro.

This guide assumes you know what folders are and how to navigate them with cd.

First download dwarf fortress from the website, or phoebus's version:
For extracting the phoebus package:
Code: [Select]
tar xzvf DF_Phoebus_34_11v00_Linux.tar.gz If you downloaded the original package from bay12:
Code: [Select]
tar xjvf df_34_11_linux.tar.bz2
64Bit only instuctions:
If you have 64 bit you need to do the following otherwise skip these:
Code: [Select]
sudo dpkg --add-architecture i386
Code: [Select]
sudo apt-get update
Code: [Select]
sudo apt-get upgrade
Code: [Select]
sudo apt-get install libsdl-ttf2.0-0:i386 ia32-libs-gtk libsdl-image1.2:i386 libopenal-dev:i386
Now in df_linux folder can try to run it with:
Code: [Select]
./dfYou might get this error message: ./libs/Dwarf_Fortress: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

first try running locate if you get an error message we need to install it:
Code: [Select]
sudo apt-get install mlocate
Code: [Select]
sudo updatedb
Now run this command:
Code: [Select]
locate libGL.so.1This should give you a bunch of lines of output, but there will be lines
containing x86_64 and lines containing i386. My output looked like this:
/etc/alternatives/glx--libGL.so.1-x86_64-linux-gnu
/etc/alternatives/nvidia--libGL.so.1-x86_64-linux-gnu
/usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1
/usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1.2
/usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1
/usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1.2
/usr/lib/x86_64-linux-gnu/libGL.so.1
/usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1
/usr/lib/x86_64-linux-gnu/nvidia/current/libGL.so.1


From this we need a i386 (32bit) library file that matches the one in the error message
so for me it is:
/usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1

Now copy this line or write it down.
In the df_linux folder type this in:
Code: [Select]
nano run.shThis is a text editor here you type in the following:
Code: [Select]
LD_LIBRARY_PATH=/usr/lib/mesa-diverted/i386-linux-gnu/ ./dfNOTE: You must replace /usr/lib/mesa-diverted/i386-linux-gnu/ with the path you got above.
ALSO!!!: YOU MUST REMOVE the file name from that path. Originally I had
/usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1 but removing the filename you get
/usr/lib/mesa-diverted/i386-linux-gnu/
if you leave the filename in there it will not work.
Now press ctrl + x
press y
and hit enter
now type this command:
Code: [Select]
chmod +x run.sh
from now on the game will run by typing
Code: [Select]
./run.sh in the df_linux folder, or double clicking on it through some gui.


32bit:
(there is a bug that requires dev openal library for sound)
Code: [Select]
sudo apt-get install libsdl-ttf-gst libopenal-dev
from now the game should run with
Code: [Select]
./df in the df_linux folder or
double clicking on the df file in that folder

OPTIONAL Changes if you used phoebus file:
you can edit df_linux/data/init/init.txt
change:
[SOUND:NO]
to
[SOUND:YES]
and
[INTRO:NO]
to
[INTRO:YES]
These are not necessary of course, but I like them, so its up to you.

DWARF THERAPIST:
same for 32 and 64bit systems:
Code: [Select]
sudo apt-get install mercurial qtcreator build-essential
Code: [Select]
hg clone https://code.google.com/p/dwarftherapist/
Code: [Select]
cd dwarftherapist
Code: [Select]
qmake dwarftherapist.pro
Code: [Select]
make -j2or change the number 2 to be the number of cores you have +1
this will take a long time on slower machines
Code: [Select]
sudo make install
Now you can run
Code: [Select]
dwarftherapist on the command line from
any folder.
« Last Edit: February 19, 2013, 09:01:47 pm by vikisonline »
Logged

human_dictionary

  • Bay Watcher
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #1 on: March 29, 2013, 12:03:41 pm »

hello, im new here, and this is a great guide, but once I installed dwarf therapist, I ran 'dwarftherapist' im terminal, but the window opens and then closes again in less than a second, and im left with this is terminal:
Code: [Select]
sebastian@Ubuntu-Dell:~$ dwarftherapist
/usr/bin/dwarftherapist: line 2: cd: /usr/share/dwarftherapist: No such file or directory
Dwarf therapist needs to run as root because user ptrace is disabled

(process:14539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(process:14539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
QGtkStyle was unable to detect the current GTK+ theme.

(process:14539): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
sebastian@Ubuntu-Dell:~$


have I done something wrong?
Logged

Trif

  • Bay Watcher
  • the Not-Quite-So-Great-as-Toady One
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #2 on: March 29, 2013, 12:19:22 pm »

Seems to be a common problem with Dwarf Therapist in newer versions of Ubuntu. Because DT needs to write in the memory of another program (Dwarf Fortress), the program wants admin (root) rights to do that. Opening it as root would work but isn't very safe.

Try this workaround: http://www.bay12forums.com/smf/index.php?topic=65326.msg1537341#msg1537341
Logged
Quote from: Toady One
I wonder if the game has become odd.

human_dictionary

  • Bay Watcher
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #3 on: March 29, 2013, 12:41:34 pm »

good news: that problem no longer occurs!

bad news: now another one does;
Code: [Select]
sebastian@Ubuntu-Dell:~$ dwarftherapist
/usr/bin/dwarftherapist: line 2: cd: /usr/share/dwarftherapist: No such file or directory
Could not open  "/home/sebastian/log/run.log"  for writing! "Permission denied"
sebastian@Ubuntu-Dell:~$

EDIT: just noticed: dwarftherapist = dwarf the rapist
lol

where did everyone go? anyway, when i run this as root, this happens:
Code: [Select]
root@Ubuntu-Dell:~# dwarftherapist
/usr/bin/dwarftherapist: line 2: cd: /usr/share/dwarftherapist: No such file or directory
root@Ubuntu-Dell:~#
« Last Edit: April 02, 2013, 02:24:22 am by human_dictionary »
Logged

human_dictionary

  • Bay Watcher
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #4 on: April 02, 2013, 04:29:49 am »

bump? is this allowed? I really want some help with this guys  :-\
Logged

Trif

  • Bay Watcher
  • the Not-Quite-So-Great-as-Toady One
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #5 on: April 02, 2013, 04:41:44 am »

I'm afraid I can't help you with the specifics, I don't use Therapist. Maybe the folks in the Dwarf Therapist thread can help you.
Logged
Quote from: Toady One
I wonder if the game has become odd.

uggi

  • Bay Watcher
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #6 on: April 03, 2013, 08:18:14 am »

Code: [Select]
sebastian@Ubuntu-Dell:~$ dwarftherapist
/usr/bin/dwarftherapist: line 2: cd: /usr/share/dwarftherapist: No such file or directory
Could not open  "/home/sebastian/log/run.log"  for writing! "Permission denied"
sebastian@Ubuntu-Dell:~$

First of all the instructions still suggest using the original and outdated DT repository, not Splinterz's. You should change the hq clone command to use https://code.google.com/r/splintermind-attributes/ instead.

Secondly, looks like you ran make install, which copies the files to Armok knows where. You should always review the makefile before running any make install commands, to make sure stuff goes where you want them to go. Or skip it completely and install files manually.

Anyway, it looks to me that it managed to install the shell script and the binary into /usr/bin but failed to install the configuration files into /usr/share/dwarftherapist. So the install process failed for some reason, or it installed half of the stuff somewhere else (consult Armok).

I think you could just try installing the required files manually into /usr/share/dwarftherapist. Create the directory first, as it doesn't seem to exist yet. Then create the etc and log directories under it. Now, where ever the hq clone command downloaded the files for you, you have to find that directory and copy the contents of etc directory into /usr/share/dwarftherapist/etc. You should then have a directory structure like this:

Code: [Select]
/usr/share/dwarftherapist/etc
/usr/share/dwarftherapist/etc/memory_layouts
/usr/share/dwarftherapist/etc/memory_layouts/linux
/usr/share/dwarftherapist/etc/memory_layouts/windows
/usr/share/dwarftherapist/log

If you're running Dwarf Therapist as a normal user, make sure the user has write permissions to the log directory.
Logged

rmblr

  • Bay Watcher
    • View Profile

Heya! I've used a part of your tutorial in my project Dwarf Fortress Bootstrap for Linux. It's a packaging project for Dwarf Fortress to resolve all this maddening issues around getting DF and tools running on Linux. I don't run Debian or Ubuntu myself, so I'd love it if you could test it!


http://www.bay12forums.com/smf/index.php?topic=125817.0
Logged

vikisonline

  • Escaped Lunatic
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #8 on: June 03, 2013, 11:08:55 pm »

Ah sorry guys. I just remembered to check this thread again. I forgot to put it on notify and after a long time of no posts I forgot about it. If any of you still have problems ask away, I'm glad to help.

@rmblr:
If you need any help with that project let me know. I need to figure out how to statically link dwarf therapist, then it could be distributed as a standalone program in a folder without it needing to be installed/compiled by people. It would be bigger but thats a good sacrifice to make.

I also use the ironhelm gpack since it seems to allow me to use truetype fonts in linux as well instead of the hard to read graphics fonts.
Logged

rmblr

  • Bay Watcher
    • View Profile
Re: Linux 32/64bit dwarf fortress and dwarftherapist installation guide!
« Reply #9 on: October 30, 2013, 04:52:18 am »

For Linux users, static compiling a binary with lots of deps (especially qt!) is never the way to go. 

To distribute binary package, the "right" thing to do of course would be to package dwarf therapist for each OS, and host builds on build.opensuse.org or something.  I could do RPM distros if someone did the deb distros. I haven't bothered mostly because I assume most DF linux users are on a debian/ubuntu derivative.
Logged