在VS Code中使用 intel oneapi fortran 和c++

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

          }

        }

      ]

    }

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值