Python 2.4.2 gcc 3.4.4 Solaris 8 build issues

H

Holger Joukl

Hi,
I encountered some build issues when compiling Python 2.4.4 on a Solaris 8
box using gcc 3.4.4:

1. Running configure detects that a C++-built main needs C++-linking.
Therefore, Python gets
linked with g++, creating a dependency on libstdc++.
Some research showed up a rather elaborate discussion in the
python-dev/c++-sig-archives, ending
up in a patch that replaces the --with-cxx option with a --with-cxx-main
switch and tries to set CXX
to some sensible value in the generated Makefile even if Python gets built
C-only.
(SF #1324762 Compiling and linking main() with C++ compiler, by Christoph
Ludwig; pending)

Now, I am still not 100 % sure about what I need to do. I need
C++-extensions, but I do not
want to link anything statically with Python, i.e. everything will be
dynamically imported extension
modules. I *think* I can build Python C-only, avoiding possible runtime
problems with C++-extensions that
might have been built with different C++ compilers.

Can anyony clear that up?

2. We have some stuff in non-standard locations here. To build properly, I
need to tell this
to configure (using CXX, CPPFLAGS, LD_LIBRARY_PATH). Unfortunately, none of
this
gets communicated to the setup.py step with its find_library_file() stuff,
so it is also necessary to either
modify setup.py or add a setup.cfg file.

Is there some better way to do that?
(Probably the Makefile template could be changed to supply setup.py with
some appropriate
command line options for build_ext, but I do not know the autotools stuff.
Any recommendations
for some good tutorial?)

3. The test_locale test fails:
../python Lib/test/test_locale.py
'%f' % 1024 =? '1,024.000000' ... no
'%f' % 1024 == '1024.000000' != '1,024.000000'
'%f' % 102 =? '102.000000' ... yes
'%f' % -42 =? '-42.000000' ... yes
'%+f' % -42 =? '-42.000000' ... yes
'%20.f' % -42 =? ' -42' ... yes
'%+10.f' % -4200 =? ' -4,200' ... no
'%+10.f' % -4200 == ' -4200' != ' -4,200'
'%-10.f' % 4200 =? '4,200 ' ... no
'%-10.f' % 4200 == '4200 ' != '4,200 '
' '.isspace() =? True ... yes
'\xa0'.isspace() =? False ... no
'\xa0'.isspace() == True != False
'\xa1'.isspace() =? False ... yes
'\xc0'.isalpha() =? False ... no
'\xc0'.isalpha() == True != False
'\xc0'.isalnum() =? False ... no
'\xc0'.isalnum() == True != False
'\xc0'.isupper() =? False ... no
'\xc0'.isupper() == True != False
'\xc0'.islower() =? False ... yes
'\xec\xa0\xbc'.split() =? ['\xec\xa0\xbc'] ... no
'\xec\xa0\xbc'.split() == ['\xec', '\xbc'] != ['\xec\xa0\xbc']
'\xed\x95\xa0'.strip() =? '\xed\x95\xa0' ... no
'\xed\x95\xa0'.strip() == '\xed\x95' != '\xed\x95\xa0'
'\xcc\x85'.lower() =? '\xcc\x85' ... no
'\xcc\x85'.lower() == '\xec\x85' != '\xcc\x85'
'\xed\x95\xa0'.upper() =? '\xed\x95\xa0' ... no
'\xed\x95\xa0'.upper() == '\xcd\x95\xa0' != '\xed\x95\xa0'

?? Is this a known problem on Solaris?

Thanks in advance for any hints,
Holger

Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.

The contents of this e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail. Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Holger said:
Now, I am still not 100 % sure about what I need to do. I need
C++-extensions, but I do not want to link anything statically with
Python, i.e. everything will be dynamically imported extension
modules. I *think* I can build Python C-only, avoiding possible
runtime problems with C++-extensions that might have been built with
different C++ compilers.

Can anyony clear that up?

On Solaris 8, yes you don't need to link Python with a C++ compiler.
This is thanks the ELF's .init section.

2. We have some stuff in non-standard locations here. To build
properly, I need to tell this to configure (using CXX, CPPFLAGS,
LD_LIBRARY_PATH). Unfortunately, none of this > gets communicated to
the setup.py step with its find_library_file() stuff, so it is also
necessary to either modify setup.py or add a setup.cfg file.

Why do you say that? If you set CC before invoking configure,
it will get into Makefile, and from there into setup.py.
More generally: setup.py will take everything from Makefile,
so just check whether Makefile looks right.

As for LD_LIBRARY_PATH: If it is set when setup.py is running,
it will certainly apply. However, I really recommend to use
crle(8) instead:

crle -u -l /opt/sfw/lib

Then, your users will never have to set LD_LIBRARY_PATH
for /opt/sfw/lib.

Alternatively, set LD_RUN_PATH or pass -Wl,-R/opt/sfw/lib to
the linking compiler: this will encode the path into the
binary, so you still don't need to set LD_LIBRARY_PATH at
runtime.
?? Is this a known problem on Solaris?

It's known to me :) I had not time to investigate it further.
Der Inhalt dieser E-Mail ist vertraulich.

So ein Quatsch. Selbst Google hat jetzt eine Kopie dieser Mail:

http://tinyurl.com/8qghw

Regards,
Martin
 

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,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top