Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Need pixie dust for building Python 2.4 curses module on Solaris 8

Reply
Thread Tools

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

 
 
skip@pobox.com
Guest
Posts: n/a
 
      06-06-2006

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
 
Reply With Quote
 
 
 
 
John J. Lee
Guest
Posts: n/a
 
      06-06-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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/pyt...ch/013510.html


John
 
Reply With Quote
 
 
 
 
skip@pobox.com
Guest
Posts: n/a
 
      06-07-2006

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

John> http://mail.python.org/pipermail/pyt...ch/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=0x8;
/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
 
Reply With Quote
 
Thomas Dickey
Guest
Posts: n/a
 
      06-07-2006
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem building Python 2.5.2 curses module on HP/UX 11.11 Mike Kent Python 1 01-07-2009 11:17 AM
Pixie Log Question Si Cisco 0 06-06-2007 04:56 PM
no ptyhon curses module on solaris? Shea Martin Python 1 11-08-2006 03:59 AM
Re: Replacing curses (Was: Re: Problem with curses and UTF-8) Jean-Paul Calderone Python 2 02-09-2006 08:29 AM
DVD Verdict reviews: DUST TO DUST (POR LA LIBRE), HANGIN' WITH THE HOMEBOYS, and more! DVD Verdict DVD Video 0 02-26-2004 10:04 AM



Advertisments