fpectl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sébastien Boisgérault

    #1

    fpectl

    Hi all,

    Can anybody tell me why I can't load the fpectl module in my Python
    interpreter:
    [color=blue][color=green][color=darkred]
    >>> import fpectl[/color][/color][/color]
    Traceback: ...
    ....
    ImportError: No module named fpectl

    My platform is Linux (Mandrake 10.x) + Python2.4, built from the
    (python.org) sources and configured with the --with-fpectl option.

    Any idea ? Is the Python Library Reference obsolete on this point or
    did I miss something ?

    I have understood from the previous posts on the subject that the whole
    floating-point issue (or specifically IEEE 754 support) is quite
    complex
    and highly platform-dependent. Therefore I guess that I cannot take for
    granted the expected behavior of fpectl functions. But at least I
    should
    be able to import it, shouldn't I ?

    Cheers,

    S.B.

  • Matt

    #2
    Re: fpectl


    Sébastien Boisgérault wrote:[color=blue]
    > Hi all,
    >
    > Can anybody tell me why I can't load the fpectl module in my Python
    > interpreter:
    >[color=green][color=darkred]
    > >>> import fpectl[/color][/color]
    > Traceback: ...
    > ...
    > ImportError: No module named fpectl
    >
    > My platform is Linux (Mandrake 10.x) + Python2.4, built from the
    > (python.org) sources and configured with the --with-fpectl option.
    >
    > Any idea ? Is the Python Library Reference obsolete on this point or
    > did I miss something ?
    >
    > I have understood from the previous posts on the subject that the[/color]
    whole[color=blue]
    > floating-point issue (or specifically IEEE 754 support) is quite
    > complex
    > and highly platform-dependent. Therefore I guess that I cannot take[/color]
    for[color=blue]
    > granted the expected behavior of fpectl functions. But at least I
    > should
    > be able to import it, shouldn't I ?
    >
    > Cheers,
    >
    > S.B.[/color]

    I'd assume it's because you're on a non-Unix system. The docs
    (http://www.python.org/doc/2.3.5/lib/module-fpectl.html) say:
    Availability: Unix

    I'm assuming that means you can't use it on a Windows platform (or any
    non-Unix environment)...

    Comment

    • tiissa

      #3
      Re: fpectl

      Matt wrote:[color=blue]
      > Sébastien Boisgérault wrote:[color=green]
      >>My platform is Linux (Mandrake 10.x)
      >>[/color]
      > I'm assuming that means you can't use it on a Windows platform
      >[/color]
      It's harsh to say Mandrake is a Windows platform. ;o)

      Comment

      • Jeff Epler

        #4
        Re: fpectl

        It looks like the automatic build of the 'fpectl' module was broken
        somewhere along the line, perhaps when the transition from Modules/Setup
        to setup.py took place.

        Once I made the change below and rebuilt, I got the fpectl module.
        Furthermore, it appeared to "do something" on my Linux/x86 system:

        $ ./python -c '1e200 ** 6'
        OverflowError: (34, 'Numerical result out of range')
        $ ./python -c 'import fpectl; print dir(fpectl); fpectl.turnon_s igfpe(); 1e200 ** 6'
        ['__doc__', '__file__', '__name__', 'error', 'turnoff_sigfpe ', 'turnon_sigfpe']
        Fatal Python error: Unprotected floating point exception
        Aborted

        Jeff


        Index: setup.py
        =============== =============== =============== =============== =======
        RCS file: /cvsroot/python/python/dist/src/setup.py,v
        retrieving revision 1.217
        diff -u -u -r1.217 setup.py
        --- setup.py 15 Apr 2005 20:32:39 -0000 1.217
        +++ setup.py 19 Apr 2005 00:13:15 -0000
        @@ -400,6 +400,8 @@
        # select(2); not on ancient System V
        exts.append( Extension('sele ct', ['selectmodule.c ']) )

        + exts.append( Extension('fpec tl', ['fpectlmodule.c ']) )
        +
        # The md5 module implements the RSA Data Security, Inc. MD5
        # Message-Digest Algorithm, described in RFC 1321. The
        # necessary files md5c.c and md5.h are included here.

        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.2.6 (GNU/Linux)

        iD4DBQFCZE3RJd0 1MZaTXX0RAi0UAJ dRBueXae2l60l1N +MiHNz5jlAzAKCG CN5Y
        p9FKoAck9cS/eBHzFL1iLQ==
        =dVFi
        -----END PGP SIGNATURE-----

        Comment

        • Sébastien Boisgérault

          #5
          Re: fpectl

          Thanks for this answer.

          Did you forward this info to python-dev ?

          Cheers,

          SB

          Comment

          • Jeff Epler

            #6
            Re: fpectl

            On Tue, Apr 19, 2005 at 02:05:11AM -0700, Sébastien Boisgérault wrote:[color=blue]
            > Thanks for this answer.
            >
            > Did you forward this info to python-dev ?[/color]

            I created a patch on the sf tracker. It's been responded to by several
            developers. You can read what they said there.



            Jeff

            -----BEGIN PGP SIGNATURE-----
            Version: GnuPG v1.2.1 (GNU/Linux)

            iD8DBQFCZTKjJd0 1MZaTXX0RAtjCAJ 47jgVwy4LLWNQjU eFdMHUCDljB9QCf VL0l
            96A4zH2fVyU4JhI ishdtqik=
            =FnOA
            -----END PGP SIGNATURE-----

            Comment

            • Sébastien Boisgérault

              #7
              Re: fpectl


              Good ! And thanks for the link. I had not noticed the warning "fpectl
              module is dangerous" before.

              I am a bit sad that the floating-point issue is disappearing from the
              *active topics* list ...

              Cheers,

              SB

              Comment

              Working...