Compiling 3.4.1 fails on Debian Wheezy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gangli
    Rookie
    • Nov 2013
    • 4

    Compiling 3.4.1 fails on Debian Wheezy

    This is the first time i'm poking around in Angband caverns since the olden days of the menacing presence of Thangorodrim.... and I'd love to elaborate on the countless hours wasted dungeon crawling through Zangband and Angband, but more urgent matters prompted me to have a look here. So, I'm not happy with the official Debian Wheezy package of Angband (I believe it's 3.3 something) . That's why I'm trying to compile it myself from the source ver 3.4.1

    I've both ncurses and ncursesw (and both bin and dev pkgs) installed on the system (as mentioned before : Debian Wheezy, 64bit).

    The "./configure" line is as follows:
    Code:
    CFLAGS="-O3 -mtune=native" ./configure --prefix=$HOME/local/ --with-x --with-ncurses-prefix="/lib/x86_64-linux-gnu" --with-ncurses-exec-prefix="/usr"
    The make fails _after_ building main-gcu.c with the following type of error messages:

    Code:
    ...
    main-gcu.c:(.text+0x628): undefined reference to `stdscr'
    main-gcu.c:(.text+0x630): undefined reference to `wgetch'
    main-gcu.c:(.text+0x641): undefined reference to `cbreak'
    main-gcu.c:(.text+0x667): undefined reference to `stdscr'
    main-gcu.c:(.text+0x674): undefined reference to `nodelay'
    main-gcu.c:(.text+0x67b): undefined reference to `stdscr'
    main-gcu.c:(.text+0x683): undefined reference to `wgetch'
    main-gcu.c:(.text+0x6a2): undefined reference to `stdscr'
    main-gcu.c:(.text+0x6aa): undefined reference to `wgetch'
    main-gcu.c:(.text+0x751): undefined reference to `ungetch'
    ...
    Obviously some library is either missing, or its link path is missing/wrong. I hope you people can point to a solution.
  • myshkin
    Angband Devteam member
    • Apr 2007
    • 334

    #2
    Originally posted by gangli
    The "./configure" line is as follows:
    Code:
    CFLAGS="-O3 -mtune=native" ./configure --prefix=$HOME/local/ --with-x --with-ncurses-prefix="/lib/x86_64-linux-gnu" --with-ncurses-exec-prefix="/usr"
    configure expects a valid ncursesw5-config executable in $ncurses_exec_prefix/bin/ncursesw5-config or, if that's not set, in $ncurses_prefix/bin/ncursesw5-config. Does /usr/bin/ncursesw5-config --libs output linker options that point to a valid ncursesw library? You may also want to check config.log for references to ncurses.

    Comment

    • gangli
      Rookie
      • Nov 2013
      • 4

      #3
      Originally posted by myshkin
      configure expects a valid ncursesw5-config executable in $ncurses_exec_prefix/bin/ncursesw5-config or, if that's not set, in $ncurses_prefix/bin/ncursesw5-config. Does /usr/bin/ncursesw5-config --libs output linker options that point to a valid ncursesw library? You may also want to check config.log for references to ncurses.

      Thanks for the reply. ncursesw5-config is present and in /usr/bin.

      Output of ncursesw5-config --libs is -lncursesw -ltinfo

      Both libraries are in /usr/lib/x86_64-linux-gnu (and this is also the output of ncursesw5-config --libdir)

      grepping for ncurses in config.log (grep -i ncurs -A2) gives the following:
      Code:
        $ ./configure --prefix=/home/todor/local --with-x --with-ncurses-exec-prefix=/usr --with-ncurses-prefix=/usr/lib/x86_64-linux-gnu
      
      ## --------- ##
      --
      configure:4845: checking for ncursesw5-config
      configure:4876: result: /usr/bin/ncursesw5-config
      configure:4884: checking for ncurses - wide char support
      configure:4916: gcc -o conftest -O3 -mtune=native -DHAVE_CONFIG_H -fno-strength-reduce -W -Wall -Wno-unused-parameter -pedantic -Wno-missing-field-initializers   -I.  conftest.c   >&5
      configure:4916: $? = 0
      --
      | #define USE_NCURSES 1
      | #define USE_GCU 1
      | /* end confdefs.h.  */
      --
      | #define USE_NCURSES 1
      | #define USE_GCU 1
      | /* end confdefs.h.  */
      --
      | #define USE_NCURSES 1
      | #define USE_GCU 1
      | /* end confdefs.h.  */
      --
      ac_cv_path_NCURSES_CONFIG=/usr/bin/ncursesw5-config
      ac_cv_path_RM=/bin/rm
      ac_cv_path_TPUT=/usr/bin/tput
      --
      NCURSES_CFLAGS=''
      NCURSES_CONFIG='/usr/bin/ncursesw5-config'
      NCURSES_LIBS=''
      NOINSTALL=''
      OBJEXT='o'
      --
      #define USE_NCURSES 1
      #define USE_GCU 1
      #define USE_X11 1

      Comment

      • myshkin
        Angband Devteam member
        • Apr 2007
        • 334

        #4
        Originally posted by gangli
        Output of ncursesw5-config --libs is -lncursesw -ltinfo
        This is a little suspicious. I wonder whether /usr/lib/x86_64-linux-gnu is in your linker's default search path. If not, it won't be able to find the libraries without -L/usr/lib/x86_64-linux-gnu. If these are system packages, though, they should be set up coherently...

        Originally posted by gangli
        grepping for ncurses in config.log (grep -i ncurs -A2) gives the following:
        Code:
          $ ./configure --prefix=/home/todor/local --with-x --with-ncurses-exec-prefix=/usr --with-ncurses-prefix=/usr/lib/x86_64-linux-gnu
        
        ## --------- ##
        --
        configure:4845: checking for ncursesw5-config
        configure:4876: result: /usr/bin/ncursesw5-config
        configure:4884: checking for ncurses - wide char support
        configure:4916: gcc -o conftest -O3 -mtune=native -DHAVE_CONFIG_H -fno-strength-reduce -W -Wall -Wno-unused-parameter -pedantic -Wno-missing-field-initializers   -I.  conftest.c   >&5
        configure:4916: $? = 0
        --
        Could you go a few lines farther in the file here? When I run configure, I get
        Code:
        configure:4914: checking for ncurses - wide char support
        configure:4946: gcc -o conftest -g -O2 -DHAVE_CONFIG_H -W -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-missing-field-initializers -I/usr/include/ncursesw  -I.  conftest.c  -L/usr/lib -lncursesw -ltinfo >&5
        configure:4946: $? = 0
        configure:4946: ./conftest
        configure:4946: $? = 0
        configure:4960: result: yes
        Originally posted by gangli
        Code:
        NCURSES_CFLAGS=''
        NCURSES_CONFIG='/usr/bin/ncursesw5-config'
        NCURSES_LIBS=''
        NOINSTALL=''
        OBJEXT='o'
        This is very suspicious. NCURSES_LIBS should be the output of ncursesw5-config --libs.

        Comment

        • gangli
          Rookie
          • Nov 2013
          • 4

          #5
          Mine is similar:

          Code:
          configure:4916: gcc -o conftest -O3 -mtune=native -DHAVE_CONFIG_H -fno-strength-reduce -W -Wall -Wno-unused-parameter -pedantic -Wno-missing-field-initializers   -I.  conftest.c   >&5
          configure:4916: $? = 0
          configure:4916: ./conftest
          configure:4916: $? = 0
          configure:4930: result: yes
          Immediately afterwards though , the "mvwaddnwstr" , "use_default_colors" and "can_change_colors" tests fail with a linker error. For example:

          Code:
          ...
          configure:5009: checking for can_change_color
          configure:5009: gcc -o conftest -O3 -mtune=native -DHAVE_CONFIG_H -fno-strength-reduce -W -Wall -Wno-unused-parameter -peda
          ntic -Wno-missing-field-initializers   -I.  conftest.c   >&5
          /tmp/ccgkn5Nw.o: In function `main':
          conftest.c:(.text.startup+0x7): undefined reference to `can_change_color'
          collect2: error: ld returned 1 exit status
          configure:5009: $? = 1
          configure: failed program was:
          | /* confdefs.h */
          | #define PACKAGE_NAME "Angband"
          | #define PACKAGE_TARNAME "angband"
          | #define PACKAGE_VERSION "3.4.1"
          | #define PACKAGE_STRING "Angband 3.4.1"
          | #define PACKAGE_BUGREPORT "bugs@rephial.org"
          ...
          Could this be related?

          Comment

          • gangli
            Rookie
            • Nov 2013
            • 4

            #6
            Whoa. Just tried to configure it for the first time without any additional flags, and the CFLAGS redefinition. And ... at least the configure script works.


            It turns out that adding `exec-prefix' flag messed up things. Leaving everything else the same, and throwing that flag away did the job. I started using this, because the script failed to recognise the existence of a freshly installed ncursesw dev package. The system was rebooted between the attempts, so maybe that helped. I don't know. In any case, thanks for trying to help!

            Comment

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