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

COMPILE/LINK Visual Studio 2022 -o8 -i8 -r8

bredsj
Novice
856 Views

I have old fortran code that I have compiled and linked successfully in Linux with IFORT using

 

ifort -O2 -i8 -r8 -assume byterecl -c xxx.f90

ifort -O2 -i8 -r8 -assume byterecl -c yyy.f90

ifort -O2 -i8 -r8 -assume byterecl xxx.o yyy.o  -o MyProg

 

I have now made a project in Visual Studio 2022 in WIN10 and .f90 code compile successfully, the linking however fails. I could figure out the directive -assume byterecl in VS, but I'll appreciate help on how to specify -O2 -i8 -r8

 

I am a novice with VS, so please pardon my ignorance.

Assistance will be highly appreciated.

Kind regards

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
849 Views

-O2 is the default from the command line. The Windows equivalent is /O2 or property Fortran > Optimize > Optimization > Maximize speed. This is the default in a Release configuration.

-i8 and -r8 are bad ideas and you shouldn't use them. If you must, the Windows equivalents are /integer_size:64 and /real_size:64. In Visual Studio these can be found on the Fortran > Data property page, selecting 8 for Default integer kind and Default real kind.

 

View solution in original post

2 Replies
Steve_Lionel
Honored Contributor III
850 Views

-O2 is the default from the command line. The Windows equivalent is /O2 or property Fortran > Optimize > Optimization > Maximize speed. This is the default in a Release configuration.

-i8 and -r8 are bad ideas and you shouldn't use them. If you must, the Windows equivalents are /integer_size:64 and /real_size:64. In Visual Studio these can be found on the Fortran > Data property page, selecting 8 for Default integer kind and Default real kind.

 

bredsj
Novice
812 Views

Thank you very much for your very fast response. I take note of the -i8 and -r8, I will compile/link without these two compiler directives. Part of the code that I use is legacy stuff, programmed in the 1960's. The instruction that I received was to use -i8 and -r8. I have now checked the source code again, I have converted the old Fortran to f90 and Implicit None was added, so all variables are now properly declared, all reals are kind=8.

Kind regards and thanks again, Steph

Reply