Python 2.4.2 gcc 3.4.4 Solaris 8 build issues

Discussion in 'Python' started by Holger Joukl, Dec 30, 2005.

  1. Holger Joukl

    Holger Joukl Guest

    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.
     
    Holger Joukl, Dec 30, 2005
    #1
    1. Advertising

  2. Holger Joukl wrote:
    > 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
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Dec 30, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AleC
    Replies:
    1
    Views:
    854
    John D Groenveld
    Jan 27, 2004
  2. Brice Breeden

    Link error using gcc 3.3 on Solaris 9

    Brice Breeden, Aug 1, 2003, in forum: C++
    Replies:
    0
    Views:
    506
    Brice Breeden
    Aug 1, 2003
  3. Stephen Williams
    Replies:
    2
    Views:
    400
    Dieter Maurer
    May 2, 2004
  4. Jhy-Chun Wang

    build 64bit python on Solaris

    Jhy-Chun Wang, Sep 21, 2004, in forum: Python
    Replies:
    3
    Views:
    631
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Sep 21, 2004
  5. Replies:
    0
    Views:
    183
Loading...

Share This Page