Sorry for the multipost, configure also has to be modified:


--- original/configure    2015-04-24 01:50:47.000000000 +0300
+++ new/configure    2015-05-09 22:41:08.720042193 +0300
@@ -20897,7 +20897,7 @@ if ${ac_cv_lib_ncurses_initscr+:} false;
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses  $LIBS"
+LIBS="-lncurses -ltinfo  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */

@@ -20974,7 +20974,7 @@ fi


    if test "$ac_have_ncurses" = "yes"; then
-      NCURSES="-lncurses"
+      NCURSES="-ltinfo -lncurses"
       NCURSES_HEADER="ncurses.h"
       ac_have_some_curses="yes"
    elif test "$ac_have_curses" = "yes"; then


On 05/09/2015 12:31 PM, Daniel Letai wrote:

Here's a sample patch:


--- original/auxdir/x_ac_ncurses.m4 2015-04-24 01:50:47.000000000 +0300
+++ new/auxdir/x_ac_ncurses.m4    2015-05-09 12:28:21.810571177 +0300
@@ -23,7 +23,7 @@ AC_DEFUN([X_AC_NCURSES],

    AC_SUBST(NCURSES)
    if test "$ac_have_ncurses" = "yes"; then
-      NCURSES="-lncurses"
+      NCURSES="-ltinfo -lncurses"
       NCURSES_HEADER="ncurses.h"
       ac_have_some_curses="yes"
    elif test "$ac_have_curses" = "yes"; then


On 05/09/2015 11:32 AM, Daniel Letai wrote:

Forgot to paste the relevant build output:

/bin/sh ../../libtool --tag=CC --mode=link gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -pthread -fno-gcse -Wall -g -O0 -fno-strict-aliasing -export-dynamic -o smap smap.o job_functions.o partition_functions.o grid_functions.o reservation_functions.o opts.o ../../src/api/libslurm.o -ldl -lncurses libtool: link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -pthread -fno-gcse -Wall -g -O0 -fno-strict-aliasing -o smap smap.o job_functions.o partition_functions.o grid_functions.o reservation_functions.o opts.o ../../src/api/libslurm.o -Wl,--export-dynamic -ldl -lncurses -pthread
smap.c:144: error: undefined reference to 'COLS'
smap.c:158: error: undefined reference to 'COLS'
smap.c:161: error: undefined reference to 'COLS'
smap.c:161: error: undefined reference to 'LINES'
smap.c:163: error: undefined reference to 'LINES'
smap.c:163: error: undefined reference to 'COLS'
smap.c:173: error: undefined reference to 'raw'
smap.c:174: error: undefined reference to 'stdscr'
smap.c:174: error: undefined reference to 'keypad'
smap.c:176: error: undefined reference to 'cbreak'
smap.c:177: error: undefined reference to 'curs_set'
smap.c:178: error: undefined reference to 'stdscr'
smap.c:178: error: undefined reference to 'nodelay'
smap.c:189: error: undefined reference to 'LINES'
smap.c:194: error: undefined reference to 'LINES'
smap.c:209: error: undefined reference to 'stdscr'
smap.c:319: error: undefined reference to 'stdscr'
smap.c:319: error: undefined reference to 'nodelay'
smap.c:366: error: undefined reference to 'curs_set'
collect2: ld returned 1 exit status


and stdscr reference:
$ readelf -Ws /usr/lib64/libncurses.so | grep stdscr
    12: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  UND stdscr
$ readelf -Ws /usr/lib64/libtinfo.so | grep stdscr
   224: 0000003f17e20f70     8 OBJECT  GLOBAL DEFAULT   24 stdscr



On 05/09/2015 11:20 AM, Daniel Letai wrote:

FYI
If using an unpatched gnu binutils to link slurm, it will not build as the symbols are undefined in libncurses.

Adding -ltinfo should solve the issue.

Other option is to us -Wl,--copy-dt-needed-entries , as that option default has changed in recent gnu ld. Redhat in fedora provide their own patch apparently, but I believe the code should be robust regardless.

Reply via email to