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

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

FORTRAN_DEB
Novice
1,500 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
1,369 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

19 Replies
mecej4
Honored Contributor III
1,465 Views

Visual Studio Code is just an editor/IDE. You need a Fortran compiler package, and a distribution of IMSL that is compatible with that compiler package. Which versions of Intel Fortran and IMSL do you have, if any?

Until about a decade ago, Intel used to sell IMSL as an optional add-on to Intel Fortran.

For the test code that you showed, the IMSL subroutines used appear to be the Quadpack quadrature routines. The source code of Quadpack is available from Netlib.

FORTRAN_DEB
Novice
1,418 Views

Thank you mecej4 for your response.  The system people here at UMKC  gave me a new machine and it had this Microsoft Visual Studio. It has a FORTRAN compiler and but I do not know other details.  I shall let you know all the details by Monday (04/29).

 

Please help me mecej4!  I remember you and Steve Lionel (who is retiring after 38 years) from  2016.

 

What I do not know is how to compile and run my old legacy FORTRAN codes on the new Microsoft Visual Studio Code.

 

Will keep in touch and need your blessings!

 

- thanks for responding,

 

Deb

 

0 Kudos
Steve_Lionel
Honored Contributor III
1,370 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.

FORTRAN_DEB
Novice
1,339 Views

Hi Steve,

 

Thanks for your response.  I have Visual Studio Code and not just Visual Studio.  So, now what are my options? Can I get the FORTRAN and IMSL compiler I want ASAP? If I have to download, where is it? Also me personally downloading will not be acceptable to our university bigwigs; they remove any "unauthorized" software even if it is legit, causing enormous inconvcenience.

Can you please let me know where can I get all the jazz. (I need to get the FORTRAN + IMSL installed and running ASAP. Like earlier, I have a conference where I need to present results - and this is in July.)

Thanks a lot again, in advance.

- Deb

0 Kudos
El_Zorro_Oro
New Contributor I
1,293 Views

Hi FORTRAN_DEB,

 

You can download Visual Studio from the web at:

https://visualstudio.microsoft.com/vs/community/

 

You can download the Intel(r)  oneAPI Base Toolkit and the  HPC Toolkit (among others) at:

https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#gs.8nvmx4

 

These are license free for a single user.  I was able to do this at LM, but I have elevated privilege (old super user).

 

I work in windows - not a lot of experience in Linux.

 

In a pinch I have learned to proceed as necessary and ask for forgiveness later :-). 

 

Good luck.  I will try to keep up with your posts.

0 Kudos
El_Zorro_Oro
New Contributor I
1,309 Views

Hi FORTRAN_DEB,

I suggest that you download and install Visual Studio 2022 Community version - free from Microsoft.

The Community version works well on my machine here at Lockheed Martin, no problems with the latest Intel Fortran.

Attached is a PowerPoint that I put together to help me remember tricks and traps in using Visual Studio (Not Visual Studio Code).

Hope this helps.

I have not tried to link external libs yet.

 

FORTRAN_DEB
Novice
1,302 Views

Thank you.  I shall follow the instructions in the pdf file you have attached.  One thing: Steve Lionel (to my same question) also replied that Microsoft Visual Studio Code will not accept FORTRAN, but Microsoft Visual Studio will.  My question is: will FORTRAN and IMSL both come together if I can download Microsoft Visual Studio and get rid of my existing Microsoft Visual Studio Code?  These changes are to be done in consent with the I-T people out here and I am just seeking as much as correct information to avoid any further intricacies that can put me in a difficult situation, since I am not a I-T person. 

 

Thanks a lot for the information.

 

- Deb

0 Kudos
FORTRAN_DEB
Novice
815 Views

`El_Zorro_Oro;

My system admin just downloaded and installed the Visual Studio 2022 Community Version. And the Visual Studio Code has been removed (Uninstalled).  But it does not have the FORTRAN compiler and the IMSL to run my FORTRAN legacy codes.  And yes it is free. My system admin says that the community version may not be suitable for the computations I require with FORTRAN.   

What are my options now that I am still back in square one?  Any pointers from anyone kind soul reading this post?

- Deb

0 Kudos
andrew_4619
Honored Contributor II
772 Views

Community it totally suitable for Intel Fortran but after you install VS2022 you need to install Fortran it is a separate FREE product. There is a stick thread on installation above. IMSL is also separate and is NOT FREE.

Michael_S_17
New Contributor I
507 Views

 

https://www.imsl.com/products/imsl-fortran-libraries/whats-new :

"The latest release of FNL includes several platform updates including RHEL 9, Intel oneAPI 2024.0 and support for the new oneAPI IFX compiler on several platforms."

 

https://www.imsl.com/free-trial :

"If you’re currently a student or instructor, IMSL offers free single seat and multi-seat licenses for classroom use."

FORTRAN_DEB
Novice
182 Views

Hi Michael_S_17:

Thank you for the links.  My system admin downloaded (after much sweat) Visual Studio 2022. We uninstalled thye Visual Studio Code, because Steve Lionel messaged me thyat Visual Studio Code will not be useful for IMSL FORTRAN and my legacy codses will not run.

 

I clicked on the links you have provided, and found that IMSL(R) FORTRAN NUMERICAL LIBRARY can be supported on Windows 11 operating system, which is what I have now.  So, here are my further questions:

(1) How can I make sure that Visual Studio 2022 indeed has the FORTRAN compiler compatible with Windows 11?

(2) How do I download the IMSL FORTRAN for free, since I am a faculty with the Faculty of Electrical and Computer Engineering her at University of Missouri at Kansas City?  What credentials I need to provide and toi whom?  I also need a single seat license. Can this free license for qualified faculty be extended for long time or is there a stature of limitation kind of stuff?

(3) Will this IMSL FORTRAN run  my legacy codes developed in FORTRAN IV and FORTRAN 77 ?

 

- thanks a lot for yoiur help.

Deb 

chatd@umsystem.edu

 

 

 

0 Kudos
andrew_4619
Honored Contributor II
1,270 Views

IMSL is a separate product if you want to use that it needs to be purchased.  MECEJ4 noted up-thread that "For the test code that you showed, the IMSL subroutines used appear to be the Quadpack quadrature routines. The source code of Quadpack is available from Netlib."

 

You could also consider minor rewriting to use Intel MKL if that has similar functions.

 

FORTRAN_DEB
Novice
1,241 Views

Hi Andrew,

 

It appears that IMSL costs (for a single seat) about $2700 (approx) from a reseller known as PERFORCE.  Roguewave has sold it.  I had Intel Visual FORTRAN that came in with IMSL and our system admin in their infinite wisdom just deleted that software and got Microsoft Visual Studio Code. I had earlier Microsoft Visual Studio. The system admins at the university deletes any software that maybe running which they consider as "illegitimate" - by their definitions.

I have Microsoft Visual Studio Code whoch does not take FORTRAN plus IMSL (F77).  My headache is how to access the IMSL FORTRAN that can run my legacy FORTRAN codes written in F77. (Rewriting is a valid option but not when I have a time crunch.)

 

El_Zorro_Orro has sent me a pdf notes which should be helpful.  I am going through it.  Hopefully I can get all your help and suggestions to have the original version of IMSL FORTRAN re-installed on my windows.

 

Will bug all you guys very frequently. 

 

- Deb 

0 Kudos
El_Zorro_Oro
New Contributor I
1,260 Views

Hi FORTRAN_DEB,

 

Just to be clear, Visual Studio and Visual Studio Code are just fancy editors.  The underlying source code is plain text.

 

If you have time the best is to get the source code and compile the routines that you need.

 

Be sure to use the Static option - see my notes -  if you want to run the .exe on another computer.

 

I use both since I want to see different sections of Code at the same time; VS Code has a protected mode where you can look but not touch, very convenient. 

FORTRAN_DEB
Novice
1,241 Views

Will bug you Zorro, when I run into problems with re-installation.

 

- Deb

0 Kudos
Steve_Lionel
Honored Contributor III
1,189 Views

Visual Studio (not Code) is much more than a fancy editor - it is also a build system and a debugger - the latter is very important! It also provides critical libraries and tools (from Visual C++) that Intel Fortran requires. You do not get Fortran debugging with VS Code.

Many years ago, Intel was able to sell IMSL bundled with Fortran, but the agreement between Intel and Rogue Wave was discontinued.

FORTRAN_DEB
Novice
179 Views

Hi Steve,

I have downloaded Visual Studio 2022 and uininstalled Visual Studio Code.  My problem is that I do not know if VS 2022 does come with any FORTRAN Compiler.  To that end, I have responsed to Michael_S_17 above, but if you could still chip in your responses/suggestions, it would still be much appreciated.

- thanks,

Deb

chatd@umsystem.edu

 

0 Kudos
Steve_Lionel
Honored Contributor III
114 Views

Visual Studio does not include Fortran, but it is required for installation of Intel Fortran. First, read Installing Microsoft Visual Studio* for Use with Intel® Compilers and make sure that you have selected the "Desktop Development with C++" component, which is not installed by default with Visual Studio.

Once you have done that, read the top post in Solved: The Easy and Fast Way to Install JUST Fortran with Intel® oneAPI - Intel Community to install Intel Fortran into Visual Studio.

0 Kudos
FORTRAN_DEB
Novice
74 Views

Thankios Steve.  Will do and keep you posted. May need more help later.

- best,

Deb

 

chatd@umsystem.edu

 

0 Kudos
Reply