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

S

skip

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
 
J

John J. Lee

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
 
S

skip

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
 
T

Thomas Dickey

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top