VSCOE安装必要fortran插件
python -m pip install fortran-language-server
setting搜索break,把Allow Breakpoints Everywhere打开,即可打断点。
新建文件夹name,新建hello.f90文件
program main
write(*,*) 'hello, world!'
end program
name下新建文件夹.vscode,.vscode新建文件
tasks.json
{
"version": "0.0.1",
"command": "ifort",
"args": [
"-g",
"${file}",
"-o",
"${workspaceRoot}/${fileBasenameNoExtension}.exe"
]
}
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}"
}
]
}