[SciPy-dev] test error on Solaris using Sun's compilers
Skip Montanaro
skip at pobox.com
Wed Sep 11 16:11:57 EDT 2002
I installed SciPy on a Solaris machine using Sun's C and Fortran compilers
(hint for the unwary: this was *not* a straightforward exercise). During
the test run I got a single failure (this is reproducible, not an anomaly
due to different random inputs):
FAIL: check_basic (test_morestats.test_shapiro)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/skip/local/SunOS/lib/python2.2/site-packages/scipy/stats/tests/test_morestats.py", line 30, in check_basic
assert_almost_equal(w,0.90047299861907959,8)
File "/home/skip/local/SunOS/lib/python2.2/site-packages/scipy_base/testing.py", line 283, in assert_almost_equal
assert round(abs(desired - actual),decimal) == 0, msg
AssertionError:
Items are not equal:
DESIRED: 0.900472998619
ACTUAL: 0.900472760201
After a little bit of debugging, I concluded the problem is most likely in
the Fortran code. Using the first input list in the test:
x1 = [0.11,7.87,4.61,10.14,7.95,3.14,0.46,
4.43,0.21,4.75,0.71,1.52,3.24,
0.93,0.42,4.97,9.53,4.55,0.47,6.66]
I manually executed the code in scipy.stats.morestats.shapiro, and got
different results from the statlib.swilk call. On the Sun I got:
>>> scipy.stats.statlib.swilk(y,a[:N/2],init)
(array([ 0.47337097, 0.32174039, 0.25566325, 0.20829722, 0.16863985, 0.13358422,
0.10147439, 0.07128929, 0.04232321, 0.01403512],'f'), 0.90047276020050049, 0.042089268565177917, 0)
On Linux I got:
>>> scipy.stats.statlib.swilk(y,a[:N/2],init)
(array([ 0.47337109, 0.32174024, 0.25566328, 0.20829724, 0.16863985, 0.13358422,
0.1014744 , 0.0712893 , 0.04232322, 0.01403512],'f'), 0.90047299861907959, 0.042089745402336121, 0)
I can try compiling the underlying Fortran file with different flags (no
optimization for instance). What else could/should I try?
Thanks,
--
Skip Montanaro
skip at pobox.com
consulting: http://manatee.mojam.com/~skip/resume.html
More information about the SciPy-Dev
mailing list