vscode 配置Intel oneapi fortran
1. 安装Intel oneapi扩展
搜索 Intel® oneAPI Toolkits 全部安装
配置 Analysis Configurator for Intel® oneAPI Toolkits
配置 Environment Configurator for Intel® oneAPI Toolkits
会提示选择激活环境配置,选择默认就行,下面这样就是配置好了
2. Modern Fortran
fident fortls 没有的话,使用pip 安装一下。
1.3 .vscode文件夹中的内容
launch.json
{
"version": "0.1.0",
"configurations": [
{
"name": "(gdb) Fortran",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode":"gdb",
"miDebuggerPath": "H:\\Intel\\oneAPI\\debugger\\2023.2.0\\gdb\\intel64\\bin\\gdb-oneapi.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "compile"
}
]
}
task.josn
{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "ifort",
"args": [
//"",
"${file}",
"-o",
"${workspaceRoot}\\${fileBasenameNoExtension}.exe"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
vscode 配置Intel oneapi c++
1. 安装Intel oneapi扩展
同上
2. 安装C/C++扩展
点击编辑,添加
"C_Cpp.default.compilerPath": "H:\\Intel\\oneAPI\\compiler\\latest\\windows\\bin\\intel64\\icl.exe",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.cStandard": "c17"
注意,有事可能会报错说icl 不可用,可能是因为oneapi环境没有激活,激活之后,就可正常使用。
1.3 .vscode文件夹中的内容
c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "${default}",
"compilerPath": "H:\\Intel\\oneAPI\\compiler\\latest\\windows\\bin\\intel64\\icl.exe",
"cStandard": "c17",
"cppStandard": "c++17"
}
],
"version": 4
}
launch.json
{
"version": "0.1.0",
"configurations": [
{
"name": "(gdb) cpp",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode":"gdb",
"miDebuggerPath": "H:\\Intel\\oneAPI\\debugger\\2023.2.0\\gdb\\intel64\\bin\\gdb-oneapi.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "compile"
}
]
}
task.josn
{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "cl",
"args": [
//"",
"${file}",
"-o",
"${workspaceRoot}\\${fileBasenameNoExtension}.exe"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}