Cross-Compilation Sample Program

  1. Go to the ${MX_SDK_HOME}/samples/mxManufacture/C++ directory.
    cd ${MX_SDK_HOME}/samples/mxManufacture/C++

    Modify the CMakeLists.txt file in the current directory and add the CANN link library path to link_directories.

    MX_SDK_HOME indicates the SDK installation directory. Replace it with the actual directory.

  2. Modify the run.sh file in the current directory, add the cross compilation tool before cmake, and comment out the following statement, as shown in the following figure.

  3. Run the script to perform cross compilation. If the main executable program is generated, the compilation is successful.
    bash run.sh