In the Windows Scenario
If the local Windows time is later than the time of the remote compilation environment, adjust the time to make them consistent. Then, choose on the toolbar to perform incremental build.
Building an Application Project
- If the new project is of the Python version, you do not need to build the project. In this case, on the MindStudio project page, is dimmed and cannot be used.
- During remote build, the project folder is copied to the remote environment, excluding the dump, model, and profiling directories in it.
- Before build, confirm the environment variables in the set_env.cmake file under the project directory and replace the installation paths of the CANN and MindX SDK software packages.
- (Optional) Modify the src/CMakeLists.txt file in the project directory.
- include_directories: Add the directories of the header files to be included.
The following is an example.
include_directories( directoryPath1 directoryPath2 )
- link_directories: Add the directories of the library files to be linked with.
The following is an example:
link_directories( directoryPath3 directoryPath4 )
- add_executable: Add the directory of the .cpp file.
The following is an example:
add_executable( main directoryPath5 directoryPath6 )
- target_link_libraries: Add the library files on which application build depends.
The following is an example:
target_link_libraries( main ascendcl libName1 libName2)
- install: Install the build output main to a specified path.
The following is an example.
install(TARGETS main DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
- include_directories: Add the directories of the header files to be included.
- (Optional) Specify CMakeLists.txt as the configuration file for project build.
Find the CMakeLists.txt file in the directory on the left of the project page, right-click the file, and choose Load CMake Project from the shortcut menu to specify it as the configuration file for project build, as shown in Figure 1.
- Set build configurations.
On the MindStudio project page, choose from the top menu bar. For details, see In the Windows Scenario (the figure shows a configuration example).
- Click
to add a configuration. - The configuration option marked with (default) in the list is the default one. To switch the default option to a custom option, select the custom option and click
. For details about the toolchain configuration, see Toolchains. - Click OK to save the configuration.
Figure 2 Build configuration
- Click
- Select one of the following build methods based on the application scenario on the MindStudio project page. For details about how to switch the default configuration option, see 3.
- Choose and clear build configurations. (The Clean CMake Project function supports only local build.)
- Choose to use the default configurations for incremental build.
- Choose or click
on the toolbar to use the default configurations for incremental build.
Running an Application Project
- During remote running, the project folder is copied to the remote environment, excluding the dump and profiling directories in it.
- For a Python project, add an SSH Interpreter and select a remote environment interpreter in the run configuration to run the project remotely. For detailed configuration, see Python SDK Dependency Settings.
- On the MindStudio project page, choose from the top menu bar.
- Click + in the upper left corner, choose CMake Application, and create and configure the run parameters of the application project. Figure 3 shows a configuration example.
Table 1 Run configuration options Configuration Option
Description
Executable
Select the path of the executable file used for compilation to the last level.
Program arguments
Run parameters.
Working directory
Working directory. (If a relative path is configured in the project, you need to select a relative working directory.)
Environment variables
Enter the path of the dynamic load library (DLL).
You can also click
, and click
on the displayed page. Then, enter the path. - On the MindStudio project page, choose Run > Run... from the top menu bar.
In the dialog box displayed, select the created run configuration and run the application.
- If no error message is displayed and the message "Running *** finished" is displayed, the execution is complete.
- If an error message is displayed during application execution, check the detailed logs of the operating environment. For details, see the Log Reference.
- The default log path is $HOME/ascend/log. For details, see the "Log Files" section.
- The default log level is ERROR. For details about how to query or change the log level, see the "Log Level Setting" section.

