Interoperability

Describes CCE Fortran/Clang interoperability

Mixed-language programs that exchange long double data between Fortran and C or C++ object files will not work correctly on x86 targets. CCE Fortran assumes a 64-bit C_LONG_DOUBLE type, whereas Clang uses an 80-bit long double type padded to 128 bits of storage. To assist in making such programs work, the following options are available.

IMPORTANT: When using a non-default long double format, avoid passing the long double data to library functions which will continue to expect the default format.

-mlong-double-64
Make the x86 "long double" type equivalent to the "double" type. This type matches CCE Fortran C_DOUBLE or C_LONG_DOUBLE.
-mlong-double-128
Make the x86 "long double" type equivalent to the "__float128" type. This type matches CCE Fortran C_FLOAT128.
-mlong-double-80
Make the x86 "long double" type equivalent to an 80-bit floating-point type that is padded to 128 bits of storage. This option is the default.

Additionally, this Fortran option is relevant to interoperability.

-ffortran-byte-swap-io
Tell the Fortran runtime I/O subsystem to byte-swap input and output files for direct and sequential unformatted I/O. This is a link-time option to be used when linking with CCE Fortran object files.