Search code examples
fortran

Fortran: Are .mod files platform dependent?


If I compile a C/C++ program and run file my_binary it returns something like my_binary: ELF 64-bit LSB executable, x86-64.

But if I run file my_module.mod it returns my_module.mod: GLS_BINARY_MSB_FIRST and I have no idea of what this means.

I know .mod files serve more or less the same functionality as .h header files except they are binary. If I copied a .mod file generated on Linux to macOS, would it work? What about different CPUs?


Solution

  • Likely depends of the Fortran compiler. In general, no you cannot simply copy a *.mod from one architecture to another.