Rate This Document
Findability
Accuracy
Completeness
Readability

Command Parameter Description

The Source Code Porting tool analyzes the portability of software written in C/C++/ASM/Fortran/Go or an interpreted language.

Command Function

Displays all command parameters used for source code porting.

Syntax

devkit porting src-mig -h

Example

Run the following command to query the parameter descriptions of all commands.

devkit porting src-mig -h

The command output is as follows:

OVERVIEW
        Run this command to check and analyze source code files such as C, C++, ASM, Fortran, interpreted language, and assembly, locate the code to be migrated, and provide migration guidance.
    USAGE
        devkit porting src-mig -i,--input path-to-source-code -c,--cmd 'string of compiling command line' [-s,--source-type {c|c++|asm|fortran|go| interpreted}*] [-t,--target-os target-os] [-p,--compiler compiler-version] [-f,--fortran-compiler fortran-compiler-version] [-o,--output path-to-output] [-b,--build-tool {make,cmake,automake,go}] [-r,--report-type {all/json/html/csv}] [-l,--log-level {0/1/2/3} ] [--set-timeout time-limit-for-task] [--ignore path-to ignore-file] [--macro MACRO] [--keep-going {True,False}]
    OPTIONS
        -i, --input INPUT_PATH
            [Mandatory option] Specifies the folder or package path of the source code to be scanned.
        -o, --output OUTPUT_PATH
            Specify the path for storing the scan report and the file name. By default, the file is stored in the current path(pwd) and its name is in the format of function name_timestamp.
        -c, --cmd COMMAND
            Specifies the build command of the source code. If the source code to be scanned contains only interpreted languages, this parameter is optional.
        -s, --source-type {c|c++|asm|fortran|go| interpreted}*
            Specifies the type of source code to be scanned. The default value is 'c/c++/asm'
        -t, --target-os {centos7.6,neokylinv7u5,neokylinv7u6,deepinv15.2,ubuntu18.04.x,linxos6.0.90,linxos6.0.100,debian10,susesles15.1,euleros2.8,centos7.4,centos7.5,centos7.7,openeuler20.03,openeuler22.03,openeuler20.03sp1,openeuler20.03sp2,openeuler20.03sp3,centos8.0,centos8.1,centos8.2,uos20sp1,kylinv10sp1,kylinv10sp2,ubuntu20.04.x,uoseuler20,uos20-1020e,bclinux7.6,bclinux7.7,isoft5.1,openeuler22.03sp1,openeuler22.03sp3,uos20-1050e,uos20-1060e,kylinsecos3.4,kylinv10sp3} Specifies the target OS for migration. The default value is the operating system of the tool deployment node.
        -p, --compiler {bisheng_compiler2.1.0,gcc4.8.5,gcc4.9.3,gcc5.1.0,gcc5.2.0,gcc5.3.0,gcc5.4.0,gcc5.5.0,gcc6.1.0,gcc6.2.0,gcc6.3.0,gcc6.4.0,gcc6.5.0,gcc7.1.0,gcc7.2.0,gcc7.3.0,gcc7.4.0,gcc8.1.0,gcc8.2.0,gcc8.3.0,gcc9.1.0,gcc9.2.0,gcc9.3.0,gcc10.1.0,gcc10.2.0,gcc10.3.0}
            Specifies the compiler version used for compiling source code. The C/C++/ASM and GO languages share the same compiler version. The default value is the version of the compiler that comes with the target operating system.
        -f, --fortran-compiler {flang2.1.0, flang2.3.0, flang2.4.0, flang2.5.0, flang2.5.0.1, flang3.0.0, gfortran7, gfortran8, gfortran9}
            Specifies the version of the compiler that compiles the fortran source code. The default value is flang2.5.0.1
        -b, --build-tool {make,cmake,automake,go}
            Specify the building tool. The default value is make.
        -l, --log-level {0,1,2,3}
            Specifies the log level of the current task, 0(DEBUG) | 1(INFO) | 2(WARNING) | 3(ERROR). The default value is 1(INFO).
        -r, --report-type {all,json,html,csv}
            Specify the report type for the scan report. The default value is all.
        --set-timeout <min>
            Specifies the timeout period of a task. By default, the timeout period is not set.
        --ignore [CONFIG_PATH]
            Masking scanning rule items. By default, the ignore.json file in the tool path is read. You can specify the path of the masking rule configuration file.
            The path of the configuration file (ignore_rules.json) is  {install_path}/porting/ignore_rules.json
            Enter the keywords to be filtered in the source code in src_list and dependency file names to be filtered in lib_list. For instance,
            {
                'src_list': [' -march', ' -mpopcnt'],
                'lib_list': ['libz.so']
            }
        --macro MACRO         Custom x86 macro. Use semicolons (;) to separate multiple macros.
        --keep-going {True,False}    The values of Continue scanning with keyword arm/arm64/aarch64.
    EXAMPLE
        # Scan C/C++ Project and generate scanning reports
        devkit porting src-mig -i /home/porting/cplusproject -s 'c,c++,asm' -b make -c 'make all' -p gcc4.8.5
        # Scan Java/Python Project and generate scanning reports
        devkit porting src-mig -i /home/porting/javaproject -s 'interpreted'
        # Scan Fortran Project and generate scanning reports
        devkit porting src-mig -i /home/porting/fortranproject -s 'fortran' -b make -c 'make all' -f gfortran9
        # Scan Go Project and generate scanning reports
        devkit porting src-mig -i /home/porting/goproject -s 'go' -b go -c 'go build'
        # Scan Java/Python projects that contain C/C++ source code and generate scanning reports.
        devkit porting src-mig -i /home/porting/javaproject -s 'c,c++,asm,interpreted' -b make -c 'make all' -p gcc4.8.5
        # Scan the C/C++ project that contains the Fortran source code and generate scanning reports.
        devkit porting src-mig -i /home/porting/cplusproject -s 'c,c++,asm,fortran' -b make -c 'make all' -p gcc4.8.5 -f gfortran9