Rate This Document
Findability
Accuracy
Completeness
Readability

Normalizing Code of Interpreted Languages

After an interpreted language is compiled, intermediate code files irrelevant to the platform are generated. For example, a .class file is generated after Java code is compiled, and a .pyc file is generated after Python code is compiled. The files are interpreted and executed by the VM. The VM shields platform differences. Therefore, the applications programmed in interpreted languages are irrelevant to the underlying chip architecture. The same set of code can be run on Kunpeng and x86 servers.

Procedure

No normalization is required. The same set of code can run on the Kunpeng and x86 platforms. For example, a JAR package compiled using Java code can be directly run on Kunpeng servers.

  • If the JAR package (or whl package on which the Python application depends) of the Java application program contains the SO library files written in C or C++ language, these SO libraries need to be compiled and ported. For any problem occurred during the compilation and porting of the SO files, see Common Problems in Porting. Then, use the compiled SO libraries to rebuild the JAR package. The .so library code needs to be normalized.
  • It is recommended that the same JDK version (or Python version) be used on the servers with different chip architectures to avoid incompatibility issues or different performance.