For Programmers: Free Programming Magazines  


Home > Archive > Fortran > November 2007 > Re: Problem when creating a.out and -convert big_endian compiler









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Problem when creating a.out and -convert big_endian compiler
Steve Lionel

2007-11-22, 7:10 pm

On Nov 22, 2:44 am, andy271...@gmail.com wrote:

> Not completely sure why it works one way and not the
> other in your case, but as I understand the intel
> fortran compiler, the -convert bigendian compiler flag
> does nothing more than decorate your compile flag list
> unless you also have the environment variable set:
>
> setenv F_UFMTENDIAN big
>
> at run time.
>
> This is a rather annoying feature of ifort, if it is still
> the case.


It is not now and it has never been the case. There are multiple ways
to set the convert mode in ifort, and they all have an effect. -
convert big_endian is the same as specifying CONVERT='BIG_ENDIAN' on
all units that are opened (explicitly or implicitly) in the source(s)
compiled with that option. The F_UFMTENDIAN environment variable is a
way to change the behavior when you run the program, overriding what
was set at compile-time. There are also environment variables to set
this behavior on a per-unit basis.


Steve
Paul van Delst

2007-11-26, 7:17 pm

andy271828@gmail.com wrote:
> On Nov 22, 7:14 am, Steve Lionel <steve.lio...@intel.com> wrote:
>
> I stand corrected.
>
> I recall however, at some point early in my use of intel fortran, that
> I had difficulties with this, and specifically that -convert
> big_endian
> was not enough to get me going. Setting the env variable was as I
> recall.
>
> Since then I have always set both, and not had problems. Perhaps my
> early
> problems were due to some other origin. I cannot now recall, and
> certainly
> am willing to take you at your word on this matter.


Maybe for some reason there was a default init file somewhere that set F_UFMTENDIAN to
"little" in your shell? It should be easy enough to double check with a "echo
$F_UFMTENDIAN" on the command line. I had a colleague recently have a problem with ifort
(v9.1 I think) -convert big_endian on a linux box to read unformated sequential files
generated on a big-endian IBM. g95 -fendian-big worked fine, but the ifort compile always
generated seg faults reading the file. The debug values that were printed to screen were
the byte-swapped versions of the correct ones. It completely bamboozled me until your post
caused a glimmer of hope to appear through the crack in the old dome. (I forwarded it to
him to test).

For the record, I *always* use big-endian "format" files (since the IBM compiler doesn't
have a switch to read little-endian ones) and when I had an ifort license (for an intel
mac), I never had any problems with the "-convert big-endian" switch (or any other part of
ifort for that matter). The (third party) license manager was another story.... :o)

Anyway....

cheers,

paulv
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com