Issue 1324799: Curses module doesn't install on Solaris 2.8 (original) (raw)
Created on 2005-10-12 12:21 by arkoenig, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (5)
Author: Andrew Koenig (arkoenig)
Date: 2005-10-12 12:21
During installation, the following happens:
building '_curses' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC - fno-strict-aliasing -I. -I/tmp/build-gnu20746/Python- 2.4.2/./Include -I/usr/gnu/include -I/usr/local/include - I/tmp/build-gnu20746/Python-2.4.2/Include -I/tmp/build- gnu20746/Python-2.4.2 -c /tmp/build-gnu20746/Python- 2.4.2/Modules/_cursesmodule.c -o build/temp.solaris-2.8- sun4u-2.4/_cursesmodule.o /tmp/build-gnu20746/Python- 2.4.2/Modules/_cursesmodule.c: In function 'PyCursesWindow_GetStr': /tmp/build-gnu20746/Python- 2.4.2/Modules/_cursesmodule.c:822: warning: implicit declaration of function 'mvwgetnstr' gcc -shared build/temp.solaris-2.8-sun4u- 2.4/_cursesmodule.o -L/usr/gnu/lib -L/usr/local/lib -lcurses - ltermcap -o build/lib.solaris-2.8-sun4u-2.4/_curses.so *** WARNING: renaming "_curses" since importing it failed: ld.so.1: ./python: fatal: relocation error: file build/lib.solaris-2.8-sun4u-2.4/_curses.so: symbol mvwgetnstr: referenced symbol not found building '_curses_panel' extension gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC - fno-strict-aliasing -I. -I/tmp/build-gnu20746/Python- 2.4.2/./Include -I/usr/gnu/include -I/usr/local/include - I/tmp/build-gnu20746/Python-2.4.2/Include -I/tmp/build- gnu20746/Python-2.4.2 -c /tmp/build-gnu20746/Python- 2.4.2/Modules/_curses_panel.c -o build/temp.solaris-2.8- sun4u-2.4/_curses_panel.o gcc -shared build/temp.solaris-2.8-sun4u- 2.4/_curses_panel.o -L/usr/gnu/lib -L/usr/local/lib -lpanel - lcurses -ltermcap -o build/lib.solaris-2.8-sun4u- 2.4/_curses_panel.so *** WARNING: renaming "_curses_panel" since importing it failed: No module named _curses
Author: Nelson Arzola (narzola)
Date: 2005-10-29 08:01
Logged In: YES user_id=39023
I would like to add that this problem also exists under Solaris 2.10. For some reason, mvwgetnstr is not defined under Solaris 10. When I use nm to get the symbols out of /usr/lib/libcurses.so.1, I do not find it.
When I replace the two references in /dsk/data0/build/Python-2.4.2/Modules/_cursesmodule.c from mvwgetnstr to mvwgetnwstr, I was able to compile the module and pass the appropriate tests.
Since I don't use curses, I really don't have a good way to test this.
Author: A.M. Kuchling (akuchling) *
Date: 2005-11-22 14:45
Logged In: YES user_id=11375
One use of mvwgetnwstr in the module is replaced by a manual emulation of the function, if STRICT_SYSV_CURSES is true, but another use isn't replaced; I suspect this is the problem.
I've attached a patch that ensures that mvwgetnstr() is only used when STRICT_SYSV_CURSES is undefined. Please let me know if this fixes the compilation problem.
Author: Tim Mooney (enchanter)
Date: 2006-05-15 02:06
Logged In: YES user_id=36222
First, your patch does fix the problem.
Next, Solaris 8+ does have mvwgetnwstr, the problem is that it's in the X/Open version of the curses library, not the (old, stinky, backwards-compatible) default version of libcurses.
Solaris 10's man pages do a much better job of explaining the differences, on 10 one can look at
man -s 3xcurses libcurses
vs.
man libcurses
If you want to compile and link against the X/Open version of the curses library, you need to have
-I/usr/xpg4/include
in CPPFLAGS and CFLAGS, and either
-L/usr/xpg4/lib
or
-L/usr/xpg4/lib/64
(depending on whether you're compiling for ILP32 or LP64). /usr/xpg4/lib and /usr/xpg4/lib/64 are also not in the default loader search path, so you either need to modify the loader search path (man crle) or your also need a -R/usr/xpg4/lib or -R/usr/xpg4/lib/64 in LDFLAGS too.
Because of the way the _cursesmodule is currently written, though, it assumes that if __sun is defined as a preprocessor symbol, STRICT_SYSV_CURSES should be defined, which actually causes problems if you try build with with newer X/Open curses.
It should be possible to support building against either curses implementation on Solaris, but for now your patch at least makes _cursesmodule compile with the default version.
Author: A.M. Kuchling (akuchling) *
Date: 2006-09-07 13:37
Logged In: YES user_id=11375
Committed in rev.50845, so this fix will be in Python 2.5.
Closing this bug. If someone wants to submit a patch to use X/Open curses, please do. (I don't have a Solaris machine, so I can't assemble a patch myself.)