简体   繁体   English

为 Linux 环境构建 C++ 代码,使用英特尔 C++ 编译器在 Z3A580F142203677F1FZBOps30F8 构建管道中

[英]Build C++ code for Linux environment with Intel C++ compiler in Azure DevOps build pipeline

I'm seeking advice on how to build C++ code for Linux environment with Intel C++ compiler in Azure DevOps build CI pipeline. I'm seeking advice on how to build C++ code for Linux environment with Intel C++ compiler in Azure DevOps build CI pipeline. It's a common practice if using gcc instead of Intel C++ compiler.如果使用 gcc 而不是英特尔 C++ 编译器,这是一种常见的做法。 But when it comes to Intel c++ compiler, any advice to have a license (either named user or floating) integrated into the build process?但是对于英特尔 c++ 编译器,有什么建议可以将许可证(命名用户或浮动)集成到构建过程中?

Advice is appreciated!建议表示赞赏!

But when it comes to Intel c++ compiler, any advice to have a license (either named user or floating) integrated into the build process?但是对于英特尔 c++ 编译器,有什么建议可以将许可证(命名用户或浮动)集成到构建过程中?

For your scenario, it's recommended to use Self-hosted agent instead of Hosted agent .对于您的方案,建议使用自托管代理而不是托管代理

Here's the list of preinstalled software in Microsoft-Ubuntu-hosted agent, we can find that it doesn't contain the Intel C++ compiler.这是 Microsoft-Ubuntu 托管代理中预装软件的列表,我们可以发现它不包含 Intel C++ 编译器。 So hosted agent doesn't have the environment to use Intel C++ compiler.所以托管代理没有使用英特尔 C++ 编译器的环境。 Now you need to install linux self-agent in one of your local machines which has the Intel C++ compiler environment.现在您需要在一台具有 Intel C++ 编译器环境的本地计算机上安装 linux 自代理

Note: Self-hosted agents give you more control to install dependent software needed for your builds and deployments.注意:自托管代理让您可以更好地控制安装构建和部署所需的依赖软件。

Here're some steps for you:这里有一些步骤:

Step 1: Download and install the Intel® Parallel Studio XE for Linux or Intel® System Studio for Linux .第 1 步:下载并安装适用于 Linux 的Intel® Parallel Studio XE for LinuxIntel® System Studio for Linux (Make sure you choose the correct edition and correct version) (确保选择正确的版本和正确的版本)

Step 2: Download and install the Linux self-hosted agent.第 2 步:下载并安装 Linux 自托管代理。

Step 3: Choose your self-agent to run the pipeline.第 3 步:选择您的自我代理来运行管道。 So your pipeline will execute in your local environment which has Intel C++ compiler.因此,您的管道将在具有英特尔 C++ 编译器的本地环境中执行。

Step 4: Use command-line tasks instead of normal build tasks in your pipeline like CMD task , bash task or Powershell task to invoke the compiler from the command-line.第 4 步:使用命令行任务而不是管道中的常规构建任务,例如CMD 任务bash 任务Powershell 任务,以从命令行调用编译器。 See Option 1: Use the Command Line :请参阅选项 1:使用命令行

  • For C source files: icc helloworld.c对于 C 源文件:icc helloworld.c
  • For C++ source files: icpc helloworld.cc对于 C++ 源文件:icpc helloworld.cc

This repo has sample configuration files using intel compilers in Azure DevOps: https://github.com/oneapi-src/oneapi-ci此 repo 在 Azure DevOps 中有使用 intel 编译器的示例配置文件: https://github.com/oneapi-src/oneapi-ci

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM