compiling mudlet - my experience (with notes)

Post Reply
Shota
Posts: 29
Joined: Tue Sep 21, 2010 5:21 am

compiling mudlet - my experience (with notes)

Post by Shota »

NOTE! The steps I followed in this post are more-or-less correct. Some could be more, some could be less, and some of it could be entirely irrelevant already. The important thing here is the demonstration of the compiling process and solving dependency errors. For a well-maintained, current guide on compiling Mudlet for Ubuntu, see this post

Canonical officially released Ubuntu 10.10 yesterday. I decided to check it out and thought that this would be a good time to compile the newest snapshot of Mudlet available in the Git repository. (mudlet-1d5e15c.tar.gz)

I've noticed some discrepancies between the compile instructions on the Mudlet website (http://make.mudlet.org/compiling-mudlet-on-linux/), instructions found in the forums (http://forums.mudlet.org/viewtopic.php?f=5&t=1654), and feedback from users on the forums who have attempted to compile Mudlet on similar systems (specifically Ubuntu.) Documentation of my experience follows; hopefully we can clear that up!

Step #1 - Installing Dependencies
  • As per the linux instructions found on the website, I began with build-essentials. In a terminal:

    sudo apt-get install build-essential
  • Fetched, installed, finished as expected.

    sudo apt-get install libqscintilla2-dev
    It gets interesting:
    The following NEW packages will be installed:
    libaudio2 libdrm-dev libgl1-mesa-dev libglu1-mesa-dev libkms1 libmng1
    libmysqlclient16 libphonon4 libpthread-stubs0 libpthread-stubs0-dev
    libqscintilla2-5 libqscintilla2-dev libqt4-dbus libqt4-declarative
    libqt4-designer libqt4-dev libqt4-help libqt4-network libqt4-opengl
    libqt4-opengl-dev libqt4-qt3support libqt4-script libqt4-scripttools
    libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-test libqt4-xml
    libqt4-xmlpatterns libqtcore4 libqtgui4 libqtwebkit-dev libqtwebkit4
    libx11-dev libxau-dev libxcb-shape0 libxcb-xv0 libxcb1-dev libxdmcp-dev
    libxine1 libxine1-bin libxine1-console libxine1-misc-plugins libxine1-x
    mesa-common-dev mysql-common phonon phonon-backend-xine qt4-qmake
    x11proto-core-dev x11proto-input-dev x11proto-kb-dev xtrans-dev
    • libqt4-dev has been selected, but we also need libqt4-dev-tools
    • qt4-qmake is what we will be using instead of cmake, but I didn't expect to get it here
    • libqt4-opengl-dev was selected here. This is odd because Vadi mentions in his post that he needed to install this before compiling the latest git snapshot. According to these directions, he should have already had it
    • (It's possible that it wasn't listed as a dependency for this package when Vadi previously compiled Mudlet. Perhaps this is a change specific to Maverick (Ubuntu 10.10))
    • sudo apt-get install lua5.1 liblua5.1-0-dev
    • Fetched, installed, finished as expected. Looks like Lua is behind a version or two.
    • [i]sudo apt-get install qt4-dev-tools[/i]
    • Fetched, installed, finished as expected. *Grabbed qt4-designer, previously selected package during the installation of libqscintilla2
    • [i]sudo apt-get install libpcre3-dev[/i]
    • Fetched, installed, finished as expected.
    • Now, that finishes off the dependencies listed on the website. However, according to Vadi's post, we are potentially still missing [b]nvidia-current-dev[/b] and [b]libboost1.40-dev[/b]. For now, I think I'll proceed without trying them to confirm. (If we're betting, I put my money on the nvidia package not being required and the compile breaking on a call to boost.) [b]Step #1.B - Install QT SDK[/b] [i]wget http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86-opensource-2010.05.1.bin chmod u+x qt-sdk-linux-x86-opensource-2010.05.1.bin ./qt-sdk-linux-x86-opensource-2010.05.1.bin[/i]
    • On a 64-bit machine, you'll want to use the 64-bit version of the SDK from http://get.qt.nokia.com/qtsdk/qt-sdk-li ... 0.05.1.bin
    • [u][b]Step #2 - Get the Git (I'm so lame)[/b][/u] I took the snapshot from http://mudlet.git.sourceforge.net/git/gitweb.cgi?p=mudlet/mudlet;a=snapshot;h=HEAD;sf=tgz
    • I used this fancy little Gnome archive manager to open the file (it did this by default) and then extracted it (by dragging and dropping) to my home folder, which is something a lot like /home/joseph on my system
    • Then I right clicked the folder and renamed it to 'mudlet' because HEAD-mudlet-1d5e15c is not nice to work with in a terminal
Step #3 - Compile
You need to use the version of qmake installed with the QT SDK by calling qmake from the SDK's path.
cd mudlet
/home/joseph/qt-sdk/qt/bin/qmake
... (no output from qmake -at all-, I hope that's a good sign!)
make


Errors! Yay!
g++ -c -pipe -O2 -O3 -w -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/include/lua5.1 -I/usr/X11R6/include -Itmp -I. -o tmp/TConsole.o TConsole.cpp
In file included from TConsole.h:36,
from TConsole.cpp:24:
ctelnet.h:29: fatal error: zlib.h: No such file or directory
compilation terminated.
make: *** [tmp/TConsole.o] Error 1
Okay, 1 error. That's not too bad. Let's see if I can't sort this out. I do a quick search on google, terms "ubuntu package zlib"; directed to package.ubuntu.com where I select maverick as my 'buntu version, and voila, I find the packages zlib1g-dev and zlib1g-dbg. I'm not sure which exactly I need so I elect for both.
sudo apt-get install zlib1g-dbg zlib1g-dev
..fetched, installed, finished as expected.. Following up in my terminal with:
make
and compilation resumes right where we left off. At least until we run into this:
In file included from TMap.h:36,
from Host.h:52,
from TCommandLine.h:32,
from TConsole.h:37,
from TConsole.cpp:24:
TAstar.h:3: fatal error: boost/graph/astar_search.hpp: No such file or directory
compilation terminated.
make: *** [tmp/TConsole.o] Error 1
Hey guys, remember when I made that bet about boost? Let's see if I win the money.
sudo apt-get install libboost1.40-dev
(Hmm, it 'suggested' a lot of other packages I'm guessing we don't need them so we'll ignore them for now and find out!)
make
... (time elapse for slow ass compiling to take place) ...
...
... (seriously, I'm eating a bowl of cheerios, the honey-nut kind. It -is- 6:00am now. I started downloading Ubuntu 10.10 at 1:12am)
....
/usr/bin/ld: cannot find -lyajl
collect2: ld returned 1 exit status
make: *** [mudlet] Error 1
I'm too tired for another error, but it looks like we're missing yet another JSON library. (LOL! I -really- am lame.) Should be an easy fix, but I really am too tired to bother finding exactly which yajl package is required, so lets try:
sudo apt-get install libyajl1 libyajl-deb libyajl1-dbg
followed by another
make

SUCCESS!

Let's try running mudlet by doing:
./mudlet in the src directory (/home/joseph/mudlet/src for me)

It works! Client runs, though on connecting to Achaea, Mudlet reports that it couldn't locate rex_pcre (a lua error). I have rex_pcre installed, so it must be a path issue?

I hope this is useful to somebody. Concise summary of required instructions will follow in next post.

Cheers.
Last edited by Shota on Mon Oct 11, 2010 10:01 pm, edited 2 times in total.

Shota
Posts: 29
Joined: Tue Sep 21, 2010 5:21 am

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Shota »

A cleaner, more concise set of instructions for compiling Mudlet on Ubuntu came about as a result of my testing in the first post.

This can be found here!

Note: The guide found in that post will always be kept as up-to-date as possible.
Last edited by Shota on Mon Oct 11, 2010 8:22 pm, edited 6 times in total.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Heiko »

Please note that you need to link Mudlet against the qt-sdk, otherwise you will have strange behaviour and/or random crashes. For more information see: http://forums.mudlet.org/viewtopic.php?f=5&t=474#p1123

Upcoming git updates will get rid of the need to link against the SDK, but currently you cannot do without it.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Vadi »

Heh, great report. I'll update the instructions with yours.

Edit: except I removed scintilla. We don't use it anymore.

Shota
Posts: 29
Joined: Tue Sep 21, 2010 5:21 am

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Shota »

@Vadi: Thanks.

@Heiko: I intentionally skipped this part since my last experience with the QT libs was so bad. Could you be more specific about what needs to be downloaded, and how it needs to be linked?

qt.nokia.com lists a lot of different packages for download and some of them are very large. It would be nice to know more specifically what I'm looking for off that site, as it's rather cluttered and I don't want to waste time downloading things I don't need.

Did you mean the QT Nokia SDK 1.0.1 found on http://www.forum.nokia.com/info/sw.noki ... t_SDK.html?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Vadi »

You want the stuff on the right side: http://qt.nokia.com/downloads/downloads#lgpl

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Heiko »

Linux 32 bit: http://qt.nokia.com/downloads/sdk-linux-x11-32bit-cpp
Linux 64 bit: http://qt.nokia.com/downloads/sdk-linux-x11-64bit-cpp

Those are binary installers. Install the SDK to your home directory. It will not affect your system qt libs in any way.
To link against the SDK libs simply use qmake from the sdk instead of your system qmake.That will create a makefile that links against the SDK libs. You find the sdk qmake somewhere in the sdk folders under sdk_path/qt/bin/qmake (I don't remember the path exactly). Then you continue with make and you're done.

In any case, your compile howto is nice and it will be fully applicable as of my next commit - though this can take a few days. I'll delete the sdk reminder if the new commit proves to do away with the various qt version problems across distros.

Shota
Posts: 29
Joined: Tue Sep 21, 2010 5:21 am

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Shota »

@Heiko: Thanks for the clear instructions. I've updated both posts - but of particular interest is the second which I think is now a reasonably easy-to-follow and concise guide for compiling Mudlet on Ubuntu, start to finish.

I'm rather hoping a thorough reading of my first post can help some of those who are much less experienced with building and dealing with errors. I remember what it's like to hit a wall of errors trying to compile something; it can be overwhelming. My hope is that by showing some simply problem-solving skills applied to this process, more people will be open to adopting Mudlet and compiling it on their native OS.

Shota
Posts: 29
Joined: Tue Sep 21, 2010 5:21 am

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Shota »

If you guys want to split the second post to it's own topic and sticky it in the 'How-To' forum or wherever you think it belongs, I will maintain updates on it as newer snapshots are released, Ubuntu specific bugs are encountered, etc.

I think maintaining up-to-date compile instructions for Ubuntu is a small thing I could do to contribute to Mudlet development.

The first post is pretty clearly something I wrote half-asleep in the middle of the night.
Last edited by Shota on Mon Oct 11, 2010 8:17 pm, edited 1 time in total.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Ubuntu 10.10 fresh install - Mudlet HEAD snapshot compile

Post by Vadi »

Feel free to copy it over into a new Howto in the forum.

Post Reply