I am a Windows user and I use intel one api fortran with visual studio integration. Is there any advantage to using visual studio code instead of visual studio as IDE? I have seen that VSC is very popular among Fortran users but I have found it quite cumbersome to make it work in Fortran (especially to do interactive debugging). Does VSC offer extra functiinality that VS does not provide?
Iām in exactly the same situation, and right now, the big advantage of Visual Studio vs VSCode is, as you mention, the debugging capabilities with intel compilers.
On the other side, VSCode offers the use of the Moder Fortran pluging which is wonderful to navigate through the source code with ease. Also, WSL integration in VSCode is as easy as it can get, so if you need to do cross-platform and cross-compilers compilation/verification. VSCode is your best friend. MVS2022 has an easier integration to WSL compared to the previous versions but it is still kind of cumbersome compared to VSCode.
Oh, I forgot a big one, MSV(all versions) has an annoying lag the moment you work on a file with more that 1400 lines (+/- 100). Which for some reason in C++ you donāt seeā¦ and this alone has made many people want to drop Fortran.
@hkvzjal we have tested sample Fortran file with 1400 line and didnāt observe the lag.
Please attached the entire VS solution test case for us at Intel to test and investigate a ālagā if any.
Hi @devorah I canāt share here the VS project as it is a proprietary closed-source project with many Gbs worth of source code ā¦ Let me correct my lack of precision: A newly generated project will respond just fine, the issue is that, as one compiles and recompiles, create new functions, the āBrowse.VC.dbā database gets bigger and bigger. This makes sense, but quite fast Iām obliged to destroy the database by hand or destroy and regenerate the project in order to regain fluidity when editing large files. We have not observed that with C++ having also >thousands worth lines of code.
This issue is not new:
I was working with MVS2019 until recently, now Iām testing MVS2022 17.4.5 to see if the issue has improved. If I reproduce it again Iāll create a ticket under intelās platform.
The Visual Studio integrations with the Intel Fortran compiler are just terrible and have been for years. It should embarrass Intel, but they donāt seem to care. Visual Studio Code with the Modern Fortran extension is better in every possible way (and cross platform).
The only thing I use Visual Studio for now is to click the ācompileā button, and to use the Intel debugger (which is great, and not available in VSCode). Otherwise, all my editing is done in VSCode.
Yes, all the abovementioned cases are with older, some no longer supported versions of VS.
I would like to see if VS 2022 editing experience is improved, the same or worse. I also would like to have a sample VS solution and exact steps to reproduce the slow editing issue reported here.
Regarding the debugger, I also like the Intel debugger, is great. I tried to make a debugger work in VScode but I didnāt manage.
It would be extremely useful if someone could post a step-by-step guide on how to install VScode with a Fortran compiler (ifort or gfortran), have the modern fortran extension and a tool for setting breakpoints, etc.
I think VScode and Modern Fortran are great but in order to use them properly one has to suffer a high learning cost (and I consider myself a relatively experienced Fortran programmer). It would make sense to invest into āeasingā the learning curve for Fortran users who are not computer scientists
This is useful but it would be interesting to see how to debug using fpm instead of a Makefile. Probably not too many changes are required in the configuration.
I usually have a build script that I call instead of make in the tasks.json. my build script does an fpm install and then in the launch.json I run the āinstalledā executable.
Iāll try to share an example of my setup in the next days.
My understanding is that using the Intel debugger on Windows in VScode is not possible. Weāve been told in the past that the debugger is sort of a hack of the Visual Studio debugger and isnāt available in any kind of standalone way for use in other IDEs. Someone please correct me if Iām wrong.
I have just discovered an extension for Visual Studio which allows the user to open the currently open file in VS Code as well. This seems to me to be really useful especially if I ever manage to get fortls working! I have been using Visual Studio for so long that I am finding the migration to VS code quite difficult, especially at the level of project and solution management, and, as others have mentioned, debugging.
Iāve added an example of dev environment setup for a toy project I already had on GitHub here: GitHub - ludnic/command-pattern
The project itself was a very simplistic task implemented in an overly complex way (for the nature of the task) so itās not a good example for debugging but it serves the demo purpose.
There 2 things that are nicely integrated with vscode I think: one is sharing a containerised development environment that should make reproducing software setup very straightforward. The second is what I mentioned above about the way of building with fpm and running the debugger as in the YouTube video by Lukas Lamm.
It may not be available for VS2019. I am using v17. 7.6
āOpen in Visual Studio Codeā v1. 4.58 dated 26/10/2023, see also github OpenInVsCode.
Good luck
Post your experiences, other may find it useful too!
Hey guys, I am one of the authors of the vscode extension. I would say that the changes between the 2 are numerous and so cumbersome to enumerate, so I think I will skip that for now.
What I would suggest to keep this discussion constructive is to go to our GitHub repo (GitHub - fortran-lang/vscode-fortran-support: Fortran language support for Visual Studio Code) and scroll through the existing issues and see if you have any ideas on how to improve things (feature wise). You also file new Issues features/bugs just please make sure to not spam us with duplicates or questions (questions can be posted on Discourse with the help vscode tag).
To be clear I donāt expect anyone here to contribute code to resolve any of the existing Issues, but if you really want to donate your time I would be more than glad to onboard you in the project, discuss solutions and review your code.
As I mentioned earlier this week in another post here on Discourse
There is already a half-finished Pull-Request on GitHub that would dramatically improve Python integration with Modern Fortran, especially on Windows
If you feel like helping by brainstorming please be respectful, concise, look through existing and closed Issues and provide good descriptions your requests.
Yes, I have successfully under Linux (and in the past with MacOS, although not the case anymore). You just need to point in the launch.json file to the Intel GDB.
In Windows however thatās not possible, (last I checked which was a while back). The debug adaptor we inherit by the C/C++ vscode extension does not work with intel compilers.
The issue with slow editor response reported here and on Intel Fortran Forum is fixed in the next 2024.1 Intel HPC Toolkit release.
Please note, the fix is based on the test case provided here
If your case is different from the above please submit it here and tag me. Thank you.