classification
Title: _curses, _curses_panel & _multiprocessing can't be build in 2.6b3 w/ SunStudio 12
Type: compile error Stage:
Components: Build Versions: Python 3.2, Python 3.3
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Justin.Venus, enchanter, eric.araujo, iandekit, jcea, loewis, mschmarck, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2008-09-05 09:55 by mschmarck, last changed 2017-11-01 17:54 by serhiy.storchaka.

Files
File name Uploaded Description Edit
EKIT.patch iandekit, 2009-09-23 05:31 patch for lack of mvwchgat and wchgat
bug3786.patch Justin.Venus, 2012-06-27 05:07 review
Messages (16)
msg72579 - (view) Author: Michael Schmarck (mschmarck) Date: 2008-09-05 09:55
I'm trying to compile Python 2.6b3 using Sun Studio 12 on a Solaris 10
sparc system. It fails.

[...]
*** WARNING: renaming "_curses" since importing it failed: ld.so.1:
python: fatal: relocation error: file
build/lib.solaris-2.10-sun4u-2.6/_curses.so: symbol wchgat: referenced
symbol not found
[...]
*** WARNING: renaming "_curses_panel" since importing it failed: No
module named _curses
[...]
"/export/home/webservd/Source/Python-2.6b3/Modules/_multiprocessing/multiprocessing.c",
line 253: undefined symbol: SEM_VALUE_MAX
[...]

--($ ~/Source/Python-2.6b3)-- /opt/SUNWspro/bin/version
Machine hardware:   sun4u
OS version:         5.10
Processor type:     sparc
Hardware:           SUNW,Sun-Fire-480R

The following components are installed on your system:


Sun Studio 12
        Sun Studio 12 C Compiler
        Sun Studio 12 C++ Compiler
        Sun Studio 12 Tools.h++ 7.1
        Sun Studio 12 C++ Standard 64-bit Class Library
        Sun Studio 12 Garbage Collector 
        Sun Studio 12 Fortran 95 
        Sun Studio 12 Debugging Tools (including dbx)
        Sun Studio 12 IDE
        Sun Studio 12 Debugger GUI
        Sun Studio 12 Performance Analyzer (including collect, ...)
        Sun Studio 12 X-Designer 
        Sun Studio 12 VIM editor
        Sun Studio 12 XEmacs editor
        Sun Studio 12 Performance Library 
        Sun Studio 12 LockLint
        Sun Studio 12 Building Software (including dmake)
        Sun Studio 12 Documentation Set

version of "/opt/SUNWspro/bin/../prod/bin/../../bin/cc": Sun C 5.9
SunOS_sparc Patch 124867-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/CC": Sun C++ 5.9
SunOS_sparc Patch 124863-01 2007/07/25
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/f90": Sun Fortran 95
8.3 SunOS_sparc Patch 127000-01 2007/07/18
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dbx": Sun Dbx
Debugger 7.6 SunOS_sparc Patch 124872-01 2007/07/12
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/analyzer": Sun
Analyzer 7.6 SunOS_sparc Patch 126995-01 2007/07/17
version of "/opt/SUNWspro/bin/../prod/bin/../../bin/dmake": Sun
Distributed Make 7.8 SunOS_sparc Patch 126503-01 2007/07/19


--($ ~/Source/Python-2.6b3)-- CC -V
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25

--($ ~/Source/Python-2.6b3)-- cc -V
cc: Sun C 5.9 SunOS_sparc Patch 124867-01 2007/07/12
usage: cc [ options] files.  Use 'cc -flags' for details


--($ ~/Source/Python-2.6b3)-- gmake
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_curses' extension
cc -xcode=pic32 -OPT:Olimit=0 -DNDEBUG -O -I.
-I/export/home/webservd/Source/Python-2.6b3/./Include
-I/export/home/webservd/.software/Python-2.6b3/include -I. -IInclude
-I./Include -I/usr/local/include
-I/export/home/webservd/Source/Python-2.6b3/Include
-I/export/home/webservd/Source/Python-2.6b3 -c
/export/home/webservd/Source/Python-2.6b3/Modules/_cursesmodule.c -o
build/temp.solaris-2.10-sun4u-2.6/export/home/webservd/Source/Python-2.6b3/Modules/_cursesmodule.o
cc: Warning: illegal option -OPT:Olimit=0
"/export/home/webservd/Source/Python-2.6b3/Modules/_cursesmodule.c",
line 708: warning: implicit function declaration: mvwchgat
"/export/home/webservd/Source/Python-2.6b3/Modules/_cursesmodule.c",
line 712: warning: implicit function declaration: wchgat
cc -G
build/temp.solaris-2.10-sun4u-2.6/export/home/webservd/Source/Python-2.6b3/Modules/_cursesmodule.o
-L/export/home/webservd/.software/Python-2.6b3/lib -L/usr/local/lib
-lcurses -ltermcap -lpython2.6 -o
build/lib.solaris-2.10-sun4u-2.6/_curses.so
*** WARNING: renaming "_curses" since importing it failed: ld.so.1:
python: fatal: relocation error: file
build/lib.solaris-2.10-sun4u-2.6/_curses.so: symbol wchgat: referenced
symbol not found
building '_curses_panel' extension
cc -xcode=pic32 -OPT:Olimit=0 -DNDEBUG -O -I.
-I/export/home/webservd/Source/Python-2.6b3/./Include
-I/export/home/webservd/.software/Python-2.6b3/include -I. -IInclude
-I./Include -I/usr/local/include
-I/export/home/webservd/Source/Python-2.6b3/Include
-I/export/home/webservd/Source/Python-2.6b3 -c
/export/home/webservd/Source/Python-2.6b3/Modules/_curses_panel.c -o
build/temp.solaris-2.10-sun4u-2.6/export/home/webservd/Source/Python-2.6b3/Modules/_curses_panel.o
cc: Warning: illegal option -OPT:Olimit=0
cc -G
build/temp.solaris-2.10-sun4u-2.6/export/home/webservd/Source/Python-2.6b3/Modules/_curses_panel.o
-L/export/home/webservd/.software/Python-2.6b3/lib -L/usr/local/lib
-lpanel -lcurses -ltermcap -lpython2.6 -o
build/lib.solaris-2.10-sun4u-2.6/_curses_panel.so
*** WARNING: renaming "_curses_panel" since importing it failed: No
module named _curses
building '_multiprocessing' extension
cc -xcode=pic32 -OPT:Olimit=0 -DNDEBUG -O -DHAVE_SEM_OPEN=1
-DHAVE_FD_TRANSFER=1 -DHAVE_SEM_TIMEDWAIT=1 -IModules/_multiprocessing
-I. -I/export/home/webservd/Source/Python-2.6b3/./Include
-I/export/home/webservd/.software/Python-2.6b3/include -I. -IInclude
-I./Include -I/usr/local/include
-I/export/home/webservd/Source/Python-2.6b3/Include
-I/export/home/webservd/Source/Python-2.6b3 -c
/export/home/webservd/Source/Python-2.6b3/Modules/_multiprocessing/multiprocessing.c
-o
build/temp.solaris-2.10-sun4u-2.6/export/home/webservd/Source/Python-2.6b3/Modules/_multiprocessing/multiprocessing.o
cc: Warning: illegal option -OPT:Olimit=0
"/export/home/webservd/Source/Python-2.6b3/Modules/_multiprocessing/multiprocessing.c",
line 253: undefined symbol: SEM_VALUE_MAX
cc: acomp failed for
/export/home/webservd/Source/Python-2.6b3/Modules/_multiprocessing/multiprocessing.c

Failed to find the necessary bits to build these modules:
_bsddb             _hashlib           _sqlite3        
_ssl               _tkinter           bsddb185        
gdbm               linuxaudiodev      ossaudiodev     
readline                                              
To find the necessary bits, look in setup.py in detect_modules() for the
module's name.


Failed to build these modules:
_curses            _curses_panel      _multiprocessing

running build_scripts
msg72581 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-09-05 10:26
As for the multiprocessing problem, it has been fixed recently on trunk.
Can you give it a try?
msg72584 - (view) Author: Michael Schmarck (mschmarck) Date: 2008-09-05 10:41
Yes, the multiprocessing problem has been fixed by the patch in Issue3110.
msg72752 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-09-07 20:23
Why do you think this is a bug in Python? It sounds like a bug in the
operating system to me.

(actually, it's two bugs - please use separate bug reports in the future:
one is that Solaris doesn't implement wchgat, and the other one that it
doesn't provide SEM_VALUE_MAX. Neither is a fatal bug, though, since
it's just some extension modules that thus fail to build)
msg72768 - (view) Author: Michael Schmarck (mschmarck) Date: 2008-09-08 06:49
I filed that as a bug against Python 2.6, because in 2.5.2, the curses
modules could be built just fine.
msg72770 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-09-08 07:11
> I filed that as a bug against Python 2.6, because in 2.5.2, the curses
> modules could be built just fine.

So would you like to work on a patch?
msg72836 - (view) Author: Michael Schmarck (mschmarck) Date: 2008-09-09 10:08
Yes, I would _like_ to do that, but I fear that I lack the necessary
skills...
msg84920 - (view) Author: Tim Mooney (enchanter) Date: 2009-03-31 21:37
Solaris has both traditional System V curses and an XPG4-compatible
curses that does include mvwchgat.  The traditional system V curses is
the default, for backward compatibility.

If you want the XPG4 compatible curses, you need to make sure
-I/usr/xpg4/include and -L/usr/xpg4/lib -R/usr/xpg4/lib (or their 64-bit
equivalents) are in CPPFLAGS/CFLAGS/LDFLAGS so that the XPG4 curses is
discovered.  See the man page for mvwchgat(3XCURSES) on Solaris for more
info.

The difficulty for Python is that it also tries to build a readline
module, and the libreadline was more than likely linked against the
default system V curses.  That means that if you add the -I and -L/-R
flags to get XPG4 curses for all of the Python build, you'll probably
get a link failure or worse when building the readline module.

There are at least two ways around this:

- rebuild readline to use XPG4 curses, and then rebuild every single
  application that links against readline.  Then build Python, using
  the -I and -L/-R flags to get XPG4 curses for the entire Python build.

- modify the setup.py for the _curses module so that
  logic is added for Solaris to look for the XPG4 curses only during
  the build of the _curses module.

There is, however, no XPG4 panels library, since panels was not part of
the XPG4 specification.  That means that with the appropriate Python
code in setup.py it would be possible to build _curses against XPG4
curses lib, but _curses_panel either couldn't be built or would have to
somehow be linked against the standard (system V) panel library and the
standard curses library.
msg93023 - (view) Author: Ian Donaldson (iandekit) Date: 2009-09-23 05:31
For those not desiring the use of the chgat function and wishing
to avoid all the fun suggested in the last post (like me), and just
get a _cursesmodule built on Solaris 9 or 10... I enclose a simple patch.
msg148522 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-11-28 23:32
EKIT.patch is not correct: it fails to find mvwchgat() on Linux, whereas the function is present. The test program is not linked to curses nor ncurses.

<< Solaris has both traditional System V curses and an XPG4-compatible
curses that does include mvwchgat.  The traditional system V curses is
the default, for backward compatibility.

...

- rebuild readline to use XPG4 curses, and then rebuild every single
  application that links against readline.  Then build Python, using
  the -I and -L/-R flags to get XPG4 curses for the entire Python build.

- modify the setup.py for the _curses module so that
  logic is added for Solaris to look for the XPG4 curses only during
  the build of the _curses module. >>

Link _curses module to a different curses library than the library used by readline may lead to crash: see issue #7384.
msg149005 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-08 00:38
I hacked setup.py and _cursesmodule.c to use XPG4 curses. It requires many hacks because it lacks functions like getattrs() or getsyx/setsyx, constant like KEY_MIN and KEY_MAX. It looks difficult to use this curses library.
msg149009 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-12-08 00:53
I opened the issue #13552 to list all curses issues on OpenIndiana.
msg164119 - (view) Author: Justin Venus (Justin.Venus) Date: 2012-06-27 05:07
The attached patch allows _curses and _curses_panel to build with the sunpro compiler on Solaris11.  The only changes were compiler/linker options in the main setup.py.  The interactive curses_test works on my system.  I can easily make patches for python2.7 and python3.2 as well.

This patch may also address the issue in bug 13552 as well.
msg164875 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-07-07 15:34
+                # work around for assumption on line 128 of Modules/_cursesmodule.c

Is it impossible to fix the offending code instead of working around it in setup.py?
msg164905 - (view) Author: Justin Venus (Justin.Venus) Date: 2012-07-07 16:18
I am sure that macro object is there for good reason, it just doesn't apply
for Solaris 11.
On Jul 7, 2012 10:34 AM, "Éric Araujo" <report@bugs.python.org> wrote:

>
> Éric Araujo <merwok@netwok.org> added the comment:
>
> +                # work around for assumption on line 128 of
> Modules/_cursesmodule.c
>
> Is it impossible to fix the offending code instead of working around it in
> setup.py?
>
> ----------
> nosy: +eric.araujo
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3786>
> _______________________________________
>
msg305387 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-01 17:54
Issue31919 have made _curses be built on OpenIndiana with the default curses library. I suppose this have fixed this issue on Solaris too.

But configuring _curses to use XPG4 curses is a different issue.
History
Date User Action Args
2017-11-01 17:54:25serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg305387
2015-05-04 08:58:23wesseljsettype: compile error
2015-01-05 08:59:47noonsetnosy: - noon
2014-12-31 16:18:11akuchlingsetnosy: - akuchling
2012-07-07 16:18:00Justin.Venussetmessages: + msg164905
2012-07-07 15:34:01eric.araujosetnosy: + eric.araujo
messages: + msg164875
2012-06-27 05:07:03Justin.Venussetfiles: + bug3786.patch

nosy: + Justin.Venus
messages: + msg164119

keywords: + patch
2011-12-10 16:31:43eric.araujosetversions: - Python 2.6
2011-12-09 17:00:01jceasetnosy: + jcea
2011-12-08 00:53:51vstinnersetmessages: + msg149009
2011-12-08 00:38:15vstinnersetmessages: + msg149005
2011-11-28 23:34:03pitrousetnosy: - pitrou
2011-11-28 23:32:16vstinnersetversions: + Python 3.2, Python 3.3
2011-11-28 23:32:09vstinnersetnosy: + vstinner
messages: + msg148522
2010-11-12 20:57:22akuchlingsetassignee: akuchling ->
2010-02-22 16:09:36akuchlingsetassignee: akuchling

nosy: + akuchling
2009-10-02 16:52:31noonsetnosy: + noon
2009-09-23 05:31:57iandekitsetfiles: + EKIT.patch
nosy: + iandekit
messages: + msg93023

2009-03-31 21:37:45enchantersetnosy: + enchanter
messages: + msg84920
2008-09-09 10:08:36mschmarcksetmessages: + msg72836
2008-09-08 07:11:18loewissetmessages: + msg72770
2008-09-08 06:49:38mschmarcksetmessages: + msg72768
2008-09-07 20:23:08loewissetnosy: + loewis
messages: + msg72752
2008-09-05 10:41:04mschmarcksetmessages: + msg72584
2008-09-05 10:26:27pitrousetnosy: + pitrou
messages: + msg72581
2008-09-05 09:55:20mschmarckcreate