Getting the source for the current Chengband release?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Therem Harth
    Knight
    • Jan 2008
    • 926

    Getting the source for the current Chengband release?

    Chengband releases are currently made available only for Windows. I figured that I could clone the hg repo and then checkout the current release, but 'hg tags' shows this:

    Code:
    tip                              165:5d6beb92a736
    Version-0.0.36                   121:fca8e584c115
    Version-0.0.35                   119:6ab730e2f3d8
    Version-0.0.34                   117:82440c22e969
    Version-0.0.33                   114:6a7b530ec3be
    Version-0.0.32                   111:8c99d011c451
    Version-0.0.31                   109:a2b08618d373
    Version-0.0.30                   107:1227923b88a9
    Version-0.0.29                   105:76ac09d2783a
    Version-0.0.28                   103:50455b1a3e75
    Version-0.0.27                    99:7ee926dec67b
    Version-0.0.26                    93:ada75a686874
    Version-0.0.25                    90:ed066dcfe40d
    And the current release is 0.0.67. Furthermore tip doesn't even compile on Linux/x86:

    Code:
    birth.o: In function `get_extra':
    /home/proteus/Games/chengband/src/birth.c:3248: undefined reference to `s_info'
    /home/proteus/Games/chengband/src/birth.c:3267: undefined reference to `s_info'
    classes.o: In function `get_class_t_aux':
    /home/proteus/Games/chengband/src/classes.c:22: undefined reference to `blood_mage_get_class_t'
    cmd1.o: In function `py_attack_aux':
    /home/proteus/Games/chengband/src/cmd1.c:2538: undefined reference to `s_info'
    /home/proteus/Games/chengband/src/cmd1.c:2555: undefined reference to `skills_weapon_gain'
    cmd1.o: In function `py_attack':
    /home/proteus/Games/chengband/src/cmd1.c:4242: undefined reference to `s_info'
    /home/proteus/Games/chengband/src/cmd1.c:4260: undefined reference to `s_info'
    cmd2.o: In function `do_cmd_fire_aux2':
    /home/proteus/Games/chengband/src/cmd2.c:3803: undefined reference to `s_info'
    /home/proteus/Games/chengband/src/cmd2.c:3799: undefined reference to `skills_bow_gain'
    cmd4.o: In function `do_cmd_knowledge_weapon_exp':
    /home/proteus/Games/chengband/src/cmd4.c:6906: undefined reference to `s_info'
    cmd4.o: In function `do_cmd_knowledge_skill_exp':
    /home/proteus/Games/chengband/src/cmd4.c:7069: undefined reference to `s_info'
    cmd5.o: In function `rakuba':
    /home/proteus/Games/chengband/src/cmd5.c:2055: undefined reference to `s_info'
    dungeon.o: In function `play_game':
    /home/proteus/Games/chengband/src/dungeon.c:6407: undefined reference to `s_info'
    /home/proteus/Games/chengband/src/dungeon.c:6404: undefined reference to `s_info'
    init1.o:/home/proteus/Games/chengband/src/init1.c:1201: more undefined references to `s_info' follow
    obj_kind.o: In function `object_is_favorite':
    /home/proteus/Games/chengband/src/obj_kind.c:81: undefined reference to `skills_weapon_is_icky'
    weaponmaster.o: In function `weaponmaster_adjust_skills':
    /home/proteus/Games/chengband/src/weaponmaster.c:3925: undefined reference to `s_info'
    weaponmaster.o: In function `_set_max_skill':
    /home/proteus/Games/chengband/src/weaponmaster.c:3914: undefined reference to `s_info'
    weaponmaster.o: In function `weaponmaster_adjust_skills':
    /home/proteus/Games/chengband/src/weaponmaster.c:3925: undefined reference to `s_info'
    wizard2.o: In function `do_cmd_wiz_change_aux':
    /home/proteus/Games/chengband/src/wizard2.c:622: undefined reference to `s_info'
    xtra1.o: In function `calc_bonuses':
    /home/proteus/Games/chengband/src/xtra1.c:5876: undefined reference to `s_info'
    xtra1.o:/home/proteus/Games/chengband/src/xtra1.c:5885: more undefined references to `s_info' follow
    collect2: ld returned 1 exit status
    make: *** [chengband] Error 1
    How can I get the current release so I can compile it for Linux?
  • chris
    PosChengband Maintainer
    • Jan 2008
    • 702

    #2
    skills.c and blood_mage.c are the most recent new files that need to be built, using whatever you are using to compile. I've pretty much given up trying to keep all the various makefiles up to date ... Last count there were 6 places where all the files that need to be compiled are listed. Sorry ...

    The correct list of files is in hengband.vcxproj. The files required to build are changing rapidly since I've begun some extensive refactoring. Perhaps when things settle down I'll go back to keeping all 6 lists up to date?

    --Chris

    Comment

    • bonzo
      Scout
      • Sep 2007
      • 43

      #3
      +1

      I'd love to be able to compile this on Linux too. I'm noticing some lag via Wine on my slow Atom.
      NPP(0.5.0-BETA6) D "Daith" KoRo L:36 DL:50 A+ R+ Sp w:The Two-Handed Sword of Cutur (3d6) (+18,+16) (+2)
      En/NPP(Un/Cr/Do) L H- D c-- f PV+ !s d P++ M+
      C-- S- I-- !So B-- ac GHB- SQ+ RQ V

      The Angband Code

      Comment

      • AnonymousHero
        Veteran
        • Jun 2007
        • 1393

        #4
        Here are the changes you need to compile the current head (from hg):

        Code:
        diff -r d1c1d5b40893 src/makefile.std
        --- a/src/makefile.std  Fri Dec 02 14:04:03 2011 -0700
        +++ b/src/makefile.std  Sun Dec 04 10:17:11 2011 +0100
        @@ -57,7 +57,8 @@
                spells1.c spells2.c spells3.c spells_a.c store.c streams.c tables.c \
                util.c variable.c variant.c warlock.c weaponmaster.c wild.c wild_realm.c wild_talent.c wizard1.c \
                wizard2.c xtra1.c xtra2.c z-form.c z-rand.c z-term.c z-util.c z-virt.c \
        -       main-cap.c main-gcu.c main-x11.c main-xaw.c main.c chuukei.c
        +       main-cap.c main-gcu.c main-x11.c main-xaw.c main.c chuukei.c skills.c \
        +       blood_mage.c
         
         OBJS = \
                archaeologist.o archer.o artifact.o autopick.o avatar.o bard.o \
        @@ -73,7 +74,7 @@
                spells1.o spells2.o spells3.o spells_a.o store.o streams.o tables.o \
                util.o variable.o variant.o warlock.o weaponmaster.o wild.o wild_realm.o wild_talent.o wizard1.o \
                wizard2.o xtra1.o xtra2.o z-form.o z-rand.o z-term.o z-util.o z-virt.o \
        -       main-x11.o main-gcu.o main.o chuukei.o
        +       main-x11.o main-gcu.o main.o chuukei.o skills.o blood_mage.o
        GCC produces reams of warnings because of the
        Code:
         #pragma warning (disable:4244) /* You will get tens of thousands of these ... */
         #pragma warning (disable:4996) /* Whatever ... Stop whining already! */
        in angband.h. This should really be wrapped in some MSVC-specific #ifdef.

        Unfortunately, the game hangs upon start-up. The "press any key" bit works fine, but the game then announces "Savefile does not exist. -more-" and hangs (using 100% CPU).

        Comment

        • AnonymousHero
          Veteran
          • Jun 2007
          • 1393

          #5
          Hum. I thought the hang at startup might have something to do with X11 resize handling (an ancient bug), but the game also hangs when using the main-gcu frontend.

          EDIT: I've figured out where the hang is: It's Rand_div() in z-rand.c. Both random generators simply fail to terminate. Maybe updating the generator with the new one from Vanilla would be a good idea?
          Last edited by AnonymousHero; December 4, 2011, 10:48.

          Comment

          • chris
            PosChengband Maintainer
            • Jan 2008
            • 702

            #6
            Chengband Compiles and Runs on Linux ...

            ... For me, anyway, using what I just pushed (0.0.72). To build, I simply used makefile.std as it exists in the repository with *no* changes, typing 'make --makefile==makefile.std' from a console. Lot's of warnings, but no errors. Then I did 'cp chengband ..' but I'm not sure if this is necessary or not (i.e. a good makefile would do this for you!). Of course, you need to have all the correct developer packages installed ... I don't know the details on how to do that, but figured it out myself about 6 months ago. If I can do it, you can too

            I don't hang on startup. I get the message, "Savefile does not exist" and then build a new character without issue so I'm not sure what is going on there.

            Regarding tags and such in the repository, I was making a new tag for each nightly, but fell out of the habit. There has not been an official release of Chengband yet, we are all just playing nightlies for the beta version!

            I also had someone come to me with trouble building on Linux, and they were using makefile.am. So, I brought that file up to date as well, but have no idea how to test/use it.

            Please let me know if you are still having issues. I'd like to help, but don't really know Linux all that well.

            --Chris

            Comment

            • chris
              PosChengband Maintainer
              • Jan 2008
              • 702

              #7
              Originally posted by AnonymousHero
              GCC produces reams of warnings because of the
              Code:
               #pragma warning (disable:4244) /* You will get tens of thousands of these ... */
               #pragma warning (disable:4996) /* Whatever ... Stop whining already! */
              in angband.h. This should really be wrapped in some MSVC-specific #ifdef.
              Done ... sorry.

              Comment

              • AnonymousHero
                Veteran
                • Jun 2007
                • 1393

                #8
                Originally posted by chris
                ... For me, anyway, using what I just pushed (0.0.72). To build, I simply used makefile.std as it exists in the repository with *no* changes, typing 'make --makefile==makefile.std' from a console. Lot's of warnings, but no errors.
                The most recent tip builds fine here too.

                Originally posted by chris
                Then I did 'cp chengband ..' but I'm not sure if this is necessary or not (i.e. a good makefile would do this for you!).
                It actually does this automatically.

                Originally posted by chris
                I don't hang on startup. I get the message, "Savefile does not exist" and then build a new character without issue so I'm not sure what is going on there.
                Still hangs here. Are you compiling on a 32 bit machine by any chance?

                The z_rand() function seems to do some bit twiddling and probably fails when compiled for 64-bit machines. I don't have the energy to figure out precisely what's wrong right now, but pulling the RNG code from vanilla shouldn't be too bad.

                Originally posted by chris
                I also had someone come to me with trouble building on Linux, and they were using makefile.am. So, I brought that file up to date as well, but have no idea how to test/use it.
                It's a file from the dreaded automake/autoconf system... it's been known to drive people insane.

                Comment

                • chris
                  PosChengband Maintainer
                  • Jan 2008
                  • 702

                  #9
                  Originally posted by AnonymousHero
                  Still hangs here. Are you compiling on a 32 bit machine by any chance?

                  The z_rand() function seems to do some bit twiddling and probably fails when compiled for 64-bit machines. I don't have the energy to figure out precisely what's wrong right now, but pulling the RNG code from vanilla shouldn't be too bad.
                  Yes I am building on a 10 year old laptop for linux

                  Can you try defining L64 when you build? Take a look at h-type.h:
                  Code:
                  #ifdef L64	/* 64 bit longs */
                  typedef signed int s32b;
                  typedef unsigned int u32b;
                  #else
                  typedef signed long s32b;
                  typedef unsigned long u32b;
                  #endif
                  --Chris

                  Comment

                  • AnonymousHero
                    Veteran
                    • Jun 2007
                    • 1393

                    #10
                    Building with -D"L64" makes the hang-on-start go away. (I don't want to get sucked into actually playing, so I just tested that it can actually start and shows @ in town.)

                    There's lots of this kind of thing:

                    Code:
                    cmd3.c: In function ‘do_cmd_inven’:
                    cmd3.c:54:6: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘u32b’ [-Wformat]
                    though. (Not sure how serious it is, but it does grate a bit.)

                    Comment

                    • Rydel
                      Apprentice
                      • Jul 2008
                      • 89

                      #11
                      a long int and a u32b should be the same size if I remember correctly. The Angband code uses u32b to avoid some OS or compiler specific changes to how longs are handled.
                      I'm trying to think of an analogy, and the best I can come up with is Angband is like fishing for sharks, and Sil is like hunting a bear with a pocket knife and a pair of chopsticks. It's not great. -Nick

                      Comment

                      • Derakon
                        Prophet
                        • Dec 2009
                        • 9022

                        #12
                        There is no guarantee as to the size of a short, int, long, etc.. They are all compiler-defined values, and you're supposed to use sizeof() and the like to ensure that you aren't losing any information. To my knowledge the only guaranteed size is that char is always 1 byte.

                        Typically longs are at least 64 bits these days.

                        Comment

                        • AnonymousHero
                          Veteran
                          • Jun 2007
                          • 1393

                          #13
                          Originally posted by Derakon
                          There is no guarantee as to the size of a short, int, long, etc.. They are all compiler-defined values, and you're supposed to use sizeof() and the like to ensure that you aren't losing any information. To my knowledge the only guaranteed size is that char is always 1 byte.

                          Typically longs are at least 64 bits these days.
                          Here's an article explaining the full details: http://en.wikipedia.org/wiki/C_data_types

                          Comment

                          • Therem Harth
                            Knight
                            • Jan 2008
                            • 926

                            #14
                            I'm happy to report that hg tip now compiles perfectly well on Salix (or presumably anything compatible with Slackware 13.37). And I think I may have a new favorite variant!

                            Comment

                            Working...
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎