Rate This Document
Findability
Accuracy
Completeness
Readability

Performing Porting Analysis

Before porting software from the x86 platform to the Kunpeng server, perform a porting analysis using the Kunpeng Porting Advisor or a custom script. Then proceed with porting based on the analysis report.

Method 1: Using the Kunpeng Porting Advisor

Use the Kunpeng Porting Advisor to scan the Spark installation package and generate an analysis report. The procedure is as follows:

  1. Scan the Spark installation package and analyze the scan report. For details, see Using the Kunpeng Porting Advisor. Figure 1 lists the third-party dependencies that need to be ported.
    Figure 1 Software porting analysis result (Spark 2.3.0 is used as an example)
  2. Download the new JAR packages marked as Adaptable for Compatibility in Software Porting Assessment Report. Replace the original JAR packages with the new ones.
  3. If the result contains a package marked as To Be Confirmed, contact the supplier to obtain the Kunpeng-compatible version, or obtain the source code and compile it on the Kunpeng platform to generate a Kunpeng-compatible version.

Method 2: Using a Custom Script

Use the custom script to check whether the JAR files in the Spark installation package contain dynamic library files (.so) and verify that these libraries are built for the AArch64 architecture. The detailed procedure is as follows:

  1. Run the following script to check whether the Spark installation package contains dynamic library files:
    #!/bin/bash
    spark_jars=/usr/local/spark/jars
    
    for file in $(ls -v $spark_jars); do
        if [[ $file == *.jar ]]; then
            if jar tf $spark_jars/$file 2>/dev/null | grep -q "\.so$"; then
                echo "=== $file contains linux dynamic libraries: ==="
                jar tf $spark_jars/$file 2>/dev/null | awk -F '/' '{print $NF}' | grep "lib.*\.so$"
            fi
        fi
    done

    After the script is executed, the JAR packages that contain the .so files and the names of the .so files are displayed. The following figure uses Spark 3.3.1 as an example.

  2. Check whether the .so files in the JAR package support the AArch64 platform. commons-crypto-1.1.0.jar in the figure shown in step 1 is used as an example.
    cd /usr/local/spark/jars
    mkdir tmp
    find -name lib*

    The following figure shows the output.

    If the file path contains arm or aarch64, the file targets the AArch64 architecture and is compatible with the Kunpeng platform.

  3. Run the following command to further verify the architecture:
    readelf -h ./org/apache/commons/crypto/native/Linux/aarch64/libcommons-crypto.so

    The following figure shows the output.

    • If Machine is AArch64, the dynamic libraries are compiled for the AArch64 platform and are compatible with the Kunpeng platform.
    • If the architecture is not AArch64, the package does not support the Kunpeng platform. In this case, go to 4.
  4. Contact the supplier to obtain the Kunpeng-compatible version, or obtain the source code and compile it on the Kunpeng platform to generate a Kunpeng-compatible version.