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

default KIND command-line options for mixed Intel Fortran/MSVC compilation?

jgruendler
Beginner
380 Views
What I want to do:

I have a mixed-language Fortran and C program that I'm compling with Intel Fortran and MSVC. I want to change all the integers and floats to be 64 bits wide by default. For the Intel compiler, I can use the "-integer-size 64" and "-real-size 64" options; what are the equivalents for the Microsoft compiler? Or does it not have that capability, and I need to go buy the Intel C compiler instead?

Why I want to do such a silly thing anyway:

I'm trying to port a program to 64 bit, and having a problem because it passes memory addresses through COMMON as ints, mixed in with bunches of scalar REAL data, and accessed through hard-coded offsets strewn randomly through about a million lines of code. In other words, if the size of the pointers changed (as it would by going to 64-bit), nothing would line up anymore -- unless I also changed the size of everything else, namely normal INTEGERs and REALs, to match. Then, not only does everything line up (I hope), but I actually have to pad out some data structures an extra word which lets me widen some fields that were too small anyway!
0 Kudos
1 Reply
TimP
Honored Contributor III
380 Views

Your request isn't entirely unique, but no, the MS and Intel C compilers don't support an int-size option. Applications I have seen which put Cray pointers in COMMON generally need separate COMMON blocks for that purpose, in order to adjust them independent of INTEGER and REAL KIND, and they define special macros for the C data type associated with the Cray pointers.

Having C code access a Fortran COMMON hasn't generally been a successful way to port among platforms with various data type sizes. The simpler cases where I've seen it work allow for easy change of a typedef or such to make the C data types 32- or 64-bits as required. For example, all C compilers you would be likely to use along with 64-bit Intel Fortran support double and long long as 64-bit types.

0 Kudos
Reply