Compiling on Linux... HowTo?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MKula
    Apprentice
    • Feb 2008
    • 70

    Compiling on Linux... HowTo?

    Is there an up-to-date (or at least reasonably so) guide to compiling v3.0.x Angband? I'm an old hat with Angband, but reasonably new to Linux (I'd been using Windows until about a few months ago), so I'm not really sure how to compile properly/correctly.

    Currently, I have Ubuntu 7.10 Gutsy. Basically, I'd like to be able to compile directly from a downloaded tarball, however documentation on that doesn't seem to be readily available.

    Any pointers, anyone?
    It breathes on you.
    You die.
  • pav
    Administrator
    • Apr 2007
    • 793

    #2
    Hmm, let me see.

    1) Untar the download
    2) ./configure
    3) make
    4) make install
    5) ./angband

    works?
    See the elves and everything! http://angband.oook.cz

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Originally posted by MKula
      Is there an up-to-date (or at least reasonably so) guide to compiling v3.0.x Angband? I'm an old hat with Angband, but reasonably new to Linux (I'd been using Windows until about a few months ago), so I'm not really sure how to compile properly/correctly.

      Currently, I have Ubuntu 7.10 Gutsy. Basically, I'd like to be able to compile directly from a downloaded tarball, however documentation on that doesn't seem to be readily available.

      Any pointers, anyone?
      http://rephial.org/wiki/Compiling -- it's even mentioned in the readme.
      takkaria whispers something about options. -more-

      Comment

      • MKula
        Apprentice
        • Feb 2008
        • 70

        #4
        Originally posted by pav
        Hmm, let me see.

        1) Untar the download
        2) ./configure
        3) make
        4) make install
        5) ./angband

        works?
        Ha ha. I probably should have put "troubleshooting" somewhere in the title.
        Here's the problem. When I try:

        ./configure --enable-x11

        I get the following error:

        checking for gcc... gcc
        checking for C compiler default output file name...
        configure: error: C compiler cannot create executables
        See `config.log' for more details.

        I get the exact same thing when I try just "./configure", etc. When I check the config.log file, the part that looks interesting is:

        gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
        configure:2094: $? = 0
        configure:2101: gcc -V >&5
        gcc: '-V' option must have argument
        configure:2104: $? = 1
        configure:2127: checking for C compiler default output file name
        configure:2154: gcc conftest.c >&5
        /usr/bin/ld: crt1.o: No such file: No such file or directory
        collect2: ld returned 1 exit status
        configure:2157: $? = 1
        configure:2195: result:
        configure: failed program was:
        | /* confdefs.h. */
        | #define PACKAGE_NAME "Angband"
        | #define PACKAGE_TARNAME "angband"
        | #define PACKAGE_VERSION "3.0.9"
        | #define PACKAGE_STRING "Angband 3.0.9"
        | #define PACKAGE_BUGREPORT "bugs@rephial.org"
        | #define PACKAGE "angband"
        | #define VERSION "3.0.9"
        | /* end confdefs.h. */
        |
        | int
        | main ()
        | {
        |
        | ;
        | return 0;
        | }
        configure:2202: error: C compiler cannot create executables
        See `config.log' for more details.

        This doesn't appear (at first glance) to be a problem with the source; to me it looks like I'm missing some sort of compiler library or dependency that I don't know about, but I have no idea what it could be.

        Any help, anyone?
        It breathes on you.
        You die.

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9637

          #5
          Originally posted by takkaria
          http://rephial.org/wiki/Compiling -- it's even mentioned in the readme.
          Hey, that's a nice page. One might even think that a maintainer who claimed to be "using the Vanilla build system" might have read it. Or even added a link to it to their download page.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9637

            #6
            Originally posted by MKula
            This doesn't appear (at first glance) to be a problem with the source; to me it looks like I'm missing some sort of compiler library or dependency that I don't know about, but I have no idea what it could be.

            Any help, anyone?
            My usual approach here (and I'm using kubuntu Gutsy) is to open up adept and download everything that looks like a gcc library. I appear to have gcc, gcc-base (possibly not necessary?) and libgcc1 - if you have a 64-bit machine you may need some other stuff too.
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            • roustk
              Adept
              • Dec 2007
              • 167

              #7
              Originally posted by MKula
              checking for C compiler default output file name...
              configure: error: C compiler cannot create executables
              See `config.log' for more details.
              Googling for the error message, an early hit is this thread.

              It sounds like gcc in missing a dependency, but g++ has it right. So, supposedly this works:
              Code:
              $ apt-get install libc6-dev g++ gcc
              Good luck.
              Kevin

              Comment

              • MKula
                Apprentice
                • Feb 2008
                • 70

                #8
                Thanks for your help guys! I've made progress!
                Turns out you were all correct and I didn't have some some gcc libraries that were needed. Also, I needed to update my autoconf and automake, since I didn't have the correct versions of those either.
                The good news: './configure' works now!
                The bad news: that's it. 'make' doesn't work.

                If I run 'make install' (having run './configure --enable x11') I get the following:
                CC main-gcu.c
                main-gcu.c:63:22: error: ncurses.h: No such file or directory
                main-gcu.c:132: error: expected specifier-qualifier-list before ‘WINDOW’
                main-gcu.c: In function ‘Term_xtra_gcu_alive’:
                <snip about 50-100 lines>
                main-gcu.c:738: error: ‘LINES’ undeclared (first use in this function)
                main-gcu.c:738: error: ‘COLS’ undeclared (first use in this function)
                main-gcu.c:822: error: ‘stdscr’ undeclared (first use in this function)
                make[2]: *** [main-gcu.o] Error 1
                make[1]: *** [build] Error 2
                make: *** [build] Error 2

                Sooo.... what? Apparently main-gcu.c is no good? What's the next step? It's also worth mentioning that even though I ran './configure --enable x11', after all is said and done, the frontends look like:
                -- Frontends --
                - Curses Yes
                - GTK 2.x Disabled
                - X11 No; missing libraries
                - SDL Disabled

                So, even though I explicitly enabled x11, apparently I can't use it because I'm missing libraries? Is that normal?
                Your help has been awesome so far; any further advice would be much appreciated! Thanks guys

                EDIT: PS Thanks for that link takkaria... I actually feel kind of silly for not realizing it was there, in such an obvious place, since I checked that readme!
                It breathes on you.
                You die.

                Comment

                • Nick
                  Vanilla maintainer
                  • Apr 2007
                  • 9637

                  #9
                  Originally posted by MKula
                  Sooo.... what? Apparently main-gcu.c is no good? What's the next step?
                  I'd guess getting the ncurses library - I have libncurses5 and libncurses5-dev.

                  So, even though I explicitly enabled x11, apparently I can't use it because I'm missing libraries? Is that normal?
                  Well, it's normal if you don't have the libraries... the ones I have that look possibly relevant are libx11 -6, libx11 -data and libx11 -dev.

                  Someone who knows some actual information may provide some actual help.
                  One for the Dark Lord on his dark throne
                  In the Land of Mordor where the Shadows lie.

                  Comment

                  • takkaria
                    Veteran
                    • Apr 2007
                    • 1951

                    #10
                    Originally posted by MKula
                    Thanks for your help guys! I've made progress!
                    Turns out you were all correct and I didn't have some some gcc libraries that were needed. Also, I needed to update my autoconf and automake, since I didn't have the correct versions of those either.
                    You don't need automake anymore, I think, the docs were out of date. Anyway, thanks for starting this thread; I've now added a list of packages to the compiling page so other people don't have to go through what you have.
                    takkaria whispers something about options. -more-

                    Comment

                    • MKula
                      Apprentice
                      • Feb 2008
                      • 70

                      #11
                      Yup, you guys were right again; it was simply a matter of missing packages again. Takkaria, the updated command you added to the compiling page works fine; all packages needed were downloaded, so that my frontends now look like:
                      -- Frontends --
                      - Curses Yes
                      - GTK 2.x Disabled
                      - X11 Yes
                      - SDL Disabled

                      However... it still won't 'make install', for some reason.
                      When I try it, I get:


                      CC birth.c
                      In file included from angband.h:17,
                      from birth.c:11:
                      h-basic.h:132:1: warning: "_GNU_SOURCE" redefined
                      <command line>:1:1: warning: this is the location of the previous definition
                      CC cave.c
                      In file included from angband.h:17,
                      from cave.c:11:
                      h-basic.h:132:1: warning: "_GNU_SOURCE" redefined
                      <command line>:1:1: warning: this is the location of the previous definition

                      <snip... the same thing for pretty much every source file>

                      h-basic.h:132:1: warning: "_GNU_SOURCE" redefined
                      <command line>:1:1: warning: this is the location of the previous definition
                      CC z-virt.c
                      In file included from z-virt.h:14,
                      from z-virt.c:18:
                      h-basic.h:132:1: warning: "_GNU_SOURCE" redefined
                      <command line>:1:1: warning: this is the location of the previous definition
                      LINK angband
                      INSTALL angband (-> ..)
                      /bin/bash: -c: line 5: syntax error: unexpected end of file
                      make[2]: *** [install-posthook] Error 2
                      make[1]: *** [install] Error 2
                      make: *** [install] Error 2

                      I don't know what to make of this. I just used the default makefile. Should I change to another one? Is there something I have to change somewhere?
                      It's ALMOST there... any help to finish this off would be super.
                      Thank s again for your help so far, guys!
                      It breathes on you.
                      You die.

                      Comment

                      • takkaria
                        Veteran
                        • Apr 2007
                        • 1951

                        #12
                        Originally posted by MKula
                        LINK angband
                        INSTALL angband (-> ..)
                        /bin/bash: -c: line 5: syntax error: unexpected end of file
                        make[2]: *** [install-posthook] Error 2
                        make[1]: *** [install] Error 2
                        make: *** [install] Error 2

                        I don't know what to make of this. I just used the default makefile. Should I change to another one? Is there something I have to change somewhere?
                        It's ALMOST there... any help to finish this off would be super.
                        Thank s again for your help so far, guys!
                        That's a bug. 3.0.9b is going to be out soon to fix it. For now, add a "\" to the line in "src/Makefile" that says: "chmod g+s $(DESTDIR)$(BINDIR)/angband;".

                        I would also recommend you run ./configure with --enable-sdl, since it's a more user-friendly frontend than the X11 version.
                        takkaria whispers something about options. -more-

                        Comment

                        • pav
                          Administrator
                          • Apr 2007
                          • 793

                          #13
                          takkaria, how come configure enabled ncurses frontend, when the respective header is nowhere to be found? Isn't it the job of configure to "configure" the package for the environment the user happen to have?
                          See the elves and everything! http://angband.oook.cz

                          Comment

                          • takkaria
                            Veteran
                            • Apr 2007
                            • 1951

                            #14
                            Originally posted by pav
                            takkaria, how come configure enabled ncurses frontend, when the respective header is nowhere to be found? Isn't it the job of configure to "configure" the package for the environment the user happen to have?
                            Yeah. In theory it already does that. I will have to file a bug.
                            takkaria whispers something about options. -more-

                            Comment

                            • MKula
                              Apprentice
                              • Feb 2008
                              • 70

                              #15
                              OK, so I fixed the bug in the makefile, and I included sdl in my frontends, as recommended. It './configure''s perfectly. Afterwards, when I run "sudo make install" (I have to run it as sudo for folder permissions, etc.), it *seems* to install, since it goes back to the prompt after a few seconds without anything displayed. But if I try to then run the game (by simply typing "angband" at the prompt), I get the kiss of death:

                              The program 'angband' is currently not installed. You can install it by typing:
                              sudo apt-get install angband
                              bash: angband: command not found

                              So, it didn't install properly after all, huh?
                              Any ideas on this one?
                              It breathes on you.
                              You die.

                              Comment

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