Compiling Python using the Portland Group compiler

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Konrad Hinsen

    #1

    Compiling Python using the Portland Group compiler

    I am trying to install Python 2.4.3 on an AMD Opteron system using
    the Portland Group's compiler (pgcc). Using

    CC="pgcc -DNCURSES_ENABLE _STDBOOL_H=0" OPT="-O0" LINKFORSHARED="-Wl,-
    export-dynamic" ./configure --without-cxx

    I finally managed to obtain an executable that would start and work,
    but it fails a couple of test cases:

    1) test_coercion reports wrong results for operations with complex
    numbers. For example,
    2**(2.+0j) yields (1+0j).

    2) test_compare reports some wrong results, such as

    (2+0j) != (2+0j)

    However, typing

    (2+0j) == (2+0j)

    into the interpreter yields "True". Perhaps the bug is in the
    execution of the test suite.

    3) test_compile reports wrong results as well:

    test test_compile failed -- Traceback (most recent call last):
    File "/work/experiences/biophys/hinsen/install/Python-2.4.3/Lib/
    test/test_compile.py ", line 164, in test_literals_w ith_leading_zer oes
    self.assertEqua l(eval("0777j") , 777j)
    AssertionError: 777j != 777j

    However,
    eval("0777j") == 777j
    yields "True".

    4) test_cpickle crashes with a segmentation fault.


    Has anyone encountered such failures before? Does anyone have useful
    suggestions for analyzing them?

    Konrad.
    --
    ---------------------------------------------------------------------
    Konrad Hinsen
    Centre de Biophysique Moléculaire, CNRS Orléans
    Synchrotron Soleil - Division Expériences
    Saint Aubin - BP 48
    91192 Gif sur Yvette Cedex, France
    Tel. +33-1 69 35 97 15
    E-Mail: hinsen ät cnrs-orleans.fr
    ---------------------------------------------------------------------


  • Nick Vatamaniuc

    #2
    Re: Compiling Python using the Portland Group compiler

    Konrad,
    I would try to find out if pgcc has any compatibility switches. I saw
    you turned optimization "off" but sometimes there is more you can do
    disable some of the advanced behind the scenes magic. So apply all
    those switches, run the tests and then try them one by one to find out
    how many you can enable before test fail again. If you compiled it as
    64bit application, try to compile as a regular 32bit and see what
    happens.
    Nick V.


    Konrad Hinsen wrote:
    I am trying to install Python 2.4.3 on an AMD Opteron system using
    the Portland Group's compiler (pgcc). Using
    >
    CC="pgcc -DNCURSES_ENABLE _STDBOOL_H=0" OPT="-O0" LINKFORSHARED="-Wl,-
    export-dynamic" ./configure --without-cxx
    >
    I finally managed to obtain an executable that would start and work,
    but it fails a couple of test cases:
    >
    1) test_coercion reports wrong results for operations with complex
    numbers. For example,
    2**(2.+0j) yields (1+0j).
    >
    2) test_compare reports some wrong results, such as
    >
    (2+0j) != (2+0j)
    >
    However, typing
    >
    (2+0j) == (2+0j)
    >
    into the interpreter yields "True". Perhaps the bug is in the
    execution of the test suite.
    >
    3) test_compile reports wrong results as well:
    >
    test test_compile failed -- Traceback (most recent call last):
    File "/work/experiences/biophys/hinsen/install/Python-2.4.3/Lib/
    test/test_compile.py ", line 164, in test_literals_w ith_leading_zer oes
    self.assertEqua l(eval("0777j") , 777j)
    AssertionError: 777j != 777j
    >
    However,
    eval("0777j") == 777j
    yields "True".
    >
    4) test_cpickle crashes with a segmentation fault.
    >
    >
    Has anyone encountered such failures before? Does anyone have useful
    suggestions for analyzing them?
    >
    Konrad.
    --
    ---------------------------------------------------------------------
    Konrad Hinsen
    Centre de Biophysique Moléculaire, CNRS Orléans
    Synchrotron Soleil - Division Expériences
    Saint Aubin - BP 48
    91192 Gif sur Yvette Cedex, France
    Tel. +33-1 69 35 97 15
    E-Mail: hinsen ät cnrs-orleans.fr
    ---------------------------------------------------------------------

    Comment

    • Konrad Hinsen

      #3
      Re: Compiling Python using the Portland Group compiler

      Nick,
      I would try to find out if pgcc has any compatibility switches. I saw
      you turned optimization "off" but sometimes there is more you can do
      disable some of the advanced behind the scenes magic. So apply all
      those switches, run the tests and then try them one by one to find out
      how many you can enable before test fail again. If you compiled it as
      64bit application, try to compile as a regular 32bit and see what
      happens.
      Thanks for your suggestions. I already looked for switches that could
      possibly change the interpretation of the C code, but I found nothing
      other than the usual ANSI and C9x compatibility switches, which only
      change the amount of warnings.

      However, I will take up your suggestion and see if I can compile a 32-
      bit executable.

      Konrad.
      --
      ---------------------------------------------------------------------
      Konrad Hinsen
      Centre de Biophysique Moléculaire, CNRS Orléans
      Synchrotron Soleil - Division Expériences
      Saint Aubin - BP 48
      91192 Gif sur Yvette Cedex, France
      Tel. +33-1 69 35 97 15
      E-Mail: hinsen ät cnrs-orleans.fr
      ---------------------------------------------------------------------


      Comment

      • nnorwitz@gmail.com

        #4
        Re: Compiling Python using the Portland Group compiler

        Konrad Hinsen wrote:
        I am trying to install Python 2.4.3 on an AMD Opteron system using
        the Portland Group's compiler (pgcc). Using
        >
        I finally managed to obtain an executable that would start and work,
        but it fails a couple of test cases:
        ....
        Has anyone encountered such failures before? Does anyone have useful
        suggestions for analyzing them?
        Try adding -Kieee to the compiler options. Python's complex math
        requires strict IEEE conformance.

        You'll have to debug the crash further.

        n

        Comment

        Working...