Modifying the Source Code
- Click Expand on the right of Source Code to Be Ported. See Figure 1.
- The porting report indicates that two files must be modified. View the modification suggestion for each file and modify the source code based on the suggestions.
Modifying the Makefile
Modify the Makefile based on the source code processing suggestions in the source code porting report. See Figure 2.
According to the preceding suggestions, add the -march=armv8.2-a -fsigned-char option to the CFLAGS variable in the makefile, and delete the -mpopcnt and -msse3 options of the CFLAGS variable. After obtaining and installing the Kunpeng System Library (BoostKit-ksl_2.3.1.zip), add -I /usr/local/ksl/include/ -L /usr/local/ksl/lib/ -lavx2ki to the GLIBS variable.
In this example, the compiler is GCC 4.8.5. For a later version, the -march=armv8.2-a -fsigned-char option needs to be modified as prompted.
Figure 3 shows the updated code (x86_64 and AArch64 are distinguished from each other).
Modifying the ksw.c File
Modify the ksw.c file based on the source code processing suggestions in the source code porting report. See Figure 4.
According to the suggestion, set the branch definitions contained in the header files for x86 and AArch64. This ensures that the code is adapted to both x86 and AArch64. The following information is displayed (using GCC 4.8.5 as an example):
1 #if defined(__aarch64__) 2 #include "avx2ki.h" 3 #endif ... 31 #if defined(__x86_64__) 32 #include <emmintrin.h> 33 #endif



