Help me learn how to compile Vulture-Nethack-3.6.6?


Grench

Forum Addict!
Joined
Oct 3, 2008
Messages
6,629
Okay, so I started digging into what it would take to get Vulture-Nethack-3.6.6 compiled to run on the Pyra. I have never compiled anything - but would like to learn the process.

Vulture is an isomorphic interface / overlay for Nethack. Although the source code is distributed freely on the author's website for people to compile their own on alternate systems, distribution of compiled versions is forbidden. Nice compromise IMHO. This means that with a proper walk-through of the compilation process for -this- game, we could play it on our Pyras.

On a side note, I -have- purchased the $2.99 X86 Steam version of the game - and would recommend that anyone who ends up following through and compiling their own working copy do the same.

The author's website:

The source code repository:

So, would anyone have time to create a step-by-step of "How to compile Vulture-Nethack-3.6.6 on the DragonBox Pyra"?

Thanks!
 
Really short to-do list:
1. Find requiments for compiling
2. Setup envrioment
3. Get code from github
4. Look into directories searching for instructions
5. start compiling and find out what is missing, install needed libraries, in this case i have to install libsdl[-XXXXXX]1.2-dev, bison, flex, libncurses-dev, but maybe more in your system. ([-XXXXXX] is to replaces by image, mixer, usw.)
6. And bet that all runs.

I would first try to compile on a normal x86 Linux (Debian), this is much faster to find out what is needed for the compilation and the newly acquired knowledge can then be transferred to the Pyra later.

Thomas

PS.: Compiling works, but linking, this is a step after compling all source files into object files, throws an error, i have to dig into.
 
Last edited:
Not the most user friendly thing but here:

Need the following requirements: SDL 1.2 / SDL Mixer 1.2 / SDL TTF 1.2 (All the -dev variants)

Go to the win/vulture folder and type:
make -f GNUmakefile VARIANT_NAME=nethack VARIANT_VERSION=3.6.0

It should work after that. If it complains about pm.h then that's something else :)
 
Ok, thats an other way, in "sys/unix/README.linux" you have todo these steps:
Code:
cd sys/unix/
sh ./setup.sh hints/linux
cd ../..
make all
But it stops with an error
Code:
usr/bin/ld: -r and -pie may not be used together
i'm stuck on it at the moment, has todo with some gcc flags.

But this is normal "trial and error" at this stage, compiling sources from the wild ;)
 
Last edited:
Mhm, stranger and stranger

I can't find out, why "-r" and "-pie" passed from ggc to linker, so i create (not realy, I stole it from the internet) a wrapper ld - script, which removes the "-r" parameter from arguments list and passed the rest to the renamed linker.
Code:
#!/bin/bash
declare -a finalopts
finalopts=()

for o in "$@"; do
    if [ "$o" = "-r" ] ; then
        continue
    fi

    #add all other options to the list
    finalopts+=("$o")
done

exec "/usr/bin/ldx" "${finalopts[@]}"

And it works, but now it want link against glibc "2.2.5", which is not installed on my system.

Another step in a long way :)
 
It claims in the older instructions set that it actually requires glibc 2.3.2, in sys/unix/readme.linux. I can't immediately find where this is defined however, I've looked so far in makefile.top and makefile.src; these seem to be concatenated together after being preprocessed by the setup.sh script.
 
I have not found a place in the source code where a glib version is defined. Only that the version must be >= 2, nothing more.

@Grench: Why did you have to suggest this project? :D
 
I have not found a place in the source code where a glib version is defined. Only that the version must be >= 2, nothing more.

@Grench: Why did you have to suggest this project? :D

Because on the Pandora, Vulture was a very low compute yet fun Nethack game that would get ~12 hours of battery life while playing. So, we had the -then- equivalent running on the Pandora - and it was pretty darn awesome.

Why don't I just play the good old ASCII terminal based Nethack instead? (It is in the Debian repository.) It is pretty much unplayable on the Pyra - symbols are way too small for my old eyes on our high res screen (I tried) and the player character @ symbol doesn't even show up on the screen. Also, text based Nethack is visually - uninteresting by comparison to Vulture Nethack.

So - sorry if I opened a can of worms. I had hoped that this would have been an 'easy' one where a quick tutorial could be written up to enable novices like me to compile and run it on our own. I had no idea it was going to be complicated.
 
The few projects I have ported/compiled, it was a matter of finding how to compile, dig into the errors in the source code or the detect required libraries, but that the linker wants to use a different GLIBC, that has only happened to me when cross compiling.

I had no idea, I have to read more or our local porter hero @ptitSeb have a hint?

Thomas
 
Last edited:
I haven't looked at this particular sources. This kind of error happens when the makefile use a link script. Usualy, just getting rid of the script can be enough, but it really depends what is inside that. If you are still stuck, tell me, I'll have a look at the source and check how to build it.
 
Since you have the sources cloned to your disc, perhaps it would be most effective it you were to run grep inside /sys/unix:
Code:
cd sys/unix
grep -ri gconv *
There may be better targets to search for, I'm not sure. glibc is a slightly weird package, packaging up loads of utlis and bits of libraries, and there doesn't seem to be a path which includes the package name and version to suggest a standard way in.
 
"grep -ri gconv * " shows nothing.

I can't help you compile this, sorry. I have not found any, for me, useful documentation on how to get the linker script. I can't write my own linker script, my knowledge is too limited for that.

Thomas
 
The error is:
Code:
/home/thomas/Projekte/Games/Vulture-NetHack-3.6.6/win/vulture
g++ -Wall -g -I /opt/local/include -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DUSE_SDL_SYSCALLS -g3 -Wall -DVULTURE_NETHACK -DVULTURE_NETHACK_3_6_0 -I ../../include/  -I . -I build_nethack_3_6_0/ -c build_nethack_3_6_0/vulture_tileconfig.lexer.cpp -o build_nethack_3_6_0/vulture_tileconfig.lexer.o
combining objects to build_nethack_3_6_0/vulture.o
/usr/bin/ld: build_nethack_3_6_0/vulture_tileconfig.lexer.o: undefined reference to symbol 'getc@@GLIBC_2.2.5'
/usr/bin/ld: //lib/x86_64-linux-gnu/libc.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Installed GLIBC: 2.28-10 (Debian, buster)

Same error happens on Pyra, only it wants 'getc@@GLIBC_2.2.4'.

The original "nethack 3.6.6" which has the same compiling steps, compiles and linked without problems.

Thomas
 
Last edited:
So, I give it run. I got it compiled, but I have no clue how to run it, so I leave this to you (too lazy to search).
The source is not using traditionnal autotools or cmake or other build system. It use it's own Makefile based build system.
I based my build on the linux-x11 build, feel free to adapt if it's not the one you wanted.
First, install some dev. packages:
Code:
sudo apt update && sudo apt install libx11-dev libsdl1.2pyra-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libxaw7-dev libxt-dev
Then, from the root of the git clone, create sys/unix/hints/pyra file and copy/paste this inside:
Code:
#
# NetHack 3.6  linux-x11 $NHDT-Date: 1566346602 2019/08/21 00:16:42 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.24 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed.  See license for details.
#
#-PRE
# Linux hints file
# This hints file provides a single-user x11 build for Linux, specifically
# for Ubuntu dapper.


#PREFIX=/usr
PREFIX=$(wildcard ~)/nh/install
HACKDIR=$(PREFIX)/games/lib/$(GAME)dir
SHELLDIR = $(PREFIX)/games
INSTDIR=$(HACKDIR)
VARDIR = $(HACKDIR)


POSTINSTALL= cp -n sys/unix/sysconf $(INSTDIR)/sysconf; $(CHOWN) $(GAMEUID) $(INSTDIR)/sysconf; $(CHGRP) $(GAMEGRP) $(INSTDIR)/sysconf; chmod $(VARFILEPER$POSTINSTALL+= bdftopcf win/X11/nh10.bdf > $(INSTDIR)/nh10.pcf; ( cd $(INSTDIR); mkfontdir -x .lev );

CFLAGS=-g -O2 -mcpu=cortex-a15 -mfpu=neon -mfloat-abi=hard -marm -fsigned-char -fuse-ld=gold -fuse-linker-plugin -I../include -DNOTPARMDECL
CFLAGS+=-DSYSCF -DSYSCF_FILE=\"$(HACKDIR)/sysconf\"
CFLAGS+=-DCOMPRESS=\"/bin/gzip\" -DCOMPRESS_EXTENSION=\".gz\"
CFLAGS+=-DX11_GRAPHICS -DDEFAULT_WINDOW_SYS=\"X11\" -DNOTTYGRAPHICS
CFLAGS+=-DDUMPLOG
CFLAGS+=-DCONFIG_ERROR_SECURE=FALSE

LINK=$(CC)

WINSRC = $(WINX11SRC)
WINOBJ = $(WINX11OBJ)
WINLIB = $(WINX11LIB)

VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm

WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11

CHOWN=true
CHGRP=true
VARDIRPERM = 0755
VARFILEPERM = 0600
GAMEPERM = 0755

# Use XPM format tile file
CFLAGS+=-DUSE_XPM
WINX11LIB+=-lXpm
VARDATND+=rip.xpm

# note: needs libxt-dev libxaw7-dev libx11-dev bdftopcf

It's basicaly just the linux-x11 one with specific pyra flags.
Now, I got 2 issues building: 1. is that the flags are not used in many build command, so 2. There is a strange command to create a ".o" from other ".o" instead of using a static library
So I hacked some other source file to fix those problems
Apply this diff:
Code:
diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src
index 9b3563622..ad60e30c6 100644
--- a/sys/unix/Makefile.src
+++ b/sys/unix/Makefile.src
@@ -179,8 +179,8 @@ else
        SDL_CONFIG = sdl-config
        SDLMAIN = -lSDLmain
 endif
-VULTURECFLAGS = -Wall -g -I /opt/local/include
-CFLAGS = -g -I../include -I ../win/vulture $(shell $(SDL_CONFIG) --cflags) -DVULTURE_NETHACK -DVULTURE_NETHACK_3_6_0
+VULTURECFLAGS = -Wall -g -O2 -mcpu=cortex-a15 -mfpu=neon -mfloat-abi=hard -marm -fsigned-char -fuse-ld=gold -fuse-linker-plugin -I /opt/local/include
+CFLAGS = -g -O2 -mcpu=cortex-a15 -mfpu=neon -mfloat-abi=hard -marm -fsigned-char -fuse-ld=gold -fuse-linker-plugin -I../include -I ../win/vulture $(shell $(SDL_CONFIG) --cflags) -DVULTURE_NETHACK -DVULTURE_NETHACK_3_6_0
 #LFLAGS =

 # The Qt and Be window systems are written in C++, while the rest of
@@ -223,7 +223,7 @@ WINCURSESOBJ = cursmain.o curswins.o cursmisc.o cursdial.o cursstat.o \
        cursinit.o cursmesg.o cursinvt.o

 # object for a Vulture's Eye port
-WINVULTUREOBJ = ../win/vulture/build_nethack_3_6_0/vulture.o tile.o ../win/vulture/build_nethack_3_6_0/theoraplay.o
+WINVULTUREOBJ = ../win/vulture/build_nethack_3_6_0/vulture.a tile.o ../win/vulture/build_nethack_3_6_0/theoraplay.o
 #
 # files for an X11 port
 # (tile.c is a generated source file)
@@ -310,7 +310,7 @@ else
 endif

 # SDL libraries for Vulture's Eye
-WINVULTURELIB = `$(SDL_CONFIG) --libs` $(SDLMAIN) -lSDL_mixer  -lSDL_ttf -lpng -lz -logg -lvorbis -ltheoradec -lpthread
+WINVULTURELIB = `$(SDL_CONFIG) --libs` $(SDLMAIN) -lSDL_mixer  -lSDL_ttf -lpng -lz -logg -lvorbis -ltheoradec -lpthread -lstdc++
 ifeq ($(OS),Darwin)
        WINVULTURELIB += -lstdc++
 endif
@@ -624,7 +624,7 @@ objects.o:
        $(CC) $(CFLAGS) -c objects.c
        @rm -f $(MAKEDEFS)

-../win/vulture/build_nethack_3_6_0/vulture.o: objects.o monst.o ../include/date.h ../win/vulture/*
+../win/vulture/build_nethack_3_6_0/vulture.a: objects.o monst.o ../include/date.h ../win/vulture/*
        @$(MAKE) -C ../win/vulture/ VARIANT_NAME=nethack VARIANT_VERSION=3.6.0 BASECFLAGS="$(VULTURECFLAGS)"

 ../win/vulture/build_nethack_3_6_0/theoraplay.o: ../win/vulture/vendor/theoraplay/theoraplay.c
diff --git a/win/vulture/GNUmakefile b/win/vulture/GNUmakefile
index 85dd2a697..b3ce7387a 100644
--- a/win/vulture/GNUmakefile
+++ b/win/vulture/GNUmakefile
@@ -25,9 +25,8 @@ VARIANT_NAME_UPPER := $(shell echo $(VARIANT_NAME)|tr a-z A-Z)
 CFLAGS += -DVULTURE_$(VARIANT_NAME_UPPER)
 CFLAGS += -DVULTURE_$(VARIANT_NAME_UPPER)_$(VARIANT_VERSION_CLEANED)

-
 # build target
-OUTPUT_OBJ := $(BUILDDIR)/vulture.o
+OUTPUT_OBJ := $(BUILDDIR)/vulture.a


 NHDIR := ../..
@@ -59,7 +58,8 @@ all: $(OUTPUT_OBJ)

 $(OUTPUT_OBJ): $(VOBJ)
        @echo combining objects to $@
-       @$(CXX) -nostdlib -Xlinker -r $(VOBJ) -L /tmp/libstdcxx/lib64 -lstdc++ -o $(OUTPUT_OBJ)
+       $(AR) rcs $(OUTPUT_OBJ) $(VOBJ)
+       #@$(CXX) -nostdlib -Xlinker -r $(VOBJ) -L /tmp/libstdcxx/lib64 -lstdc++ -o $(OUTPUT_OBJ)

 $(BUILDDIR)/vulture_tileconfig.parser.cpp $(BUILDDIR)/vulture_tileconfig.parser.h: vulture_tileconfig.parser.y
        @echo generating parser

After that, it's ready
Just use
Code:
cd sys/unix/ && sh setup.sh hints/pyra && cd ../../
To create the makefiles
and
Code:
make
to Build.
After a short while, you'll have your binary in src/vulture-nethack-3.6.6
 
@ptitSeb, thanks again for your work. Got an error on compiling, i have to install the libtheora-dev library, but that was easy.

When I call "make install", i got many errors that I don't have permission, even as root :D. It tries to install files into "/" - root directoy. The installation has an complicated variable directory definition system and I think, it even lacks the initialisation of the INSTDIR variable, but that may be due to my low Makefile knowledge.

After try and error, now i have a startable pyra version, but crashed with an error after input character name, with "Dungeon description not valid." grrrr

Thomas
 
Last edited:
Back
Top