- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A Note About This Article
This article describes interesting technologies from the larger Fortran community. We have to note that the tools described below are not officially supported by Intel. We are providing this information for those who are interested in third-party tools available online that support the Intel Fortran compiler but are not produced or supported by Intel.
What Is This?
Visual studio code is an editor and integrated development environment (IDE). It is available for Windows, Linux, and macOS. This tool supports extensions to add capabilites. Extensions are available from the Microsoft Visual Studio Code Marketplace and can be added directly from the within the GUI. Extensions include support for multiple languages along with other editing, linting, and source analysis tools useful for programmers.
Modern Fortran is an extension to provide modern Fortran language support in VS Code. You can read about Modern Fortran's v3.1.0 release here.
In addition to Modern Fortran, other extensions add additional Fortran aware capabilities to VS Code:
fortls - Native Language Server integration
FORTRAN Intellisense - similar capabilities to IntelliSense in Visual Studio
Fortran Breakpoint Support - debugger breakpoint support
The Intel Fortran compilers for oneAPI, both ifort and ifx, are supported in this environment. Other features:
Key Features
- Syntax highlighting (Free and Fixed forms)
- Hover support, Signature help and Auto-completion
- GoTo/Peek implementation and Find/Peek references
- Project-wide and Document symbol detection and Renaming
- Native Language Server integration with
fortls
- Linting support: GNU's gfortran, Intel ifort and ifx, NAG's nagfor
- Interactive Debugger with UI
- Formatting with findent or fprettify
- Code snippets (more can be defined by the user see)
For my macBook Pro I used a handy guide to installation videos:
VS Code on macOS for C, C++, and Fortran Part 1
VS Code on macOS for C, C++, and Fortran Part 2
These are helpful since macOS requires manually installing xcode command line tools, Homebrew, gcc, gfortran, python3, and the fortls mentioned above. Windows and Linux I think are much easier to setup. Perhaps others can contribute links for each of Windows and Linux.
References
Here is a link to the Modern Fortran homepage.
You can find Modern Fortran in the Microsoft Marketplace for Visual Studio Code
Intel has some support for Intel(R) oneAPI with VS Code. This includes a sample browser for code samples in Sycl or Data Parallel C++. Nothing specifically for Fortran. Here is the link
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kudos for this post.
Visual Studio Code continues to be more and more important to the development of computational technologies and solutions in the industry with each passing quarter.
Extensions such as the Modern Fortran tooling for VS Code are extremely valuable. We would like to find the Modern Fortran tooling continuing to advance and evolve with VS Code and be maintained well. Formal support of some kind to such tooling from Intel will be most welcome and it can be a win-win for the Community as well as Intel as it can prove a strategically beneficial move to further boost the Fortran toolkit in Intel oneAPI.
Can you suggest if there are any options to convince Intel to officially support Modern Fortran tooling in VS Code, say dedicate some stuff and funding to enhance the effort?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Language Server integration
The Fortran Language Server fortls
is responsible for providing a lot of the higher level, IDE functionality. By default, Modern Fortran
will attempt to use it for hover, autocompletion, symbols and Go to & Peeking into definitions.
Allow for fortls
to be automatically installed with pip
or Anaconda
and if the location where fortls
is installed is not in your PATH
point VS Code to the fortls
location by setting
{
"fortran.fortls.path": "/custom/path/to/fortls"
}
For more about the Language Server's capabilities please refer to the documentation of fortls
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have also used Visual Studio code. What is nice about it, is that it can handle massive solutions with intellisense while remaining fully responsive. Using a project compiled using Visual C++ and Intel Fortran Classic, I am using the Fortran Intellisense and Modern Fortran extensions. Modern Fortran is definitely a good product. A couple of issues to be aware of:
- The CALL STACK does not show any Fortran methods. It does show the Fortran file and line number in the file.
- The WATCH window only sometimes works. But you can see variables if you expand the VARIABLES section and scroll down to the variable.
- No data breakpoints! ARG! Not even for Microsoft's C/C++ extension. Sometimes you seriously need data breakpoints...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm learning VB. I'm manually trying to change the colors of functions to improve readability according to my requirements. It's working fine but when I open new file then settings goes back to default settings. Please suggest me the exact solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>> No data breakpoints! ARG!
Data breakpoints are made using Fortran.
1) place a code breakpoint prior to when you wish to observe the data breakpoint. For example at the start of the procedure.
2) Run up to break point
3) Open the breakpoints window: Debug | Windows | Breakpoints
4) Pulldown New, click on data breakpoint
5) Enter: loc(yourVariableNameNere)
6) Continue
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might want to add error checking to the allocates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Additional notes on data breakpoints.
This should be obvious ...
Should you place a data breakpoint on a local variable (iow stack), and exit the procedure with that/those breakpoints active, those addresses are still live breakpoints. IOW remember to disable those breakpoints. This is a similar behavior to having a watch window referencing a variable that is out of scope.
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page