From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,770d09ab025f2ec9 X-Google-Attributes: gid111c93,public From: andi@complang.tuwien.ac.at (Andreas Krall) Subject: Re: DU <--> Linux FP exceptions with DU binaries Date: 1999/01/19 Message-ID: <782mmd$jci$1@news.tuwien.ac.at>#1/1 X-Deja-AN: 434510776 References: <781meq$12mi@rzurs10.unizh.ch> Content-Type: text/plain; charset=us-ascii Organization: Vienna University of Technology, Austria Mime-Version: 1.0 Newsgroups: comp.os.linux.alpha In article <781meq$12mi@rzurs10.unizh.ch>, noe@physik.unizh.ch (Norbert Paschedag) writes: > Hi, > > I have a question for the more experienced Fortran users : > > We're trying to run DU binaries (Dec F90) on our Linux machines. Under both > Digital UNIX and Linux we experience floating point exceptions which > appear due to FP underflows etc. In my C-source code I use under Linux and Digital Unix I use the following: #ifdef __osf__ void init_exceptions(void) { #else /* Linux */ /* Linux on Digital Alpha needs an initialisation of the ieee floating point control for IEEE compliant arithmetic (option -mieee of GCC). Under Digital Unix this is done automatically. */ #include extern unsigned long ieee_get_fp_control(); extern void ieee_set_fp_control(unsigned long fp_control); void init_exceptions(void) { /* initialize floating point control */ ieee_set_fp_control(ieee_get_fp_control() & ~IEEE_TRAP_ENABLE_INV & ~IEEE_TRAP_ENABLE_DZE /* & ~IEEE_TRAP_ENABLE_UNF we dont want underflow */ & ~IEEE_TRAP_ENABLE_OVF); #endif } Try a similar initialisation using the FORTRAN equivalent. Andi -- andi@complang.tuwien.ac.at Andreas Krall http://www.complang.tuwien.ac.at/andi/ Inst. f. Computersprachen, TU Wien tel: (+431) 58801/18511 Argentinierstr. 8/4/1851 fax: (+431) 58801/18598 A-1040 Wien AUSTRIA EUROPE