当前位置:   article > 正文

VSCODE配置fortran调试环境(INTEL)_vscode里扩展找不到fortran configuration

vscode里扩展找不到fortran configuration

VSCOE安装必要fortran插件

在这里插入图片描述
python -m pip install fortran-language-server

setting搜索break,把Allow Breakpoints Everywhere打开,即可打断点。
在这里插入图片描述

新建文件夹name,新建hello.f90文件

program main
  write(*,*) 'hello, world!'
end program
  • 1
  • 2
  • 3

name下新建文件夹.vscode,.vscode新建文件

tasks.json

{
    "version": "0.0.1",
    "command": "ifort",
    "args": [
        "-g",
        "${file}",
        "-o",
        "${workspaceRoot}/${fileBasenameNoExtension}.exe"
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

launch.json

{
    "version": "0.0.1",
    "configurations": [
        {
            "name": "Fortran Launch (GDB)",
            "type": "cppdbg",
            "request": "launch",
            "targetArchitecture": "x86",
            "program": "${workspaceRoot}\\${fileBasenameNoExtension}.exe",
            "miDebuggerPath": "/usr/bin/gdb",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "externalConsole": true,
            "preLaunchTask": "ifort"
        },
        {
            "name": "Intel Debug Attach",
            "type": "cppvsdbg",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ] 
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

VSCODE-FILE打开文件夹name,先RUN BUILD 再RUN DEBUG即可调试。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/793279
推荐阅读
相关标签
  

闽ICP备14008679号