byteswap ifort question

Ryo Furue furue at HAWAII.EDU
Wed Jul 15 19:07:58 EDT 2009


Hi Jeff,

| When I compile a FORTRAN program using ifort, I need to add the
| command 'OPTIONS byteswapped' to the beginning of the ctl file to
| avoid getting NaN values.  Is there a compile line option with ifort
| that I can specify to avoid having to add the OPTIONS byteswapped
| command to my ctl file?

If you use a Linux/Unix version of the Intel Fortran compiler,
there is a compile-time option, which is used as

   $ ifort -convert big_endian yourprog.f90

Then, the resulting executable will ensure the big-endian
outputs for writing and will assume the big-endian ordering
for reading.  "-convert little_endian" is available, too.
The Windows version of the compiler should have corresponding
options.

There are also environment variables, such as F_UFMTENDIAN,
that control endianness, at run time.  Some of the env. vars.
work file by file.

Ryo



More information about the gradsusr mailing list