Operator Project Build

Overview

The custom operator project is built into a custom OPP runfile custom_opp_Linux_Arch.run.

Build the operator plugin implementation file, operator prototype definition file, and operator information library definition file into the corresponding operator plugin, operator prototype library, and operator information library. Figure 1 shows the build process.

Figure 1 Build flowchart

Windows OSs do not support local build.

Build Procedure

  1. In the MindStudio project window, select the operator project.
  2. Choose Build > Edit Build Configuration... on the top menu bar.
  3. Go to the Build Configuration dialog box. Click to add configurations. By default, the Release(default) build type is added. For details, see Table 1.
    Figure 2 Build Configurations dialog box
    Table 1 Parameter description

    Parameter

    Description

    Name

    Custom configuration name. The default value is Release.

    Build type

    Configuration type, which is optional. The default value is Release.

    Toolchain

    Toolchain configurator, which preconfigures a custom toolchain with the same architecture as the installed CANN package and supports local and remote build.

    You can click Manage toolchains…… to customize the toolchain. For details, see Toolchains.

    CMake options

    CMake option. The default value is -DCMAKE_BUILD_TYPE=Release.

    Build directory

    Relative path of the build directory, which is relative to the project directory.

    Build options

    Build acceleration option.

    Environment variables

    Environment variable configuration, which can be set before project build.

    You can manually configure the environment variables or click to configure them in the dialog box displayed.

    If the remote toolchain is used, a deployment is added by default. You need to configure environment variables.

    Enter the ASCEND_TENSOR_COMPILER_INCLUDE environment variable in the Environment Variables text box.
    ASCEND_TENSOR_COMPILER_INCLUDE=Ascend-CANN-Toolkit installation directory/ascend-toolkit/latest/include
  4. Click or choose Build > Build Ascend Operator Project to start the build.
  5. View the build result in the lower part of MindStudio. The custom OPP runfile custom_opp_Linux_Arch.run is generated in the cmake-build directory of the operator project.

    The value of Arch is obtained based on the CANN package and toolchain information.