Modifying the Source Code
- In the Source Files to Be Ported area of the report page, click View Suggested Source Code in the Operation column. See Figure 1.
- Select a source file and go to the porting suggestions page. See Figure 2.
- The porting report indicates that two files must be modified. On the Source Code Porting Suggestions page, view the suggestions for modifying each file and complete the modification.
- Select makefile. Based on the red wavy line, modify the Makefile.
- Select ksw.c. Based on the red wavy line, modify the ksw.c file.
After a file is modified, click Save in the upper right corner to save the modification.
Modifying the Makefile
On the Source Code Porting Suggestions page, view the suggestions for modifying the Makefile. See Figure 3.
Figure 4 and Figure 5 show the suggestions.
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 (), add -I /usr/local/ksl/include/ -L /usr/local/ksl/lib/ -lavx2ki to the GLIBS variable.
Figure 6 shows the new code (x86_64 and AArch64 are distinguished from each other).
Modifying the ksw.c File
On the Source Code Porting Suggestions page, view the suggestions for modifying the ksw.c file. See Figure 7 and Figure 8.
The suggestion is about how to use the intrinsic function. According to the suggestion, click Quick Fix and add #include "avx2ki.h" to the ksw.c file. 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
When the suggestion shown in Figure 8 is displayed, you need to visit the corresponding website to obtain the corresponding files and perform operations according to the suggestion.







