Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#15080 closed defect (duplicate)

Build also wide version of ncurses

Reported by: vbraun Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords:
Cc: jpflori Merged in:
Authors: Volker Braun Reviewers: Jean-Pierre Flori
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jpflori)

Curses optionally supports wchar versions, the library will be called libncursesw.so. Python wants the wide version for its curses module, so we should build it as well.

Updated spkg: http://boxen.math.washington.edu/home/vbraun/spkg/ncurses-5.9.p1.spkg

Apply trac_15080.patch

Attachments (1)

trac_15080.patch (391 bytes) - added by jpflori 7 years ago.
update hgignore

Download all attachments as: .zip

Change History (25)

comment:1 Changed 8 years ago by vbraun

  • Description modified (diff)

comment:2 Changed 8 years ago by vbraun

It seems that Python will fall back to narrow curses if necessary. But if the distribution provides a wide curses then it will be preferred over the narrow one. On my Fedora 19 install, this leads to (with the old ncurses spkg):

building '_curses' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -I/home/vbraun/opt/sage-5.12.beta3/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/vbraun/opt/sage-5.12.beta3/spkg/build/python-2.7.5.p1/src/Include -I/home/vbraun/opt/sage-5.12.beta3/spkg/build/python-2.7.5.p1/src -c /home/vbraun/opt/sage-5.12.beta3/spkg/build/python-2.7.5.p1/src/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.7/home/vbraun/opt/sage-5.12.beta3/spkg/build/python-2.7.5.p1/src/Modules/_cursesmodule.o
gcc -pthread -shared -L/home/vbraun/opt/sage-5.12.beta3/local/lib -L/home/vbraun/opt/sage-5.12.beta3/local/lib build/temp.linux-x86_64-2.7/home/vbraun/opt/sage-5.12.beta3/spkg/build/python-2.7.5.p1/src/Modules/_cursesmodule.o -L/home/vbraun/opt/sage-5.12.beta3/local/lib -L/usr/local/lib -L. -lncursesw -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses.so
*** WARNING: renaming "_curses" since importing it failed: /lib64/libncursesw.so.5: undefined symbol: _nc_putchar

and it will succeed with the new spkg.

comment:3 Changed 8 years ago by vbraun

  • Cc jpflori added
  • Status changed from new to needs_review

comment:4 follow-up: Changed 7 years ago by jpflori

  • Merged in set to Jean-Pierre Flori

Just a few random remarks: why use ? rather than plain [ ] for testing? Could you mention the ticket number in SPKG.txt? I know it may seem overkill but it always nice to have all info available at once...

comment:5 Changed 7 years ago by jpflori

Otherwise looks fine. I'll still have to work on top of that to solve the Solaris problems I reported at #15268 (disable ada and use lmonade fix for CPPFLAGS vs CFLAGS).

comment:6 in reply to: ↑ 4 Changed 7 years ago by vbraun

Replying to jpflori:

Could you mention the ticket number in SPKG.txt?

IMHO we should delete the duplicate changelog keeping as soon as we have a working git version. Its just a stupid waste of developer time.

comment:7 Changed 7 years ago by vbraun

Updated spkg at same place

comment:8 Changed 7 years ago by jpflori

  • Status changed from needs_review to positive_review

comment:9 Changed 7 years ago by jdemeyer

  • Status changed from positive_review to needs_work

$SAGE_LOCAL/bin/.hgignore needs to be updated:

$ hg status
? ncursesw5-config

Changed 7 years ago by jpflori

update hgignore

comment:10 Changed 7 years ago by jpflori

  • Description modified (diff)
  • Status changed from needs_work to needs_review

comment:11 Changed 7 years ago by jdemeyer

  • Status changed from needs_review to positive_review

.hgignore is good.

comment:12 Changed 7 years ago by jdemeyer

  • Merged in Jean-Pierre Flori deleted
  • Reviewers set to Jean-Pierre Flori

comment:13 Changed 7 years ago by jdemeyer

  • Status changed from positive_review to needs_work

This fails to build on Solaris SPARC due to invalid CFLAGS:

/home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/bin/g++ -I../c++ -I../include -I../../c++ -DHAVE_CONFIG_H   -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64  -DNDEBUG -I. -I../include -I../../c++/../include -I/home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/include  -fPIC -c ../../c++/cursesf.cc -o ../obj_s/cursesf.o
/home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/bin/g++ -I../c++ -I../include -I../../c++ -DHAVE_CONFIG_H   -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -D_FILE_OFFSET_BITS=64  -DNDEBUG -I. -I../include -I../../c++/../include -I/home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/include  -fPIC -c ../../c++/cursesm.cc -o ../obj_s/cursesm.o
In file included from /home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/iso/stdlib_iso.h:39:0,
                 from /usr/include/stdlib.h:18,
                 from ../../c++/internal.h:53,
                 from ../../c++/cursesf.cc:34:
/home/buildbot/build/sage/mark-1/mark_full/build/sage-5.13.beta3/local/lib/gcc/sparc-sun-solaris2.10/4.7.3/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications 	and pre-2001 POSIX applications"

comment:14 Changed 7 years ago by jpflori

Hum, sure, I forgot about #15268 which deals with my ada issue and the xopen_source_extended one. I'll provide an updated spkg there.

comment:15 Changed 7 years ago by jpflori

Spkg uploaded at #15268, based on the one here.

Last edited 7 years ago by jpflori (previous) (diff)

comment:16 Changed 7 years ago by vbraun

  • Milestone changed from sage-5.13 to sage-duplicate/invalid/wontfix
  • Status changed from needs_work to needs_review

So let's close this ticket, further work at #15268.

comment:17 Changed 7 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from needs_review to closed

comment:18 Changed 7 years ago by jpflori

Volker: On your Red Hat, with what got readline linked? I'm currently looking into Python's install scripts and it seems fishy Python ended up wanting to uses ncursesw on top of ncurses unless readline was linked to it already.

comment:19 Changed 7 years ago by jpflori

Or not if readline was only linked to tinfo or even to nothing as seems to be the case on Red Hat...

comment:20 Changed 7 years ago by jpflori

Ok think I got it, more work for me. As a consequence the ticket here should not really be necessary anymore but won't hurt...

comment:21 Changed 7 years ago by vbraun

For the record, readline is just linking to the standard ncurses on Fedora 19. It is only the Python curses module that links in ncursesw:

(sage-sh) vbraun@localhost:sage-5.12$ ldd local/lib/python2.7/lib-dynload/_curses.so
	linux-vdso.so.1 =>  (0x00007fff433a7000)
	libncursesw.so.5 => /home/vbraun/Code/sage/local/lib/libncursesw.so.5 (0x00007f5842950000)
	libpython2.7.so.1.0 => /home/vbraun/Code/sage/local/lib/libpython2.7.so.1.0 (0x00007f5842547000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f58422fe000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f5841f3d000)
	libtinfow.so.5 => /home/vbraun/Code/sage/local/lib/libtinfow.so.5 (0x00007f5841d09000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f5841b05000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007f5841902000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f58415ff000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003895000000)
(sage-sh) vbraun@localhost:sage-5.12$ ldd local/lib/libreadline.so
	linux-vdso.so.1 =>  (0x00007fff75dd2000)
	libtinfo.so.5 => /home/vbraun/opt/sage-5.12/local/lib/libtinfo.so.5 (0x00007faefecae000)
	libc.so.6 => /lib64/libc.so.6 (0x00007faefe8bf000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003895000000)
(sage-sh) vbraun@localhost:sage-5.12$ ldd local/lib/libtinfo.so
	linux-vdso.so.1 =>  (0x00007fff1d969000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f9872a87000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003895000000)

comment:22 Changed 7 years ago by jpflori

Can you ldd /lib64/libncursew... please?

comment:23 Changed 7 years ago by jpflori

For future ref, and so that i don't waste 5 minutes each time looking for it: http://bugs.python.org/issue7384.

comment:24 Changed 7 years ago by vbraun

$ cat /lib64/libncursesw.so
INPUT(libncursesw.so.5 -ltinfo)

$ ldd /lib64/libncursesw.so.5
	linux-vdso.so.1 =>  (0x00007fff817fe000)
	libc.so.6 => /lib64/libc.so.6 (0x0000003895800000)
	libdl.so.2 => /lib64/libdl.so.2 (0x0000003895c00000)
	libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00000038adc00000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003895000000)
Note: See TracTickets for help on using tickets.