Compiling NPP on Ubuntu questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nppangband
    NPPAngband Maintainer
    • Dec 2008
    • 926

    Compiling NPP on Ubuntu questions

    I am trying to compile NPP on the latest verion of Ubuntu. Once everything is in place, I understand that it is a three step process ("./autogen.sh", then "./configure", and finally "make".
    It seemed to indicate I got through the first two steps OK. With the make command, I got:

    /bin/bash: line 1: cd monster: No such file or directory
    make[3]: *** [subdirs] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [subdirs] error 1
    make: *** [all] error 1

    Any thoughts? This is based on the NPPAngband source found at github, work-in-progress branch. Most of the linux specific files in there were taken from Angband at github, v 3.1.2, because that is what NPP is currently based on.

    Thanks in advance for anyone who can offer any suggestions as to what to do.

    Of course, before doing any of that, I went to http://rephial.org/wiki/Compiling and copied this line into a terminal:

    sudo apt-get install autoconf gcc libc6-dev libncurses5-dev libx11-dev \
    libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev \
    libgtk2.0-dev libglade2-dev
    NPPAngband current home page: http://nppangband.bitshepherd.net/
    Source code repository:
    https://github.com/nppangband/NPPAngband_QT
    Downloads:
    https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by nppangband
    I am trying to compile NPP on the latest verion of Ubuntu. Once everything is in place, I understand that it is a three step process ("./autogen.sh", then "./configure", and finally "make".
    It seemed to indicate I got through the first two steps OK. With the make command, I got:

    /bin/bash: line 1: cd monster: No such file or directory
    make[3]: *** [subdirs] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [subdirs] error 1
    make: *** [all] error 1
    I suppose my question is, do you have a src/monster/ directory? If not, you'll need to adjust src/Makefile to remove 'monster' from SUBDIRS. (The autoconf system uses the list in SUBDIRS to work out what it needs to compile, so if there's something in there that you don't have / something you don't have in there that you need then the system won't work.)

    Does that make sense?
    takkaria whispers something about options. -more-

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9634

      #3
      takkaria has it in one - the sundirs line in your src/Makefile should read
      Code:
      SUBDIRS = gtk
      It may be helpful (or misleading ) to look at the FA source on github for comparison for this sort of thing - it has gone with almost all the V3.2/3.3 low level code, but hasn't moved to the monster, object, player subdirectories.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • nppangband
        NPPAngband Maintainer
        • Dec 2008
        • 926

        #4
        Yes, that was it. Thank you both. The only subdirectory NPP has with source code is for GTK.

        Now on to round 2, where the questions get tougher, but you get double the points........

        I got a little further, and worked through a couple more error messages. I had to remove two files from makefile.std that I don't have in NPP. Once I did that, I retried the "make" command, and I got the error:

        make[3]: *** No rule to make target 'NPPAngband'. Stop.
        make[2]: *** [all] Error 1
        make[1]: *** [subdirs] Error 1
        make: *** [all] Error 1

        I thought this one was strange because I would think it would give me that error first, before the error messages related to specific makefiles.

        BTW: Do I have to do the autogen.sh and configure commands each time I make, or just once?

        One of the files I removed from makefile.std was snd-sdl.o. Did I read that rignt in that file has functions needed for sound support under sdl? IIRC I have the same functions buried somewhere in another file in NPP, but I will have to confirm that.

        I shoudl mention that my eventual goal is not only to confirm everything works fine in the various Linux plaforms, but also hopefully have the same Linux packages that regular angband has, so people can just download and play NPP in Linux. Then I just have to fulfill my longstanding dream of getting a macbook pro and I can work directly on all three platforms.
        NPPAngband current home page: http://nppangband.bitshepherd.net/
        Source code repository:
        https://github.com/nppangband/NPPAngband_QT
        Downloads:
        https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9634

          #5
          OK, I think that replacing
          Code:
          angband: $(OBJECTS)
          with
          Code:
          $(PROG): $(OBJECTS)
          should fix that.

          You should not need to redo autogen.sh and config, as a general rule.

          Yes, snd-sdl is for use of sound in SDL - note that you will have to have several SDL-related packages installed for the SDL port to be usable on your machine (just use whatever GUI your version of Ubuntu uses and look for things like SDL_mixer, SDL_ttf, SDL_image).

          Note that the full V build system has makefiles in every directory, including the top level one. This helps for installing on linux rather than just running from the local directory, which is not strictly necessary but probably a good idea. Again, using FA1.2 as a template may help.

          Then I just have to fulfill my longstanding dream of getting a macbook pro and I can work directly on all three platforms.
          My current setup (which I have had for the last couple of years) is to have a mac with virtual linux and windows machines. IMHO this is pretty much ideal.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          • nppangband
            NPPAngband Maintainer
            • Dec 2008
            • 926

            #6
            Originally posted by Nick
            OK, I think that replacing {snip} should fix that.
            Yes, it did! Thank you very much. I have some compiler warnings and errors to work through in the main.*** files, but I am on my way now.

            Originally posted by Nick
            Yes, snd-sdl is for use of sound in SDL - note that you will have to have several SDL-related packages installed for the SDL port to be usable on your machine (just use whatever GUI your version of Ubuntu uses and look for things like SDL_mixer, SDL_ttf, SDL_image).
            I remember you have make some NPP release packages for previous versions, I am also going to look through those and see what you did.

            Originally posted by Nick
            Note that the full V build system has makefiles in every directory, including the top level one. This helps for installing on linux rather than just running from the local directory, which is not strictly necessary but probably a good idea. Again, using FA1.2 as a template may help.
            I was not quite sure what they do, but I added all of them today anyway, along with a bunch of other files. I think some of them have to do with github rather than compiling, but that can all be sorted out later. I will check out FA as well.

            Originally posted by Nick
            My current setup (which I have had for the last couple of years) is to have a mac with virtual linux and windows machines. IMHO this is pretty much ideal.
            NICE!
            NPPAngband current home page: http://nppangband.bitshepherd.net/
            Source code repository:
            https://github.com/nppangband/NPPAngband_QT
            Downloads:
            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

            Comment

            • nppangband
              NPPAngband Maintainer
              • Dec 2008
              • 926

              #7
              Thanks again for the help. I am getting closer to compiling. This is the latest error that I need help on: I kind of understand what the linker command line is but I am not sure what to do about it:

              /usr/bin/ld: snd-sdl.o: undefined reference to symbol 'SDL_GetError'
              /usr/bin/ld: note: 'SDL_GetError' is defined in DSO /usr/lib/libSDL-1.2.so.0 so try adding it to the linker command line
              /usr/lib/libSDL-1.2.so.0: could not read symbols: Invalid operation
              collect2: ld returned 1 exit status
              make[3]: *** [nppangband] Error 1
              make[2]: *** [all] Error 1
              make[1]: *** [subdirs] Error 1
              make: *** [all] Error 1
              NPPAngband current home page: http://nppangband.bitshepherd.net/
              Source code repository:
              https://github.com/nppangband/NPPAngband_QT
              Downloads:
              https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 5110

                #8
                Originally posted by nppangband
                Thanks again for the help. I am getting closer to compiling. This is the latest error that I need help on: I kind of understand what the linker command line is but I am not sure what to do about it:

                /usr/bin/ld: snd-sdl.o: undefined reference to symbol 'SDL_GetError'
                /usr/bin/ld: note: 'SDL_GetError' is defined in DSO /usr/lib/libSDL-1.2.so.0 so try adding it to the linker command line
                /usr/lib/libSDL-1.2.so.0: could not read symbols: Invalid operation
                collect2: ld returned 1 exit status
                make[3]: *** [nppangband] Error 1
                make[2]: *** [all] Error 1
                make[1]: *** [subdirs] Error 1
                make: *** [all] Error 1
                ISTR you said earlier in the thread that you had got rid of snd-sdl.c, because those functions were in some other .c file now? If that's right then you shouldn't be linking snd-sdl.o, and you need to remove it from the list of .o files which forms ANGFILES (or MAINFILES, or whatever it is).

                If that's not right, and you do build snd-sdl.o from snd-sdl.c, then my guess is that something is missing from your SDL installation. But since libSDL-1.2.so.0 is a very low-level core component of SDL, it's likely to be there if you have installed all the SDL libs.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • nppangband
                  NPPAngband Maintainer
                  • Dec 2008
                  • 926

                  #9
                  Originally posted by Magnate
                  ISTR you said earlier in the thread that you had got rid of snd-sdl.c, because those functions were in some other .c file now? If that's right then you shouldn't be linking snd-sdl.o, and you need to remove it from the list of .o files which forms ANGFILES (or MAINFILES, or whatever it is).

                  If that's not right, and you do build snd-sdl.o from snd-sdl.c, then my guess is that something is missing from your SDL installation. But since libSDL-1.2.so.0 is a very low-level core component of SDL, it's likely to be there if you have installed all the SDL libs.
                  The reason I added it back in because I got a compiler error on main-sdl because it calls one of the functions in snd-sdl-o.

                  I installed the recommended dependencies from the compiling page on rephial (sudo apt-get install autoconf gcc libc6-dev libncurses5-dev libx11-dev \
                  libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev \
                  libgtk2.0-dev libglade2-dev ) Did I miss anything?
                  NPPAngband current home page: http://nppangband.bitshepherd.net/
                  Source code repository:
                  https://github.com/nppangband/NPPAngband_QT
                  Downloads:
                  https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                  Comment

                  • nppangband
                    NPPAngband Maintainer
                    • Dec 2008
                    • 926

                    #10
                    Looks like there is already a thread on this one a couple months ago & it is an ubuntu issue.

                    Last edited by nppangband; February 8, 2012, 19:03.
                    NPPAngband current home page: http://nppangband.bitshepherd.net/
                    Source code repository:
                    https://github.com/nppangband/NPPAngband_QT
                    Downloads:
                    https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                    Comment

                    • ghengiz
                      Adept
                      • Nov 2011
                      • 178

                      #11
                      Originally posted by nppangband
                      The reason I added it back in because I got a compiler error on main-sdl because it calls one of the functions in snd-sdl-o.

                      I installed the recommended dependencies from the compiling page on rephial (sudo apt-get install autoconf gcc libc6-dev libncurses5-dev libx11-dev \
                      libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev \
                      libgtk2.0-dev libglade2-dev ) Did I miss anything?
                      That's...interesting.
                      I checked Makefile.std, and it does *not* mention libSDL-1.2.so.0 explicitely, but just the ttf, image and mixer components.
                      Have you already tried to add it manually?
                      Also, that 0 at the end of libSDL-1.2.so.0 looks weird...IIRC, the sub-version numbers are add before the .so and .a, not after

                      Comment

                      • nppangband
                        NPPAngband Maintainer
                        • Dec 2008
                        • 926

                        #12
                        I am going to try adding it manually when I get home tonight.

                        I found many threads on the subject (it almost certainly is an Ubuntu issue), that recommend adding this line (which I understand will add it manually, I am still quite the Linux novice, and I don't know much about makefiles wither":

                        LDFLAGS += -{file_name}

                        so my plan is to add "LDFLAGS += -libSDL-1.2.so.0" to either makefile or makefile.std and see how it goes.
                        NPPAngband current home page: http://nppangband.bitshepherd.net/
                        Source code repository:
                        https://github.com/nppangband/NPPAngband_QT
                        Downloads:
                        https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                        Comment

                        • AnonymousHero
                          Veteran
                          • Jun 2007
                          • 1393

                          #13
                          Originally posted by nppangband
                          so my plan is to add "LDFLAGS += -libSDL-1.2.so.0" to either makefile or makefile.std and see how it goes.
                          You need "-lSDL" (or possibly "-lsdl"); the linker will automatically find the "libSDL.a" or "libSDL.so".

                          Comment

                          • nppangband
                            NPPAngband Maintainer
                            • Dec 2008
                            • 926

                            #14
                            Thanks, everybody. That worked, and I got a little further.

                            I also confirmed that, in Ubuntu, Angband 3.3 (Master Branch from github) has the same problem. Adding the line LDFLAGS += -lSDL to Makefile allows it to fniish compiling.

                            Here is my next roadblock in NPP:

                            Successfully compiled z-term.c.
                            Successfully compiled z-type.c.
                            Successfully compiled z-util.c.
                            Successfully compiled z-virt.c.
                            LINK nppangband
                            Makefile:5: *** missing separator. Stop.
                            make[5]: *** [subdirs] Error 1
                            make[4]: *** [all] Error 1
                            make[3]: *** [subdirs] Error 1
                            make[2]: *** [all] Error 1
                            make[1]: *** [subdirs] Error 1
                            make: *** [all] Error 1

                            I thought this meant there is a tab missing in makefile, line 5. But line 5 is:
                            "include Makefile.src", and it look like I got well past that in compiling.

                            So I can't quite tell where the compiling stopped. Any suggestions?

                            I looked for the word "LINK" in the makefiles. Is this were I got the error (in Makefile)?

                            $(PROG): $(OBJECTS)
                            $(CC) $(OBJECTS) $(LDFLAGS) $(LDADD) -o $@
                            @printf "%10s %-20s\n" LINK $@
                            NPPAngband current home page: http://nppangband.bitshepherd.net/
                            Source code repository:
                            https://github.com/nppangband/NPPAngband_QT
                            Downloads:
                            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                            Comment

                            • AnonymousHero
                              Veteran
                              • Jun 2007
                              • 1393

                              #15
                              Is there an "nppangband" file?

                              "Missing separator" is usually a sign that the whitespace (tab vs. spaces) is messed up, I think. You might want to double-check the Makefile indentation in an editor where you can distinguish tab from normal spaces.
                              (Perhaps line 5, given the error message?)

                              Comment

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