Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Endian problem

vliegenj
Beginner
469 Views

Hello,

I'm having a problem with 3rd party data. It's written unformatted, with big endian. All our programs work on a little endian OS.

We're trying to write a module that can read in the big endian data, do some changes and write the output to disk in little endian.

When compiling we have to use the "-convert big-endian" option to read the input, but don't need it, to write the output.

Is there any trick that can solve this problem ?

Many thanks in advance

0 Kudos
1 Reply
TimP
Honored Contributor III
469 Views
Current ifort provides options to apply big-endian conversion to one file and not to another. There are both environment variable and OPEN keyword options, and more explanations in the doc files than could be repeated here. You would READ from the unit where you have set big-endian, and WRITE to a unit which is not so set. I would call this a trick only in the sense that it relies on compiler vendor-dependent facilities.
0 Kudos
Reply