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

Dummies guide for migrating to 64-bit?

DavidWhite
Valued Contributor II
690 Views

Does anyone have a roadmap to help migrate existing 32-bit applications (both exe and dll's) to 64-bit?

What do I need to know?

What are the traps?

Until now, I have managed to avoid this, but one of my clients is using 64-bit MS Office, and cannot load my 32-bit DLL's, so I think I need to start migrating to 64-bit.

Thanks,

David

0 Kudos
4 Replies
bealeja
Beginner
690 Views

I am in the midst of this process myself.  

The biggest issue I've had so far are with pointers - for both inter-language binding and intra-language as well.

For instance, with callbacks which pass the address of the function, we use

INTEGER(LEN_ADDRESS), INTENT (IN ) :: iCallback

where LEN_ADDRESS is defined as

INTEGER, PARAMETER :: LEN_ADDRESS = INT_PTR_KIND()

Other than that, I don't think I've had to change any code.

Hope this is a start at least! :)

Cheers,

Jim

0 Kudos
Simon_Geard
New Contributor I
690 Views

The biggest change for us was the procedure decorations, for example

[fortran]

      subroutine set_buckle_results_strings(index, str)
!DEC$ ATTRIBUTES DLLEXPORT::SET_BUCKLE_RESULTS_STRINGS
#ifdef _M_X64
!DEC$ ATTRIBUTES ALIAS:'SET_BUCKLE_RESULTS_STRINGS'::SET_BUCKLE_RESULTS_STRINGS
#else
!DEC$ ATTRIBUTES ALIAS:'_SET_BUCKLE_RESULTS_STRINGS'::SET_BUCKLE_RESULTS_STRINGS
#endif

        use iso_c_binding
        implicit none
        integer(c_int), value, intent(in)        :: index
        character(kind=c_char,len=*), intent(in) :: str

[/fortran]

You'll need this if you pass strings between C and Fortran and don't want to use bind(c) because of the consequent restrictions.

I think there is more choice with mkl as well but if you're just migrating an existing 32-bit app then you probably don't need to worry about that.

Simon

0 Kudos
andrew_4619
Honored Contributor III
690 Views

!DEC$ ATTRIBUTES ALIAS, DECORATE::

Is better as the prefix and postfix decorations performed on it that are associated with the platform and calling mechanism that is in effect so no ifdef is required.

 

0 Kudos
Steven_L_Intel1
Employee
690 Views

Most Fortran code is relatively immune to address-size, but if you have calls to Windows APIs, or as mentioned in earlier replies, declare integers that are to hold addresses, you need to take care to use the correct integer kind and not blindly say INTEGER*4 (or even just INTEGER). Use HANDLE (from IFWINTY) or C_INTPTR_T (from ISO_C_BINDING) to get correct kinds. And yes, do use DECORATE when appropriate.

0 Kudos
Reply