Skip to content

Debugging commands and oneAPI vscode extension #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"eamodio.gitlens",
"tamasfe.even-better-toml",
"fortran-lang.linter-gfortran",
"intel-corporation.oneapi-environment-configurator"
]
}
81 changes: 81 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{ "version": "0.2.0",
"configurations": [
{ "name": "(gdb) Launch main program",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/vscode/bin/${workspaceFolderBasename}",
// Optional arguments here:
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "fpm: install"
},
{
// Launch the open program in the app directory
"name": "(gdb) Launch open program",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/vscode/bin/${fileBasenameNoExtension}",
// Optional arguments here:
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "fpm: install"
},
{
// Launch the open test program
"name": "(gdb) Launch this Test",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/vscode/test/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "fpm: test Single File"
}
]
}
91 changes: 91 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Set Environment",
"type":"shell",
"command": "export FPM_FC=gfortran",
},
{ "label": "fpm: install",
"type": "shell",
"command": "fpm",
"args": [
"install",
"--compiler", "gfortran",
"--c-compiler", "gcc",
"--profile",
"debug",
"--flag", "-Og",
"--prefix",
"${workspaceRoot}/build/vscode",
],
"group": {
"kind": "build",
"isDefault": true
},
// Enable if using the intel OneAPI compiler
// "dependsOn": ["Setup OneAPI"]
},
{ "label": "fpm: install example",
"type": "shell",
"command": "fpm",
"args": [
"run",
"--profile",
"debug",
"--example",
"demo",
"--runner",
"'install -b -m 0711 -p -t ./build/'"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{ "label": "fpm: test Single File",
"type": "shell",
"command": "fpm",
"args": [
"test",
"--target",
"${fileBasenameNoExtension}",
"--profile",
"debug",
"--runner",
"cp",
"--",
"${workspaceFolder}/build/vscode/test/"
],
"group": {
"kind": "test",
"isDefault": true
},
"dependsOn": ["Copy Directory Structure"],
"dependsOrder": "sequence"
},
{ "label": "Copy Directory Structure",
"type": "shell",
"options": { "cwd": "${workspaceFolder}/test" },
"linux": {
"command": "find",
"args": [
".",
"-type",
"d",
"-exec",
"mkdir",
"-p",
"--",
"${workspaceRoot}/build/vscode/test/{}",
"\\;"
]
}
},
{ "label": "Setup OneAPI",
"command": "${command:intel-corporation.oneapi-environment-configurator.initializeEnvironment}"
},
]
}