Results 1 to 10 of 39

Thread: ADOM Sage for Ubuntu, and other distros

Threaded 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 03:55 PM.

Posting Permissions

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