On 2008-08-11 22:09+0100 Andrew Ross wrote: > > I've been testing the fortran examples using a rather old version of > ifort (8.1) on 64-bit linux. In order to get the examples to compile and > run I encountered two issues > > 1) Example 20 requires the -assume byterecl flag to ifort in order to > get byte length records. Otherwise reading lena.pgm fails with an error. > This is in accord with the comment in the example. > > 2) Example 21 requires the -O0 flag, otherwise the compiler optimises > away the test (x.ne.x) in the function myisnan. > > For 1) it would be nice to automatically add this option if ifort is > detected. For 2) the flag to turn off optimisation is a bit of a fix. > ifort does have an isnan intrinsic (along with many other compilers) > which we could use instead. This requires some extra cmake logic though. > > Any suggestions?
(1) Normally, I believe it should be the user's responsibility to set the flags appropriate for their compiler. So what happens if you simply use FC='ifort -assume byterecl' ? If that works for all examples without messing them up, then perhaps we should recommend that ifort option in the wiki along with an explanation that example 20 requires byte-length records. That seems simpler to me than detecting ifort and fooling around with a special compile option for example 20 for that compiler. However, I don't feel strongly about it so do what you think is best. (2) I think your idea of detecting whether the isnan intrinsic is available is a good one since -O0 does seem like a workaround. Most of the work is already done using the CheckFortranFunctionExists.cmake file for CMake-2.6.0 (which I know about since I wrote the first version of it for the FreeEOS project). For now, we can simply copy that file from CMake-2.6.0 modules to our cmake/modules directory so that those with 2.4.8 can still use PLplot. > > After these two changes I get the following with ifort 8.1 (64-bit) > > f77 > Missing examples : 26 > Differing examples : 20 21 23 > f95 > Missing examples : 24 25 26 27 > Differing examples : 20 21 > > With gfortran 4.1 on the same machine I get > > f77 > Missing examples : 26 > Differing examples : 20 23 > f95 > Missing examples : 24 25 26 27 > Differing examples : 20 > > For example 21, some of the differences are just rounding errors. I do > however see some additional line at the end like. This is from plot3d. > I also see similar extra lines from the java and octave versions on a > different machine, so again I suspect a rounding error. I am going to have a look at ndiff (http://www.math.utah.edu/~beebe/software/ndiff/) which is advertised to ignore rounding errors. I will report back later on its suitability for our ctest needs. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel