Results 1 to 10 of 39

Thread: ADOM Sage for Ubuntu, and other distros

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    7

    Thumbs up ADOM Sage for Ubuntu, and other distros

    [May 12, 2009] New version available -- Should compile on most systems, albeit with some warnings
    [April 13, 2010] Hosting change. Sorry.

    I spent a little time this weekend messing around with ADOM Sage from Ubuntu. Due to the age of the Sage code base, it will not compile on most modern systems, and the last official binaries have dependencies on deprecated runtime libraries that aren't present on most systems (and may be difficult to acquire for some).

    I've updated the source code so that it will compile with modern versions of gcc, and built new binaries that link to more recent runtime libraries.

    You will probably still get a warning about an ambiguous 'else' statement, but it seems harmless, and trying to figure out all those nested 'if's just made my head hurt. You're welcome to ferret that one out on your own, if it bothers you .

    Additionally, your compiler may spew warnings about <ext/hash_map> being a deprecated header. I may get around to updating the code to work with the <unordered_map> library instead, but it requires compiling with a (draft) ISO C++ standard. That, in turn, will involve making a lot of other changes to the source in order to get it to compile under the stricter standards. I don't really know my way around gcc or the ISO C++ standards to know how/what all needs to be fixed, but I'll take a look at it and see what I can do. In the mean-time, this will still compile on most systems.

    Pre-compiled Linux Binaries

    adom-sage-0.9.1-2009-05-12.tar.gz

    Required runtime packages: libstdc++6 , ncurses5

    Instructions:
    1. Untar.
    2. Copy adom-sage and adom-sage.so to your ADOM directory.




    Updated Source Code

    Method one - download the updated source tarball:

    adom-sage-0.9.1-2009-05-12-src.tar.gz


    Method two - patch the original 0.9.1 source:

    Original source tarball:
    adom-sage-0.9.1-src.tar.gz (official 0.9.1 source tarball)
    [Edit: looks like the original Sage site is down, perhaps for good. Here's an alternate location:]
    adom-sage-0.9.1-src.tar.gz (archive.org cache)

    adom-sage-0.9.1-2009-05-12.diff (unified .diff patch)

    Unpack the 0.9.1 source. Place the .diff file in the Sage source folder and run:

    Code:
    patch < adom-sage-0.9.1-2009-05-12.diff

    Build Instructions

    Required developer libraries: libstdc++6, ncurses5

    1. Run make.
    2. Copy adom-sage and adom-sage.so to your ADOM directory.





    Detailed Description of Patch/Changelog

    Files affected: adom-sage.h, stl.h, io.cc, library.cc, sage-frontend.cc, spells.cc

    Issues Addressed:
    • Imported the std namespace into stl.h and sage-frontend.cc. This was preventing the code from compiling.
    • Included <cstring> in adom-sage.h and adom-sage.cc. It's probably not necessary to put it on both places, in hindsight, but I was fixing errors in the sequence that they cropped up from gcc, so that's just how it worked out :P
    • Updated the location of the hash_map library (to <ext/hash_map>) and imported the __gnu_cxx namespace in stl.h. This is necessary to compile the code on standard-compliant compilers.
    • Fixed various casts from string literals to char *.
    • Fixed a bad pointer conversion from MouseCookie to mmask_t. MouseCookie is now a type pun for mmask_t, and the cast can safely occur implicitly.
    • Initialized some uninitialized variables in the get_key function of io.cc.
    • Stripped an unused variable (char * padding) from StateCastSpell::vsprintf in spells.cc


    (Note: Yes, I know importing namespaces into header files like that is bad. But the original adom-sage source doesn't appear to have been namespace-aware to begin with, so I'm not especially concerned about polluting namespaces. I'm sure there is a much more elegant solution to all this, but I'm primarily concerned with just getting it to compile.)


    Running the Original 0.9.1 Binaries

    If, for some reason, you would prefer to use the original (official) 0.9.1 binaries, you will probably run into an error about a missing library - libstdc++-libc6.2-2.so.3. This is a "libc compatibility" module from an old version of libstdc++6.

    Ubuntu users (prior to Hardy) can install it with:

    Code:
    sudo apt-get install libstdc++2.10-glibc2.2
    Ubuntu Hardy users will need to download and install it from the Gutsy repositories.

    RedHat users can find it here.
    Last edited by Stathol; 04-13-2010 at 04:55 PM.

  2. #2
    Join Date
    Mar 2008
    Location
    Esslingen, Germany
    Posts
    3,973

    Default

    Man, I never realized using Linux was so simple.
    ADOM Guides - whatever you wanted to know about playing a certain class, but have been afraid to ask!

    Check out my youtube channel to see my ADOM videos, including a completed playthrough of the game. I try to give instructions, so if you want to see some place you haven't been before and get some hints on how to deal with it, this might help! There's also some other games featured there that you might find interesting.

  3. #3
    Join Date
    Nov 2008
    Posts
    7

    Default

    Heh. Fair enough. But this really isn't a Linux problem, per se.

    The problem is the age of the Sage source code and the pre-compiled binaries. Neither have been touched in 6 years, and Linux has made major progress in that time. To put it in perspective, Red Hat has released 12 major versions since the "official" binaries were compiled. This is kind of like trying to get an old Win98 program to run in Vista.

    Long story short, the official binaries link against old, deprecated libraries that aren't usually even installed on modern distros, and the source code is not standard-compliant. It simply won't compile with modern versions of gcc and libstdc++, which are much less forgiving of these problems. A secondary issue is that the code is a bit sloppy in a few places (no offense). It's nothing major, but I figured that while I was in the mood to update the source for modern Linux distros, I might as well make it build clean.

  4. #4
    Join Date
    May 2008
    Location
    Lithuania
    Posts
    4,280

    Default

    And i thought mindcraft is hard to understand. Now i will go into oblivion meant for Microsoft users.

  5. #5
    Join Date
    Nov 2008
    Posts
    7

    Default

    Meh.

    Fine, fine, fine. I'll make this dead simple for Linux. Here's an unofficial binary and source distribution (adom-sage-0.9.1-2008-11-17):

    Edit: Nevermind, this is redundant now. See OP.
    Last edited by Stathol; 11-17-2008 at 10:35 PM.

  6. #6
    Join Date
    May 2008
    Posts
    356

    Default

    I think, the clock on your PC is some 2 days ahead of RWT (rest world time)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •