ADOM & JADE Forums

Go Back   ADOM & JADE Forums > Ancient Domains Of Mystery (ADOM) > General ADOM discussion
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

General ADOM discussion Discuss everything related to ADOM.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2008, 05:17 AM
Stathol Stathol is offline
Junior Member
 
Join Date: Nov 2008
Posts: 7
Stathol is on a distinguished road
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.
Reply With Quote
  #2  
Old 11-17-2008, 11:11 AM
Silfir Silfir is offline
Ancient Member
 
Join Date: Mar 2008
Location: Esslingen, Germany
Posts: 2,722
Silfir is on a distinguished road
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 for ADOM videos, complete with thick German accent.

Classes I haven't scored a victory with yet: Mindcrafter, Assassin, Healer, Bard. On the home stretch?
Reply With Quote
  #3  
Old 11-17-2008, 06:39 PM
Stathol Stathol is offline
Junior Member
 
Join Date: Nov 2008
Posts: 7
Stathol is on a distinguished road
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.
Reply With Quote
  #4  
Old 11-17-2008, 06:56 PM
Soirana Soirana is offline
Ancient Member
 
Join Date: May 2008
Location: Lithuania
Posts: 2,207
Soirana is on a distinguished road
Default

And i thought mindcraft is hard to understand. Now i will go into oblivion meant for Microsoft users.
Reply With Quote
  #5  
Old 11-17-2008, 07:45 PM
Stathol Stathol is offline
Junior Member
 
Join Date: Nov 2008
Posts: 7
Stathol is on a distinguished road
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 09:35 PM.
Reply With Quote
  #6  
Old 11-17-2008, 10:58 PM
Evil Knievel Evil Knievel is offline
Ancient Member
 
Join Date: May 2008
Posts: 309
Evil Knievel is on a distinguished road
Default

I think, the clock on your PC is some 2 days ahead of RWT (rest world time)
Reply With Quote
  #7  
Old 11-17-2008, 11:41 PM
Stathol Stathol is offline
Junior Member
 
Join Date: Nov 2008
Posts: 7
Stathol is on a distinguished road
Default

Quote:
Originally Posted by Evil Knievel View Post
I think, the clock on your PC is some 2 days ahead of RWT (rest world time)
Hmmm...how so? You might be looking at the date of one the original source files. They happen to all be dated Nov. 20, 2002.
Reply With Quote
  #8  
Old 11-18-2008, 11:53 AM
vogonpoet vogonpoet is offline
Ancient Member
 
Join Date: May 2008
Posts: 1,385
vogonpoet is on a distinguished road
Default

well, there is a chace I will be making the change over to Linux at some point in not too distant future, so I for one appreciate your efforts Stathol. Nice one.
Reply With Quote
  #9  
Old 11-18-2008, 01:42 PM
Soirana Soirana is offline
Ancient Member
 
Join Date: May 2008
Location: Lithuania
Posts: 2,207
Soirana is on a distinguished road
Default

Don't take my irony to deep. It was meant more for Linux, not your efforts.
Although i use Linux for one strict purpouse - as an autobooting system CD to extract windows passwords, which are believed to be protected by mine system admin.
Reply With Quote
  #10  
Old 11-18-2008, 03:30 PM
Grey Grey is offline
Ancient Member
 
Join Date: Mar 2008
Location: Manchester, England
Posts: 3,821
Grey is on a distinguished road
Send a message via AIM to Grey
Default

Wow, thanks a lot for this. I've been trying for some time to get ADOM Sage to rn on my Eee PC - this solves everything.

Silfir, it may look complex, but that's because Stathol has included a lot of details that are unnecessary for most. All any normal person needs to do is download his updated source and run the makefile.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 03:08 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.