Tuesday, July 1, 2008

Fortran question

I'm building and running LSSolver, but there are some problems interfacing the linking code in ls.f90 with the various Fortran sources (from TOMS and for the Student-t inverse, for example) on Linux.

Yes, for these older fortan codes you may need to add/real_size:64, -r8, /autodouble or something similar to the command line to set the default real size. I think all fortran compilers have a flag like that so you don't have to edit all declarations.

Here is a list for some compilers:

  • Visual Fortran: /real_size:64
  • Intel Fortran: -real-size 64 (linux) or /real-size:64 (windows)
  • Lahey/Fujitsu Fortran: -dbl
  • gfortran: -fdefault-real-8
  • g95: -r8
  • IBM XL Fortran: -qrealsize=8
  • SUN Fortran: -xtypemap=real:64