Ward,
the symbols exist in the libreadline.a, not in libncurses.a as you can see here:

$ readelf --syms 
/usr/software/software/Compiler/GCC/5.4.0-2.26/libreadline/6.3/lib/libreadline.a
 | grep 'tputs\|tgoto\|tgetnum\|PC\|BC\|UP\|tgetent\|tgetstr\|tgetflag'
   97: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs
  127: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tgoto
   70: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetnum
   97: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND PC
   99: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND BC
  100: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND UP
  101: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetent
  102: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetstr
  104: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetflag
  118: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs

$ readelf --syms /usr/software/software/Core/ncurses/6.0/lib/libncurses.a | 
grep 'tputs\|tgoto\|tgetnum\|PC\|BC\|UP\|tgetent\|tgetstr\|tgetflag'
   28: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs_sp
   41: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs_sp
   14: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs_sp
   25: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs_sp

Davide

On Jan 18 2017, at 2:56 pm, Ward Poelmans <[email protected]> wrote:

Hi Davide,

On Wed, Jan 18, 2017 at 9:05 PM, Vanzo, Davide
<[email protected]> wrote:
> When trying to build Python-2.7.12-foss-2016b it fails with the error below.
>
> =========
> /usr/software/software/Compiler/GCC/5.4.0-2.26/libreadline/6.3/lib/libreadline.a
> /usr/software/software/Core/ncurses/6.0/lib/libncurses.a -lm
> ./libpython2.7.so: error: undefined reference to 'tputs'
> ./libpython2.7.so: error: undefined reference to 'tgoto'
> ./libpython2.7.so: error: undefined reference to 'tgetnum'
> ./libpython2.7.so: error: undefined reference to 'PC'
> ./libpython2.7.so: error: undefined reference to 'BC'
> ./libpython2.7.so: error: undefined reference to 'UP'
> ./libpython2.7.so: error: undefined reference to 'tgetent'
> ./libpython2.7.so: error: undefined reference to 'tgetstr'
> ./libpython2.7.so: error: undefined reference to 'tgetflag'
> collect2: error: ld returned 1 exit status
> make: *** [python] Error 1
>
> ==========
>
> The weird thing is that libreadline.a contains such symbols when checking
> with readelf. Has anyone had this problem before?

Yes, I've seen this before. That's why we link libreadline to ncurses.
I'm surprise you get this error when both the static archive for
libreadline and ncurses are include.

So you are sure that those symbols exists in libncurses.a and it is defined?

Can you try what happens if you put the paths for libncurses and
libreadline before -lpython2.7?

> On a side note, while digginig into libreadline and ncurses, I noticed that
> although we want libreadline linked to our custom version of ncurses 6.0, it
> gets actually linked to the system ncurses library. This can be solved by
> modifying the easyconfig to read as follows:
>
> preconfigopts = 'env LDFLAGS="-lncurses -L$EBROOTNCURSES/lib"'
>
> Is it just me having this problem or can be something worth enhancing?

That's definitely a bug. Please open an issue on github (or pull request).

Ward

Reply via email to