Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build also wide version of ncurses #15080

Closed
vbraun opened this issue Aug 22, 2013 · 25 comments
Closed

Build also wide version of ncurses #15080

vbraun opened this issue Aug 22, 2013 · 25 comments

Comments

@vbraun
Copy link
Member

vbraun commented Aug 22, 2013

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 attachment: trac_15080.patch

CC: @jpflori

Component: build

Author: Volker Braun

Reviewer: Jean-Pierre Flori

Issue created by migration from https://trac.sagemath.org/ticket/15080

@vbraun vbraun added this to the sage-5.13 milestone Aug 22, 2013
@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Aug 22, 2013

comment:2

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.

@jpflori
Copy link

jpflori commented Oct 21, 2013

comment:4

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...

@jpflori
Copy link

jpflori commented Oct 21, 2013

Merged: Jean-Pierre Flori

@jpflori
Copy link

jpflori commented Oct 21, 2013

comment:5

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).

@vbraun
Copy link
Member Author

vbraun commented Oct 21, 2013

comment:6

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.

@vbraun
Copy link
Member Author

vbraun commented Oct 21, 2013

comment:7

Updated spkg at same place

@jdemeyer
Copy link

comment:9

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

$ hg status
? ncursesw5-config

@jpflori
Copy link

jpflori commented Oct 29, 2013

Attachment: trac_15080.patch.gz

update hgignore

@jpflori

This comment has been minimized.

@jpflori
Copy link

jpflori commented Oct 29, 2013

comment:10

Apply attachment: trac_15080.patch

@jdemeyer
Copy link

jdemeyer commented Nov 1, 2013

comment:11

.hgignore is good.

@jdemeyer
Copy link

jdemeyer commented Nov 2, 2013

Reviewer: Jean-Pierre Flori

@jdemeyer
Copy link

jdemeyer commented Nov 2, 2013

Changed merged from Jean-Pierre Flori to none

@jdemeyer
Copy link

jdemeyer commented Nov 4, 2013

comment:13

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"

@jpflori
Copy link

jpflori commented Nov 4, 2013

comment:14

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.

@jpflori
Copy link

jpflori commented Nov 4, 2013

comment:15

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

@vbraun
Copy link
Member Author

vbraun commented Nov 4, 2013

comment:16

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

@jpflori
Copy link

jpflori commented Nov 6, 2013

comment:18

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.

@jpflori
Copy link

jpflori commented Nov 6, 2013

comment:19

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

@jpflori
Copy link

jpflori commented Nov 6, 2013

comment:20

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...

@vbraun
Copy link
Member Author

vbraun commented Nov 6, 2013

comment:21

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)

@jpflori
Copy link

jpflori commented Nov 7, 2013

comment:22

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

@jpflori
Copy link

jpflori commented Nov 7, 2013

comment:23

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

@vbraun
Copy link
Member Author

vbraun commented Nov 7, 2013

comment:24
$ 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants