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

Connecting Intel Visual Fortran to Matlab

pej_jones
Beginner
561 Views
I have a piece of code that was written that requires the /4R16 compile option to run correctly. There is now another user that needs to use this code but he has the Intel Visual Fortran compiler connected to Matlab and runs through there. The problem is that we can't figure out how to set the /4R16 compile option in that environment. Does anyone have any ideas on this?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
561 Views
/4R16? That looks like a Microsoft Fortran PowerStation option in syntax but FPS never had that - /4R8, yes.

This would be Fortran > Data > Default Real Kind > 16

I suggest you triple-check that that's what you really want. I have a hard time believing that MATLAB would use this.
0 Kudos
pej_jones
Beginner
561 Views
/4R16? That looks like a Microsoft Fortran PowerStation option in syntax but FPS never had that - /4R8, yes.

This would be Fortran > Data > Default Real Kind > 16

I suggest you triple-check that that's what you really want. I have a hard time believing that MATLAB would use this.

I have Visual Studio 2005 Profesional Edition with Intel Visual Fortran V10. I had a problem with the MOD statement giving me the wrong answer. At first I thought it was a bug in the compiler so I reported it to Intel Premier Support and they were the ones who told me to use the /4R16 compile option. Well that worked and I now get the correct answer from MOD(2e7,3.1).

I just double checked and yes the /4R8 option does work. So how do we use/set this option for the Intel Visual Fortran compiler when it is inside of Matlab?
0 Kudos
Steven_L_Intel1
Employee
561 Views
I can't help with "inside Matlab". But let me suggest that you have unreasonable expectations from MOD(2e7,3.1). 2e7 is a single-precision value good to only about six decimal digits. You're already losing precision with a value as large as 2E7. If you want this to be double precision, rather than elevating all reals to double (which you can do with the /real_size:64 option from the command line), write it as MOD(3D7,3.1D0) instead. That will get you double precision for this computation.
0 Kudos
Reply