Compiling Slash'em (version 0.0.7E7F3) on MacOS

One of my favorite games from the past is NETHACK and it's variants. The ASCII game proves that you really don't need heavy graphics and sound to produce something that's really fun.

Unfortunately, there's not much documentation on it for Mac, and the versions I've found all have stupid graphics that ironically make the game LESS fun.

If you really want the ASCII experience, you should compile this from source yourself.

Precompiled binaries are here. Download and extract under /usr/local as root.

If you download the binaries, MAKE SURE you know what you are doing. Also understand we're not responsible for any problems this may cause.

If you want to build this yourself, here are the steps that I used to get this working. The procedure should work for All variants of NETHACK and should work on all versions of MacOS/OSX... but I tested this on MacOS Monterey

  • Install Xcode command line tools. If you don't have it, just open a terminal session and type "git". This will auto-install the tools.
  • Install GCC-11.3/gmp/mpfr/mpc from source. A link to do so is provided here: You can compile your own version of gcc OR just download it from that page.
  • Install ncurses 6.4 from here: You can also just download the files from that page an untar into /usr/local/ncurses.
  • Download the Slashem source from http://prdownloads.sourceforge.net/slashem/se007e7f3.tar.gz?download
  • Once you grab the TGZ file extract (tar -zxf se007e7f3.tar.gz)
  • cd to the sys/unix directory (cd slashem-0.0.7E7F3/sys/unix)
  • run setup.sh (sh +x setup.sh)
  • move up 2 levels (cd ../..)
  • edit the top level Makefile and change the following:
    • GAMEDIR=$(PREFIX)/local/games/slashemdir.
    • SHELLDIR=$(PREFIX)/local/games/bin
    • This will install the files under /usr/local/games/slashemdir)
  • edit the file sys/share/ioctl.c find the line which says "#undef USW_WIN_IOCTL" (should be line 97) and add the following BELOW IT
    • #undef USE_WIN_IOCTL
  • edit the file win/tty/termcap.c find the line which says "extern char *tparm();" (should be line 964) and comment it out e.g. "/* extern char *tparm(); */"
  • edit the file src/Makefile and uncomment the -lcurses line and comment out the following (line 339 and 340)
    • WINTTYLIB = -lncurses
    • # WINTTYLIB = -ltermlib
  • set CFLAGS and LDFLAGS to the following (assuming ncurses is installed under /usr/local/ncurses)
    • export LDFLAGS="-L/usr/local/ncurses/lib -L/usr/local/gcc11/lib"
    • export CFLAGS="-I/usr/local/gcc11/include/c++/11.3.0/parallel -I/usr/local/gcc11/lib/gcc/x86_64-apple-darwin18.7.0/11.3.0/include -I/usr/local/gcc11/include/c++/11.3.0 -I/usr/local/gcc11/include/c++/11.3.0/x86_64-apple-darwin18.7.0 -Wno-error=int-to-pointer-cast -Wno-error=implicit-function-declaration"
  • run "make"
  • when the build finishes, run "make install (as root)" all files should be installed under /usr/local/games/slashem. You may get errors that the install will try to chown the files to user games (which does not exist) but this can be ignored.
  • Once done, a directory listing of /usr/local/games should show:
    • Trantor-Falls:slashem-0.0.7E7F3 jchung$ ls -l /usr/local/games
      total 0
      drwxr-xr-x  2 jchung  wheel  64 Mar 25 13:56 bin
      drwxr-xr-x  3 jchung  wheel  96 Mar 25 13:56 slashemdir

  • Create a symlink to the /usr/local/games/bin/slashem to /usr/local/bin

    • ln -s /usr/local/games/bin/slashem /usr/local/bin/slashem

  • Start slashem by typing /usr/local/bin/slashem

I got a wish on the first level, and wished for a +3 runesword named Stormbringer. This killed my pet immediately.