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.