Changes by Mark Dickinson dicki...@gmail.com:
Removed file: http://bugs.python.org/file10764/issue3167.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3167
___
Mark Dickinson dicki...@gmail.com added the comment:
Thanks, both!
Fixed in the trunk in r67707. I'll wait to be sure that the buildbots are
happy, then merge to 2.6, 3.0, 3.1.
--
versions: +Python 3.0, Python 3.1
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
Buildbots seem content. Merged to 2.6, 3.0, 3.1.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3167
Jean Brouwers [EMAIL PROTECTED] added the comment:
It looks like the patch did fix the problems. Attached are the results
for 32- and 64-bit Python 2.6.1 with and without the patch, all built with
SUN's compilers on Solaris 10 (Opteron).
The math log tests failed with the 32-bit build before
Changes by Jean Brouwers [EMAIL PROTECTED]:
Added file:
http://bugs.python.org/file12308/Python-2.6.1-64bit-Solaris10-math_patch.log
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Mark Dickinson [EMAIL PROTECTED] added the comment:
Skip, Jean:
Could you try the attached patch to see if it fixes the math.log and
math.log10 test failures. (The patch is generated against the trunk, but
should apply cleanly to py3k or either of the 2.6 or 3.0 maintenance
branches.
Added
Skip Montanaro [EMAIL PROTECTED] added the comment:
Mark Could you try the attached patch to see if it fixes the math.log
Mark and math.log10 test failures. (The patch is generated against the
Mark trunk, but should apply cleanly to py3k or either of the 2.6 or
Mark 3.0 maintenance
Mark Dickinson [EMAIL PROTECTED] added the comment:
I'm pretty much out of ideas here. Skip, if you have any time to figure
out where the math.log call is going wrong, I'd appreciate it. On Jean's
machine, the problem was that the call log(-inf) to the C library's log
function was returning
Mark Dickinson [EMAIL PROTECTED] added the comment:
Some other possibilities to try. This page:
http://www.redhat.com/docs/wp/solaris_port/x99.html
seems to suggest that linking with -lieee, and possibly also adding the -
ffast-math gcc option, might help.
Skip Montanaro [EMAIL PROTECTED] added the comment:
Here's a gdb session using r64812. gcc 4.2.2. ldd on math.so shows:
% ldd build/lib.solaris-2.10-i86pc-2.6/math.so
libm.so.2 = /lib/libm.so.2
libgcc_s.so.1 = /opt/app/nonc++/lib/libgcc_s.so.1
libc.so.1 =
Skip Montanaro [EMAIL PROTECTED] added the comment:
Regarding -lieee, I don't see an ieee library on my system.
Regarding -ffast-math, while it changes the log function which is linked
to, it doesn't appear to modify the result of math.log:
% ldd build/lib.solaris-2.10-i86pc-2.6/math.so
Jean Brouwers [EMAIL PROTECTED] added the comment:
The /lib/libm.so.* files on my Solaris 10 (Opteron) box are equally old:
ll /lib/libm.so*
lrwxrwxrwx 1 root root 9 Sep 7 2006 /lib/libm.so - libm.so.2*
-rwxr-xr-x 1 root bin 13536 Jan 22 2005 /lib/libm.so.1
-rwxr-xr-x 1 root bin
Mark Dickinson [EMAIL PROTECTED] added the comment:
Okay---so committing this would be premature at this point.
It looks like the test_math errors are the same problem that Jean found.
Skip, does
LDFLAGS=-xlibmieee ./configure ...
do anything to alleviate the test_math errors?
The cmath
Mark Dickinson [EMAIL PROTECTED] added the comment:
LDFLAGS=-xlibmieee ./configure ...
I guess that should probably be:
LDFLAGS=-Xlinker -xlibmieee ./configure
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
Mark Dickinson [EMAIL PROTECTED] added the comment:
Skip: one more question. What does
cmath.exp(710.0 + 1.5j)
give instead of the expected OverflowError?
Incidentally, the Solaris buildbot seems happy enough at the moment. I
wonder what the difference between Skip's machine and the
Jean Brouwers [EMAIL PROTECTED] added the comment:
For comparison, 64-bit -xO5 Python build:
Python 2.6b1 (r26b1:64398, Jun 28 2008, 12:50:06) [C] on sunos5
Type help, copyright, credits or license for more information.
import cmath
cmath.exp(710.0 + 1.5j)
Traceback (most recent call last):
Mark Dickinson [EMAIL PROTECTED] added the comment:
What about this case? Should cmath not produce the same result as math:
No; this is correct, I think. Note that the cmath.log result has nonzero
imaginary part, so can't be represented as a float.
Similarly, math.sqrt(-1) is an error,
Skip Montanaro [EMAIL PROTECTED] added the comment:
I tried to configure with '-Xlinker -xlibmieee' added to LDFLAGS. Failed
miserably. In fact, configure complained that my compiler couldn't create
executables, told me to look at config.log for details then logged me out
from the machine!
Mark Dickinson [EMAIL PROTECTED] added the comment:
However, the resulting build produces to wrong result:
Darn. That's probably because the linker needs the extra flag as well.
Here's a revised patch for you to try. (You might need to do an svn up
before it applies cleanly...)
Added file:
Changes by Mark Dickinson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10754/issue3167.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
Keep in mind also, these Python builds are compiled with the SUN
compilers, i.e. the ./configure command line includes --without-gcc.
If we do change the CC- and LINKFLAGS, those changes should only apply
in that particular case.
Using
Jean Brouwers [EMAIL PROTECTED] added the comment:
The 32-but results are the same when built with -xO5.
Python 2.6b1 (r26b1:64398, Jun 28 2008, 10:43:53) [C] on sunos5
Type help, copyright, credits or license for more information.
import cmath
cmath.log(100.0)
(4.6051701859880918+0j)
Mark Dickinson [EMAIL PROTECTED] added the comment:
Keep in mind also, these Python builds are compiled with the SUN
compilers, i.e. the ./configure command line includes --without-gcc.
If we do change the CC- and LINKFLAGS, those changes should only apply
in that particular case.
Jean Brouwers [EMAIL PROTECTED] added the comment:
The SUN compiler versions
cc -V
cc: Sun C 5.8 2005/10/13
usage: cc [ options] files. Use 'cc -flags' for details
CC -V
CC: Sun C++ 5.8 2005/10/13
Both define the following symbols:
#define __SUNPRO_C 0x580
#define __SunOS_5_10
Mark Dickinson [EMAIL PROTECTED] added the comment:
Okay, here's a third version of the patch. Same as before, except
that it makes sure that LDFLAGS are included in LDSHARED.
Jean, does this patch fix the problem with math.log on 32-bit? If so,
I'll check it in.
Added file:
Changes by Mark Dickinson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10757/issue3167.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
Sorry, my previous post was wrong. The LDSHARED symbol did NOT include -
xlibmieee. Only the BASECFLAGS and the LDFLAGS.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
Jean Brouwers [EMAIL PROTECTED] added the comment:
I applied your patch to freshly updated configure and configure.in files
and ran ./configure --without-gcc on Solaris.
The resulting Makefile has empty BASECFLAGS and LDFLAGS. Here is the
snippet:
# Compiler options
OPT=
Mark Dickinson [EMAIL PROTECTED] added the comment:
Sorry---my bad. I missed out the $ac_sys_release bit.
Patch updated again. Jean, could you please give it one more try?
Added file: http://bugs.python.org/file10760/issue3167.patch
___
Python tracker
Changes by Mark Dickinson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10759/issue3167.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
Yep, that one works. As before, using ./configure --without-gcc ...
BASECFLAGS= -xlibmieee
CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for
setup.py to
# be able
Changes by Mark Dickinson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10760/issue3167.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Mark Dickinson [EMAIL PROTECTED] added the comment:
Martin,
Do you have a moment to do a sanity check on the attached patch? The
aim of the patch is to add the -xlibmieee flag when compiling and
linking on Solaris using Sun's compiler rather than gcc. Jean Brouwers
has confirmed that the
Skip Montanaro [EMAIL PROTECTED] added the comment:
Dunno about Sun's compiler, but I get test errors on Solaris 10 using
gcc 4.2:
==
FAIL: test_specific_values (test.test_cmath.CMathTests)
Terry J. Reedy [EMAIL PROTECTED] added the comment:
Does that mean that both do the right thing or the wrong thing?
--
nosy: +tjreedy
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
The 64-bit version did the right thing, all along. The 32-bit result is
correct only when compiled with option -xlibmieee.
But the latter sets errno value to EDOM and that should be 0, rather
remain unmodified.
Mark Dickinson [EMAIL PROTECTED] added the comment:
Jean,
Could you try the attached patch and see if it fixes the problem?
And I'd welcome comments from others on the patch---I'm not much of an
autoconf hacker.
--
keywords: +patch
Added file:
Jean Brouwers [EMAIL PROTECTED] added the comment:
The patch http://bugs.python.org/file10754/issue3167.patch does not
work. The -xlibmieee flag is included in the cc command lines, like
cc -c -xtarget=native -xlibmieee -DNDEBUG -xO5 -I.
However, the resulting build produces to wrong
Jean Brouwers [EMAIL PROTECTED] added the comment:
Unless I am doing something wrong, that flag does not fix the problem.
#include errno.h
#include math.h
#include stdio.h
int main(int argc, char *argv[])
{
errno = 0;
printf(%f %d\n, log(-HUGE_VAL), errno);
errno = 0;
printf(%f
Jean Brouwers [EMAIL PROTECTED] added the comment:
Sorry, the flag *does* make a difference. Ignoring errno, the results for
32- and 64-bit do match.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
Mark Dickinson [EMAIL PROTECTED] added the comment:
On Mon, Jun 23, 2008 at 5:25 PM, Jean Brouwers [EMAIL PROTECTED]
wrote:
result is different for 32- and 64-bit
cc -xtarget=native log_inf.c -lm ; a.out
-Inf 33
Inf 33
That 33 for the second log call may just be the propagated errno
Changes by Mark Dickinson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file10722/unnamed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
Right on! With errno = 0; in between both calls:
-Inf 33
Inf 0
/Jean
On Tue, Jun 24, 2008 at 1:17 PM, Mark Dickinson [EMAIL PROTECTED] wrote:
Mark Dickinson [EMAIL PROTECTED] added the comment:
On Mon, Jun 23, 2008 at 5:25 PM, Jean
Jean Brouwers [EMAIL PROTECTED] added the comment:
Mark,
Take a look at the SUN forum, there is a (long) answer.
http://forum.java.sun.com/thread.jspa?threadID=5308106tstart=0
/Jean
On Tue, Jun 24, 2008 at 3:37 PM, Jean Brouwers [EMAIL PROTECTED] wrote:
Jean Brouwers [EMAIL PROTECTED]
Mark Dickinson [EMAIL PROTECTED] added the comment:
Judging by the information at
http://docs.sun.com/app/docs/doc/802-1930-03/6i5u95u0i?
l=ena=viewq=matherr
this behaviour is intentional. It looks like log(-inf)
sets errno = EDOM and returns -inf. An IEEE 754
conforming math library would
Mark Dickinson [EMAIL PROTECTED] added the comment:
On second thoughts, forget about matherr---looks like it's
outdated technology.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Jean Brouwers [EMAIL PROTECTED] added the comment:
Here is a simple test case, demonstrating the issue.
#include errno.h
#include math.h
#include stdio.h
int main(int argc, char *argv[])
{
printf(%f %d\n, log(-HUGE_VAL), errno);
printf(%f %d\n, log( HUGE_VAL), errno);
}
result is
Mark Dickinson [EMAIL PROTECTED] added the comment:
I'll take a look.
--
assignee: - marketdickinson
nosy: +marketdickinson
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
___
Mark Dickinson [EMAIL PROTECTED] added the comment:
Could you tell me what
import math
math.log(float('-inf'))
gives instead of the expected ValueError?
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3167
Jean Brouwers [EMAIL PROTECTED] added the comment:
Here is that in from 32- and 64-bit Python 2.6b1:
./python (32-bit)
Python 2.6b1 (r26b1:64398, Jun 20 2008, 09:20:49) [C] on sunos5
Type help, copyright, credits or license for more information.
import math
math.log(float('-inf'))
-inf
New submission from Jean Brouwers [EMAIL PROTECTED]:
There are 2 math test failures with 32-bit Python 2.6b1 and 3.0b1 on
Solaris 10 both built with Sun's C compiler. The failures do *not*
occur for the 64-bit builds. The same compiler options are used for all
these builds (except
51 matches
Mail list logo