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

How to Compile and Run Intel FORTRAN & IMSL on Visual Studio Code

FORTRAN_DEB
New Contributor I
3,587 Views

Hello:

 

I just have been "given" the Visual Studio Code, and I have legacy FORTRAN programs that call IMSL math routines (in double precision) and have been developed on IV and F77.

I need to run my legacy codes and after Visual Studio Code has been installed, I can open and read my old legacy FORTRAN codes OK. No problem upto here.

Now what commands I use to run these legacy codes that were developed using FORTRAN IV and 77?  Will the legacy codes with the IMSL routines run smoothly? 

 

Partial listing of the subroutines calling IMSL legacy FORTRAN code is given below for perusal.

 

Please let me know how can I run these legacy codes now?  Any help would be greatly appreciated.

 

Deb  

==============================================================

PROGRAM MAIN
C
          INCLUDE 'link_fnl_static.h'
         !DEC$ OBJCOMMENT LIB: 'libiomp5md.lib'
C
C FIRST Created on 08/08/2016 for the URSI 2016 Symposium ON
C Electromagnetic Theory (URSI Commission B), Helsinki, Finland.
C
C LAST Compiled & Executed Error Free on **/**/****
C
          CALL OUTPUT
          STOP
         END
          :
          :
          :
          :
          :
 SUBROUTINE FSGFSOMM1(ZGFSOMM,WK)
          IMPLICIT NONE
          COMPLEX*16 ZGFSOMM,JJ,CF1,CF2,CF3,DCMPLX
          REAL*8 FUNC1,FUNC2,A,B,ERRABS,ERRREL,RESULT,ERREST,
     $FR,FI,WK
          INTEGER IRULE
          INTRINSIC DCMPLX
          EXTERNAL DQDAG,FUNC1,FUNC2
          JJ=DCMPLX(0.0D-000,1.0D-000)
          ERRABS=1.0D-008
          ERRREL=1.0D-008
C
C !!! Integration over the 1st region before branch point !!!
C
          A=0.0D-000
          B=8.5D-001*WK
          IRULE=2
          CALL DQDAG(FUNC1,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
          FR=RESULT
          CALL DQDAG(FUNC2,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
          FI=RESULT
          CF1=DCMPLX(FR,FI)
C
C !!! Integration over the narrow region including branch point !!!
C
C         A=B
C         B=1.15D-000*WK
C         IRULE=1 !!! Peak Singularity at the branch point !!!
C         CALL DQDAG(FUNC1,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
C         FR=RESULT
C         CALL DQDAG(FUNC2,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
C         FI=RESULT
C         CF2=DCMPLX(FR,FI)
          CF2=DCMPLX(0.0D-000,0.0D-000)
C
C !!! Integration over the tail region from branch point to infinity !!!
C
          A=B
          B=1.0085D+002*WK !!! replace infinite limit by large number !!!
          IRULE=6 !!! Oscillatory behavior over tail region !!!
          CALL DQDAG(FUNC1,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
          FR=RESULT
          CALL DQDAG(FUNC2,A,B,ERRABS,ERRREL,IRULE,RESULT,ERREST)
          FI=RESULT
          CF3=DCMPLX(FR,FI)                                            
          ZGFSOMM=CF1+CF2+CF3
          RETURN
          END        

 

Labels (3)
0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
3,454 Views

Hi Deb.

It's confusing, I know, but there are two different Microsoft IDEs: Visual Studio and Visual Studio Code. The former is Windows-only and includes Microsoft language tools such as Visual C++, while the latter is ONLY an IDE, is available also on Linux, and has a strong ecosystem of plugins. Intel Fortran installs only into Visual Studio. If all you have is Visual Studio Code, then that's not a supported environment for Intel Fortran. (It is possible to use Visual Studio Code with Intel Fortran if you ALSO have Visual C++ installed, but it requires third-party plugins.)

So, the first thing to figure out is which Visual Studio you have. Once we know that, we can go from there.

View solution in original post

25 Replies
Steve_Lionel
Honored Contributor III
690 Views

The .vfproj file is just the Visual Studio project information that says which source files are in the project and how they are to be built - it does not include the Fortran source files themselves. If they are not in the location the project thinks they are, you can delete the source file entries from the "Solution Explorer" in Visual Studio and re-add them.

As for IMSL, all I can tell you is based on 10-year-old knowledge.  There should be module files (.f90 files) that provide declarations, and one or more library files. You can just drag-and-drop them onto the Solution Explorer. You will want to read the current IMSL documentation to see if there are any settings to change.

0 Kudos
FORTRAN_DEB
New Contributor I
674 Views

Thank you Steve.  Is there a link to the current IMSL documentation to change any of the settings in my legacy FORTRAN codes? Similarly is there any documentation available which I need to read to run the FORTRAN on Visual Studio 2022?

I badly need this help.

- thanks,

Deb (chatd@umsystem.edu)

0 Kudos
mecej4
Honored Contributor III
651 Views

As is perhaps well known, there was no "Legacy Fortran Standard", so your "legacy Fortran" could be "avante-garde" for me. As a consequence, there can be no vague "just compile and run my old code and give correct result" option for any compiler.

When you ask a general question, you are unlikely to receive advice that is specific to your problem.

Given the limited information that you have provided as to your code, an AI tool such as Google's Gemini can give voluminous, irrelevant and even incorrect answers, and so can I. 

On a lark, I copy-pasted your "Thank you Steve ... -thanks," into Google's Gemini, and thereby confirmed my guess.

What is lacking is not documentation; your purchased IMSL would have come with access to voluminous reference manuals, and similar documentation is available for VS and Intel Fortran. Each of these manuals is longer than the Bible, and by the time that one reads just one of the manuals end-to-end, the contents will be out of date.

Either give a precise problem definition, or consider using an online tool such as Wolfram's Alpha, where you can type in your integrand and the range of integration and receive the answer immediately.

0 Kudos
Steve_Lionel
Honored Contributor III
609 Views

The vendor from whom you purchased IMSL will have documentation on how to use it with Intel Fortran. As for VS2022, see Installing Microsoft Visual Studio* for Use with Intel® Compilers

0 Kudos
El_Zorro_Oro
New Contributor I
508 Views

Hi FORTRAN_DEB,

 

Below is a tutorial that may get you stated with Visual Studio.  I use the free version, 2022 Community Edition.

The tutorial does not use libraries, but you should be able to figure that out, I hope.

This is all that I can do for now.

0 Kudos
Reply