Bug 76067 - Octave use of SLATEC routine DGAMLM fails
|
Bug#:
76067
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: x86
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: major
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: sci@gentoo.org
|
Reported By: jalyvr@hotmail.com
|
|
Component: Applications
|
|
|
URL:
|
|
Summary: Octave use of SLATEC routine DGAMLM fails
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2004-12-29 12:38 0000
|
After apparantly successful emerge (after the USE=f77 detour), simple anova
test fails with DGAMLM unable to compute XMAX. No usable results from Octave
are possible.
Reading the DGAMLM source from netlib, XMAX is an upper limit on the valid
range to compute to Gamma function.
The machine is AMD XP 2500, 1GB. Octave is 2.1.50
Reproducible: Didn't try
Steps to Reproduce:
1. Emerge Octave
2. Run anova statistical test as detailed below
3.
Actual Results:
bash-2.05b$ octave
GNU Octave, version 2.1.50 (i486-pc-linux-gnu).
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W. Eaton.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.
Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html
Report bugs to <bug-octave@bevo.che.wisc.edu>.
octave:1> y = [1 3 4 2 1 5 3 5 6 7 4 5 7 10 11 3]';
octave:2> g = [1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3]';
octave:3> anova(y, g)
***MESSAGE FROM ROUTINE DGAMLM IN LIBRARY SLATEC.
***FATAL ERROR, PROG ABORTED, TRACEBACK REQUESTED
* UNABLE TO FIND XMAX
* ERROR NUMBER = 2
*
***END OF MESSAGE
***JOB ABORT DUE TO FATAL ERROR.
0 ERROR MESSAGE SUMMARY
LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT
SLATEC DGAMLM UNABLE TO FIND XMAX 2 2 1
octave:3>
Expected Results:
According to a published result,
http://www.octave.org/octave-lists/archive/bug-octave.2004/msg00088.html
there should be a result
> anova(y, g)
One-way ANOVA Table:
Source of Variation Sum of Squares df Empirical Var
*********************************************************
Between Groups 71.5600 2 35.7800
Within Groups 62.8000 13 4.8308
---------------------------------------------------------
Total 134.3600 15
Test Statistic f 7.4067
p-value 0.0071
I believe the nature of the statistical data is irrelevent, since DGAMLM is
computing a feature of the computer, not the statistical problem.
# emerge info
Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.4,
glibc-2.3.4.20040808-r1,
2.4.20-gentoo-r5 i686)
=================================================================
System uname: 2.4.20-gentoo-r5 i686 AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers: sys-kernel/linux-headers-2.4.19,sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=i686 -funroll-loops -pipe"
CHOST="i486-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -mcpu=i686 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.mirrored.ca/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apm arts avi berkdb bitmap-fonts crypt cups encode esd f77 fam flac
foomaticdb fortran gdbm gif gnome gphoto2 gpm gtk gtk2 imagemagick imlib java
jpeg kde libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls
oggvorbis
opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl
svga tcltk tcpd tiff truetype x86 xml xml2 xmms xv zlib"
Hi John !
Would you mind trying the latest stable version of octave for your architecture ?
This seems to be octave-2.1.57-r1, as for me (amd64) it works with the very same USE-Flags.
[..]
octave:3> anova(y,g)
One-way ANOVA Table:
Source of Variation Sum of Squares df Empirical Var
*********************************************************
Between Groups 0.2222 2 0.1111
Within Groups 13.0000 2 6.5000
---------------------------------------------------------
Total 13.2222 4
Test Statistic f 0.0171
p-value 0.9832
ans = 0.98319
[..]
I tried 2.1.57; no joy: the same XMAX result. But a new message appears at the
beginning when Octave is started:
bash-2.05b$ octave
warning: lo_ieee_init: unrecognized floating point format!
GNU Octave, version 2.1.57 (i486-pc-linux-gnu).
...etc the same as before....
Google finds this in octave.org with a couple of prior complaints but no
responses or fixes. So now I suspect a compiler difference.
Got any further suggestions?
After some research, I discovered ebuild and tried to construct a debuggable
version. So far I haven't got an unstripped executable but I have somehow
solved the original problem.
I managed to rebuild with CFLAGS="-O3 -mcpu=i686 -g -pipe" replacing
unroll-loops with a debug request. Although I have not yet figured out how to
avoid stripping the resulting executables, they now work without the
lo_ieee_init mesasge and the dgamlm error about xmax is gone. Anova works.
I'm clueless about building with ebuild and adjusting the builds etc so this
may not be reproducable. However , octave now works for me.
I suspect some compiler optimization is breaking lo_ieee.cc or the slatec
routine d1mach.f.
I have the same problem trying to run
gamma_pdf yields the XMAX error from DGALML (in SLATEC).
I'm also using gentoo and the latest stable octave (2.1.57-r1):
emerge info
Portage 2.0.51-r13 (default-linux/x86/2004.0, gcc-3.3.5, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r5 i686)
=================================================================
System uname: 2.6.10-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.6.8
Python: dev-lang/python-2.2.3-r5,dev-lang/python-2.3.4 [2.3.4 (#1, Jun 5 2004, 10:35:17)]
ccache version 2.3 [enabled]
dev-lang/python: 2.2.3-r5, 2.3.4
sys-devel/autoconf: 2.59-r6, 2.13
sys-devel/automake: 1.8.5-r1, 1.8.5-r2, 1.4_p6, 1.6.3, 1.7.9, 1.9.4
sys-devel/binutils: 2.15.92.0.2-r2
sys-devel/libtool: 1.5.10-r2
virtual/os-headers: 2.4.22, 2.4.19-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.easynet.nl/mirror/gentoo/ ftp://mirror.pudas.net/gentoo ftp://trumpetti.atm.tut.fi/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X Xaw3d aalib alsa apache2 apm arts auctex avi berkdb bitmap-fonts bonobo cddb cdr crypt cups dvd dvdr emacs encode esd f77 fam fbcon firebird flac font-server foomaticdb fortran gcl gdbm gif gnome gpm gstreamer gtk gtk2 guile i8x0 imagemagick imlib ipv6 java jikes jpegjunit kde libg++ libwww mad mikmod mmx mmx2 motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl slang spell sse sse2 ssl svga tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts xine xinerama xml xml2 xmms xvzlib video_cards_radeon"
Unset: LDFLAGS, PORTDIR_OVERLAY
finally CFLAGS="-O2 -march=i686 -pipe" compiles a working version.
-O2 was not enough while keeping pentium4 and the other optimizations.
I was able to reproduce. Combining "-march=pentium4" and "-O3" (at least on my
machine) causes problems. I added a warning that will be printed when
installing the package, saying agressive "CFLAGS" can break octave, and
suggesting to run a sample ANOVA test to verify. Thanks to John and Joel for
their input.
I guess that's the best we can do unless someone wants to analyse specific
optimisations further on various machines and archs so we know what flags to
filter. Feel free to reopen if you're willing ;)