Need pixie dust for building Python 2.4 curses module on Solaris 8

Discussion in 'Python' started by skip@pobox.com, Jun 6, 2006.

  1. Guest

    I'm having no success building the curses module on Solaris 8 (yes, I know
    it's ancient - advancing the state-of-the-art is not yet an option) for
    Python 2.4. Sun provides an apparently ancient version of curses in
    /usr/lib, so I downloaded and installed ncurses 5.5, both using default
    settings and using --with-shared. When the curses module is linked against
    libcurses.so I get some strange error about acs32map being undefined (which
    appears to live in a couple termcap-ish files in /usr/lib). When the curses
    module is linked against libncurses.a I get bazillions of linker errors like
    this:

    Text relocation remains referenced
    against symbol offset in file
    table.0 0x41 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    hls_palette 0x2dc /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    cga_palette 0x2e3 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    hls_palette 0x5e0 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    cga_palette 0x5e7 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    <unknown> 0xc9e /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    <unknown> 0xcb7 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)
    <unknown> 0x18 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_mouse.o)

    The build step and output from distutils are:

    $ python ../setup.py build_ext --include-dirs=/opt/app/nonc++/ncurses-5.5/include --rpath=/opt/app/nonc++/ncurses-5.5/lib --library-dirs=/opt/app/nonc++/ncurses-5.5/lib
    running build_ext
    INFO: Can't locate readline library
    INFO: Can't locate Tcl/Tk libs and/or headers
    building '_curses' extension
    gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/ink/skipm/src/python-svn/release24-maint/./Include -I/opt/app/g++lib6/python-2.4/include -I/usr/local/include -I/opt/app/nonc++/ncurses-5.5/include -I/opt/app/g++lib6/python-2.4/include/python2.4 -c /home/ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.c -o build/temp.solaris-2.8-i86pc-2.4/home/ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.o
    /home/ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.c: In function `PyCursesWindow_GetStr':
    /home/ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.c:822: warning: implicit declaration of function `mvwgetnstr'
    gcc -shared build/temp.solaris-2.8-i86pc-2.4/home/ink/skipm/src/python-svn/release24-maint/Modules/_cursesmodule.o -L/opt/app/g++lib6/python-2.4/lib -L/usr/local/lib -L/opt/app/nonc++/ncurses-5.5/lib -Wl,-R/opt/app/nonc++/ncurses-5.5/lib -lncurses -o build/lib.solaris-2.8-i86pc-2.4/_curses.so

    Any ideas what's wrong and what I need to do to correct the problem?

    Thx,

    Skip
     
    , Jun 6, 2006
    #1
    1. Advertising

  2. John J. Lee Guest

    writes:

    > I'm having no success building the curses module on Solaris 8 (yes, I know
    > it's ancient - advancing the state-of-the-art is not yet an option) for
    > Python 2.4. Sun provides an apparently ancient version of curses in
    > /usr/lib, so I downloaded and installed ncurses 5.5, both using default
    > settings and using --with-shared. When the curses module is linked against
    > libcurses.so I get some strange error about acs32map being undefined (which
    > appears to live in a couple termcap-ish files in /usr/lib). When the curses
    > module is linked against libncurses.a I get bazillions of linker errors like
    > this:
    >
    > Text relocation remains referenced
    > against symbol offset in file
    > table.0 0x41 /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_color.o)

    [...]
    > The build step and output from distutils are:

    [...]
    > Any ideas what's wrong and what I need to do to correct the problem?


    Was libncurses.a compiled with -fpic (or -fPIC, if necessary)?

    http://mail.python.org/pipermail/python-dev/2001-March/013510.html


    John
     
    John J. Lee, Jun 6, 2006
    #2
    1. Advertising

  3. Guest

    John> Was libncurses.a compiled with -fpic (or -fPIC, if necessary)?

    John> http://mail.python.org/pipermail/python-dev/2001-March/013510.html

    When built shared the source was compiled with -fPIC. -fPIC is not used
    when not built shared. I forced that in a non-shared build. It still gave
    me the undefined acs32map error. I tried adding either termlib or termcap
    to the link libraries, as they both provide that symbol:

    bash-2.03$ nm -p /usr/lib/libtermcap.
    libtermcap.a libtermcap.so libtermcap.so.1
    bash-2.03$ nm -p /usr/lib/libtermcap.so | egrep acs32map
    0000245332 B acs32map
    bash-2.03$ nm -p /usr/lib/libtermcap.a | egrep acs32map
    0000000004 D acs32map
    0000000000 U acs32map
    0000000000 U acs32map
    0000000000 U acs32map
    0000000000 U acs32map
    0000000000 U acs32map

    I got all sorts of warnings about various symbols having differing sizes:

    ld: warning: symbol `acs_map' has differing sizes:
    (file /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_acs.o) value=0x200; file /usr/ccs/lib/libtermcap.so value=0x4);
    /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(lib_acs.o) definition taken
    ld: warning: symbol `numnames' has differing sizes:
    (file /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(names.o) value=0xa0; file /usr/ccs/lib/libtermcap.so value=0x88);
    /opt/app/nonc++/ncurses-5.5/lib/libncurses.a(names.o) definition taken
    ...

    The link succeeded when I added termcap and the generated _curses and
    _curses_panel modules import successfully. The fact that both modules
    appear to refer to /usr/lib/libcurses.so.1 now:

    $ ldd build/lib.solaris-2.8-i86pc-2.4/_curses.so
    libcurses.so.1 => /usr/lib/libcurses.so.1
    libgcc_s.so.1 => /opt/app/nonc++/lib/libgcc_s.so.1
    libc.so.1 => /usr/lib/libc.so.1
    libdl.so.1 => /usr/lib/libdl.so.1
    $ ldd build/lib.solaris-2.8-i86pc-2.4/_curses_panel.so
    libcurses.so.1 => /usr/lib/libcurses.so.1
    libgcc_s.so.1 => /opt/app/nonc++/lib/libgcc_s.so.1
    libc.so.1 => /usr/lib/libc.so.1
    libdl.so.1 => /usr/lib/libdl.so.1

    bothers me since I explicitly asked to get the version I had installed and
    (based on the warnings above) it appears to have retrieved many symbols from
    that version. Also, running the unit test seems to hang. It certainly ties
    up the xterm.

    Skip
     
    , Jun 7, 2006
    #3
  4. wrote:

    > I'm having no success building the curses module on Solaris 8 (yes, I know
    > it's ancient - advancing the state-of-the-art is not yet an option) for
    > Python 2.4. Sun provides an apparently ancient version of curses in
    > /usr/lib, so I downloaded and installed ncurses 5.5, both using default
    > settings and using --with-shared. When the curses module is linked against


    for Solaris, you also should add --enable-rpath

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net
     
    Thomas Dickey, Jun 7, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard
    Replies:
    19
    Views:
    708
  2. Shea Martin

    no ptyhon curses module on solaris?

    Shea Martin, Nov 8, 2006, in forum: Python
    Replies:
    1
    Views:
    373
    Shea Martin
    Nov 8, 2006
  3. Mike Kent
    Replies:
    1
    Views:
    417
    Martin v. Löwis
    Jan 7, 2009
  4. spudnik
    Replies:
    0
    Views:
    266
    spudnik
    Jul 22, 2010
  5. Roedy Green

    Jesign.com bites the dust

    Roedy Green, Dec 6, 2010, in forum: Java
    Replies:
    0
    Views:
    275
    Roedy Green
    Dec 6, 2010
Loading...

Share This Page