Title: Add 64-bit Solaris 9 build instructions to README
Type: enhancement Stage: needs patch
Components: Documentation Versions: Python 3.2
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: enchanter, jestone, loewis, terry.reedy
Priority: normal Keywords:

Created on 2005-09-27 21:04 by jestone, last changed 2010-08-07 16:37 by terry.reedy. This issue is now closed.

Messages (8)
msg60821 - (view) Author: John Stone (jestone) Date: 2005-09-27 21:04
It would be helpful to add the correct 64-bit Solaris 9
build flags to the README file.  I'm still working
through problems with Solaris 10, but these flags
seemed to work well for Solaris 9.  One could replace
the "-native64" with "-generic64" for maximum binary
compatibility if necessary: (csh syntax env commands below)
setenv CC cc
setenv CXX CC
setenv BASECFLAGS "-native -xarch=native64 -mt -xO3"
setenv LDFLAGS "-xarch=native64"
./configure --without-cxx
msg60822 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-09-29 06:41
Logged In: YES 

I believe there is no single set of "correct" options. E.g.
why is it necessary to pass -xO3? I'm sure it will build
fine without that; also, -O is documented to expand to -xO3.
Likewise, why -mt? configure should figure out the necessary
libraries itself, and -mt links with -lthread, when it
really should link with -lpthread.

-native is documented as synonym for -xtarget=native. This
in turn isn't documented much, but if it included
-xarch=native, I don't understand why you want that: it is
documented as "The compiler chooses the appropriate setting
for producing 32-bit binaries".

IOW, I think that setting CC to "cc -xarch=native64" should
be enough. Unfortunately, I don't have a Sun compiler on
Solaris, so I personally use gcc instead.
msg60823 - (view) Author: John Stone (jestone) Date: 2005-09-29 15:12
Logged In: YES 

Of course there't no single set of options, that much is
true of any platform.
However, I've provided one set of options that does work. 
It's clear to me that little testing is being done building
Python for the 64-bit ABI mode of targets such as IRIX,
Solaris, and other platforms using the vendor compilers. 
(maybe gcc works, but I can't use gcc...)  In the case of
the other platforms, there are comments in the README that
are helpful to those of us that need to build a 64-bit
Python interpreter for embedding in 64-bit applications. 
Several Python 2.3 versions I tried fail to pass on build
flags to some of the module builds, proving that nobody
tested this in the past.  2.4.2c1 works, but you have to set
all of these environment variables to get it to work. 
Anyway, as far as the options I selected:  You could choose
-O but the Sun compilers prefer -xO3 (some old versions
whine at you if you use -O).  I chose -mt for thread safety,
which is already documented in the Python README.   Simply
setting CC to "cc -xarch=native64" worked way back in Python
2.2, but fails with 2.3.x and 2.4.x.  If you try that on
2.4.2c1 and use the configure flags below,
setenv CC "cc -xarch=native64"
./configure --without-cxx --without-gcc
You can see that the build scripts have already lost the
-xarch=native64 in the first couple of compiles:
cc -c  -DNDEBUG -O -I. -I./Include  -DPy_BUILD_CORE -o
Parser/metagrammar.o Parser/metagrammar.c
cc -c  -DNDEBUG -O -I. -I./Include  -DPy_BUILD_CORE -o
Parser/firstsets.o Parser/firstsets.c
cc -c  -DNDEBUG -O -I. -I./Include  -DPy_BUILD_CORE -o
Parser/grammar.o Parser/grammar.c

If I eliminate the "--without-gcc" flag to configure, the
build does work
by setting CC to "cc -xarch=native64".  I don't know why it
breaks when one adds --without-gcc, but it'd be nice if the
docs cleared this up.  
With Python 2.2, adding --without-gcc did not break the build.
This is exactly the problem with the current state of the
build system and docs.  I don't mind the fact that it's a
little hokey to get the build done, but it'd be nice if the
docs contained the facts needed to do this without a
trial-and-error based search of the configuration space to
avoid the bugs in the build system.
msg60824 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-09-29 16:06
Logged In: YES 

I'm hesitant to add instructions to the README of the style
"do this to get it work", especially when I believe these
instructions are either wrong or overspecified. Adding
something like "Jone Stone <> suggests
to use these options" might be a compromise.

As for why --without-gcc causes dropping of compiler flags:
It's because of this fragment of

AC_MSG_CHECKING(for --without-gcc)
            AC_HELP_STRING(--without-gcc,never use gcc),
        case $withval in
        no)     CC=cc

Not sure what caused the introduction of this fragment, but
omitting --without-gcc looks like the right thing to do.

In general, I would much more prefer to receive patches that
make things work out of the box, instead of documenting bugs.
msg60825 - (view) Author: John Stone (jestone) Date: 2005-09-29 16:41
Logged In: YES 

I understand your reluctance to add cruft to the README, but
given that there's no "configure --64-bit --without-gcc"
that works, I think that adding something to the docs would
be helpful.  There's already a history of documenting
bugs/limitations of the Python build system in the README,
so while I agree with your view that fixing the build system
would be best, adding something to the README is a good
short-term solution until the 64-bit build kinks are fixed
up.  I suggest adding something along the lines of what has
already been done for AIX/HP-UX 64-bit builds, since those
also require unusual steps.  Keep it short like these?:

AIX 5.3: To build a 64-bit version with IBM's compiler, I
used the

        export PATH=/usr/bin:/usr/vacpp/bin
        ./configure --with-gcc="xlc_r -q64"
--with-cxx="xlC_r -q64" \
                    --disable-ipv6 AR="ar -X64"

HP-UX:  When using threading, you may have to add
        OPT variable in the top-level Makefile; reported by
Pat Knight,
        this seems to make a difference (at least for HP-UX
        even though pyconfig.h defines it. This seems
unnecessary when
        using HP/UX 11 and later - threading seems to work
"out of the
msg60826 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2005-09-30 14:55
Logged In: YES 

Perhaps there should be a separate README64 file and a line in 
README "For 64 bit builds, also see README64".  This would 
shrink README for most people while giving full system-specific 
details for those who need them.
msg63508 - (view) Author: Tim Mooney (enchanter) Date: 2008-03-13 16:00
I agree with Terry's comment -- Python's build machinery for multi-abi
systems is suboptimal, but documenting some methods that work for some
people would at least help.
msg113183 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-08-07 16:37
In the absence of a patch submission, I am closing this.
Perhaps it is obsolete anyway.
Date User Action Args
2010-08-07 16:37:36terry.reedysetstatus: open -> closed
resolution: out of date
messages: + msg113183

versions: + Python 3.2, - Python 2.6, Python 3.1
2009-05-15 02:45:59ajaksu2setstage: needs patch
type: enhancement
versions: + Python 2.6, Python 3.1, - Python 2.4
2008-03-13 16:00:32enchantersetnosy: + enchanter
messages: + msg63508
2005-09-27 21:04:33jestonecreate