Rate This Document
Findability
Accuracy
Completeness
Readability

GitLab Pipeline Compilation Sample Code

To use BiSheng Compiler or GCC for openEuler capabilities, use the following sample code:

A-FOT (Configuration File Parameter Optimization)

stages:
  - build
  - test
  - deploy
source-code-migration:
  stage: build
  tags:
                # To use BiSheng Compiler capabilities, set tags to kunpeng_c_builder_bisheng_compiler.
    - kunpeng_c_builder_gcc # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
  script:
    - source "${HOME}"/.local/wrap-bin/devkit_NonInvasiveSwitching.sh
    - cd /home/test/build
    - make
    # A-FOT supports only GCC for openEuler. If the BiSheng compiler is used, delete the two lines of code:
    - echo '====== GCC for openEuler ======'
    a-fot '--config_file a-fot.ini'

/home/test/build indicates the project file path. make indicates the compilation command. Replace them with actual ones.

A-FOT (Command Line Parameter Optimization)

stages:
  - build
  - test
  - deploy
source-code-migration:
  stage: build
  tags:
                # To use BiSheng Compiler capabilities, set tags to kunpeng_c_builder_bisheng_compiler.
    - kunpeng_c_builder_gcc # This is the tag used during gitlab-runner registration. Multiple tags may be selected.
  script:
    - source "${HOME}"/.local/wrap-bin/devkit_NonInvasiveSwitching.sh
    - cd /home/test/build
    - make
    # A-FOT supports only GCC for openEuler. If the BiSheng compiler is used, delete the two lines of code:
    - echo '====== GCC for openEuler ======' 
    a-fot  '--opt_mode AutoFDO --gcc_path /usr --run_script /root/run.sh --build_script /root/build.sh --build_mode Wrapper --work_path ./ --bin_file /tmp/test'
  • /home/test/build indicates the project file path. make indicates the compilation command. Replace them with actual ones.
  • The optimization mode is AutoFDO, the GCC path is /usr, the application running script path is /root/run.sh, the application build script path is /root/build.sh, the build mode is Wrapper, and the script working directory is the current directory, and the executable binary path is /tmp/test. Replace them with the actual ones.