Thursday, December 16, 2010

How to compile mame in Ubuntu 10.04 Lucid Lynx

UPDATE: A newer guide is available at Compiling Mame on Ubuntu 14.04 Trusty Tahr.

Using the following instructions you should be able to compile Mame on Ubuntu 10.04 Lucid Lynx, though it should also work in most any other version of Ubuntu too.
  1. Download the latest source from http://mamedev.org/release.html Grab the .zip version. The following command will grab the latest source as of the time I wrote this tutorial.
    wget http://mamedev.org/downloader.php?file=releases/mame0140s.zip --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" -O mame_source.zip
    Here we change the user/agent string, because the server is set to prevent robots, like wget, from programmatically downloading the file.
  2. Unzip the file, and then unzip that file. Place it anywhere you like, perhaps your home directory.
    mkdir mame
    unzip mame_source.zip
    unzip mame.zip -d mame
    rm mame.zip
  3. Next we install all the libraries and dependencies necessary to build mame.
    sudo aptitude install build-essential libgtk2.0-dev libgnome2-dev libsdl1.2-dev
  4. Finally, lets get to building it.
    cd mame
    make
  5. Let's setup a rom folder and get some roms.
    mkdir roms
    cd roms
    wget http://mamedev.org/roms/sidetrac/sidetrac.zip --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
  6. Now that we have legally obtained an arcade ROM, let's play it!
    cd ..

Once you know what libraries to install, compiling Mame from source is quite easy in Ubuntu. Drop me a line in the comments if this is helpful, or if you run into any problems or have any suggestions.

Ubuntu Up and Running Book Review

Note: This is a review of the O'Reilly book Ubuntu: Up and Running.  I received this book through O'Reilly's Blogger Review Program.  When I received this book I was already in the middle of Machine of Death, and JavaScript: The Definitive Guide.  So it took me a little longer than I expected to finish this book, and finally, get around to writing this review.
This book touts itself as "A Power User's Desktop Guide."  This rather accurately defines the target audience of the book.  It is not for your average user, but for a technically inclined user who is interested in getting his or her hands dirty with Ubuntu.
This book is very thorough, going step-by-step through each process, often times in what can be grueling detail for someone if such detail is not necessary.  I committed myself to not skipping any parts, and that made some parts of this book very hard to read, as it went through each and every single little click to perform certain tasks.  However, this attention to detail and verbosity probably makes this a very good read for the person who needs to be taken all the way to the finish line to understand the concepts being taught in this book.  This level of detail also makes it a good read for those who may not consider themselves all that technical literate, but are willing to put in the time and effort needed to really learn Ubuntu.  The first chapter of the book introduces the reader to Ubuntu, Linux, and the whole FOSS movement.  It lets the reader know that Ubuntu is more than just an operating system, but it is the leader in a movement that has been fighting the good fight for over thirty years.  After finishing this chapter, the reader should have a good idea of common open source idioms, such as free as in beer versus free as in freedom, and be familiar with some of the leaders in the open source movement including RMS, Torvalds, and Shuttleworth.
With the history out of the way, the second chapter goes into installing Ubuntu.  Here the level of detail this book goes through is revealed.  Installing Ubuntu is a trivial task.  I've given disks to non-technical people, and they where able to get Ubuntu installed without any hand-holding.  However, this book doesn't just cover a vanilla install.  It covers dual-booting, an installing in VirtualBox, and installing through Wubi, as well as upgrading from a previous version.
For each type of install, this book goes step-by-step, screen-by-screen, explaining everything along the way.
I did feel that this book should have stressed the advantages of doing a real hard-disk install over a Wubi or virtual installation.  In my experience the other types of installations provide a significantly reduced experience over a real HD install.
I also felt like there where some areas covered that where really unnecessary, and could give the impression that Ubuntu may be harder to get up and running than it really does.  This includes going over the different Function Key Options.  I feel that for the sake of brevity, and being relevant, these areas could be skipped.  A person who is likely to use these areas of the installer is unlikely to need this book anyhow.
The book then moves on to configuring your installation, and then covers areas of use such as chapters devoted to multimedia, OpenOffice, etc.  I did feel that the order of chapters could have been laid out better.
After getting the user to install Ubuntu, it probably would have been best to have an introduction to the desktop, going over the basic features of the Gnome interface, including the Menu Bar, the different widgets in the top-right, and the default folders in the home folder.  This would make the user comfortable with the basics of Gnome, and would encourage the user to discover the other features, such as web browsing, multimedia, etc. on their own.
I believe Chapter 7, which covers the command line, should have been moved to the back.  It makes more sense, I believe, to cover all the tools that have been developed so that Linux users no longer have to master the command line to perform your usual tasks.  This could help dispel the fear that many users come in with, that if they don't master the command line, then Linux is not for them.
While the true power-user, be they a Linux user, or otherwise, will spend a good deal of time on the command-line, I think it is important to stress to new users that the most important tasks can be performed through point-and-click.
It also would have been helpful if this book had waited for Ubuntu 10.04 to come out, and spent more time focusing on the features of 10.04, since it is an LTS release, and would make this book more relevant over the next three years that this version of Ubuntu will be supported.  10.04 also alleviates some of the problems this book mentions such as the immaturity of the Empathy IM client in Ubuntu 9.10, making the suggestion of trying Pidgin somewhat more mute.  It could have also covered in better the Ubuntu One music store, if it had spent more time focusing on Ubuntu 10.04.  While this book says that it covers Ubuntu 9.10 and 10.04, it really covers 9.10, with some mentions of 10.04 enhancements.
With all that said, I would stay give this a book a "would recommend" as it is very detailed, and can go a long way in taking the interested reader from being interested in Ubuntu, to reasonably well versed in Ubuntu.
The chapter covering the command line is thorough and clear.  In fact, I learned a few things that I didn't about using some CLI tools installed in Ubuntu.
I look forward to future versions of this book covering newer versions of Ubuntu, and hopefully, through the Blogger Review program, is touched up in some of its rough edges.
I already have some friends and acquaintances lined up to borrow this book, as they have an interest in getting their feet a little more wet with Ubuntu.