Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!caen!uflorida!bernhold From: bernhold@red8 (David E. Bernholdt) Newsgroups: comp.lang.fortran Subject: Re: DEC System 5000 f77 bug Message-ID: <28913@uflorida.cis.ufl.EDU> Date: 3 Jun 91 16:45:42 GMT References: <1694@usage.csd.unsw.oz.au> <3627@charon.cwi.nl> Sender: news@uflorida.cis.ufl.EDU Organization: Quantum Theory Project, Univ. of Florida Lines: 49 In article <3627@charon.cwi.nl> dik@cwi.nl (Dik T. Winter) writes: >Of course, this does not help if you get code you will run; but than the >problem remains with other library (non-instrinsic) routines (eg, BLAS SAXPY >etc.). Some change of source is required anyhow. If you have access to (and are willing to use) a macro preprocessor of some sort, it can be quite helpful in simplifying precision changes for routines such as the BLAS, LAPACK, etc. with precision-dependent routine names. For example, I use C-preprocessor on unix systems. I have include files blas.h, linpack.h, etc. which are included at the beginning of any Fortran routine which uses a given library. The include files contain a macro definition for each double or double complex routine in the library mapping it onto the real/complex counterpart. The macro definitions are made only if an appropriate symbol is defined, so the macro definitions are used or not based on a single symbol definition. Then you code everything in one precision, and if you need the other, you run the preprocessor over it with the appropriate symbol definition. If you want to limit yourself to using only "include" preprocessing, you can get the same effect at the expense of a little extra discipline in coding. Instead of something like Call DAXPY(N, A, X, IX, Y, IY) you write include 'daxpy' $ (N, A, X, IX, Y, IY) with the include file containing the "Call DAXPY". Then to change precision, you substitute a set of files with the other precision routines. It's just an automated way of handling the source code changes, really, but I've found it quite useful. P.S. If anyone wants my CPP definitions for BLAS and LINPACK, I can save you the trouble of typing them all in. -- David Bernholdt bernhold@qtp.ufl.edu Quantum Theory Project bernhold@ufpine.bitnet University of Florida Gainesville, FL 32611 904/392 6365