A cross-platform software compilation method and system
By uniformly compiling the software on a cross-compilation server, generating binary files that are adapted to multiple platforms, and simplifying the client's software installation process through the mirror server, the complexity and cumbersomeness of software compilation and porting are solved, and the user experience is improved.
Patent Information
- Application Number
- CN202111612640.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-12-27
AI Technical Summary
When compiling the software, due to the differences in the CPU architecture, instruction set, GPU architecture of the user's local machine and remote machine, compilation errors and software crashes, which are high in porting costs. Users need to manually load environment variables under complex directory structures, which is cumbersome to use.
By obtaining the compilation process configuration files and basic information of known software, it is uniformly compiled on a cross-compilation server, generating binary executable programs or library files that are suitable for multiple platforms, and uploading these files to the mirror server. The client establishes a connection with the mirror server, querys and loads the environment variables of the required software.
This greatly simplifies the steps of users to port software and reduces the complexity and cumbersomeness of software use. Users can focus on using the software without having to deal with complex environment variables and compilation processes.
Smart Images

Figure CN114281340B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software compilation, and particularly to a cross-platform software compilation method and system. Background Art
[0002] The statements in this section merely mention the background art related to the present invention and do not necessarily constitute prior art.
[0003] Currently, whether in each supercomputer center or the high-performance clusters of each university, when users compile software, due to differences in CPU architecture, CPU instruction set, GPU architecture, compiler, system environment library, etc. between the user's local machine and the remote machine, various unexpected errors often occur during software compilation, or the software crashes during runtime due to the lack of certain files, resulting in high software transplantation costs. Before each user runs the software, they need to manually load the environment variables of the software under a complex directory structure, and multiple users often use the same account, leading to messy environment variables and cumbersome software usage. Summary of the Invention
[0004] To solve the deficiencies of the prior art, the present invention provides a cross-platform software compilation method and system;
[0005] In a first aspect, the present invention provides a cross-platform software compilation method;
[0006] A cross-platform software compilation method includes:
[0007] Obtain the compilation process configuration files of several known software and the basic information of several known software; according to the compilation process configuration files of several known software and the basic information of several known software, compile the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms;
[0008] Upload all the binary executable programs or library files to the image server;
[0009] Establish a communication link between the client and the image server;
[0010] The client queries the software from the image server through a specified command, and loads the environment variables of the required software from the image server to the client.
[0011] In a second aspect, the present invention provides a cross-platform software management system;
[0012] A cross-platform software management system includes: a client, the client is connected to a login node, the login node is connected to an image server, and the image server is connected to a cross-compilation server;
[0013] The cross-compilation server obtains the compilation process configuration files of several known software and the basic information of several known software; according to the compilation process configuration files of several known software and the basic information of several known software, it compiles the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms;
[0014] The cross-compilation server uploads all binary executable programs or library files to the image server;
[0015] The client establishes a communication link with the image server;
[0016] The client queries software from the image server through a specified command and loads the environment variables of the required software from the image server to the client.
[0017] Compared with the prior art, the beneficial effects of the present invention are:
[0018] By performing unified compilation on the cross-compilation server and generating binary executable programs adapted to multiple platform architectures, the cumbersome steps of software transplantation for users are greatly simplified, and through a unified image server, it makes it convenient and concise for users to use software. Users can completely get out of the quagmire of debugging code and focus on using the software itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings forming a part of this invention are used to provide a further understanding of the invention. The schematic embodiments and descriptions thereof of the invention are used to explain the invention and do not constitute an improper limitation of the invention.
[0020] Figure 1 It is a flowchart of the method for the first embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] It should be noted that the following detailed descriptions are all exemplary and are intended to provide further descriptions of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0022] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0023] In the case of no conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.
[0024] All data acquisition in this embodiment is based on compliance with laws, regulations and user consent, and is a legal application of data.
[0025] Embodiment 1
[0026] This embodiment provides a cross-platform software compilation method;
[0027] As Figure 1 shown, a cross-platform software compilation method includes:
[0028] S101: Obtain the compilation process configuration files of several known software and the basic information of several known software; according to the compilation process configuration files of several known software and the basic information of several known software, compile the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms;
[0029] S102: Upload all binary executable programs or library files to the image server;
[0030] S103: Establish a communication link between the client and the image server;
[0031] S104: The client queries software from the image server through a specified command, and loads the environment variables of the required software from the image server to the client.
[0032] Further, input the instruction for querying software provided by the client to query all or the required software. If it is necessary to load and use the software, input the instruction for loading the software. The image server distributes the software to the client and loads the environment variables of the software for the client.
[0033] Further, the known software includes: compilers gnu, intel, Message Passing Interface openmpi, intel-mpi, math libraries blas, lapack, scalapack, fftw, mkl, big data file database hdf5, molecular dynamics simulation software vasp, lammps, gromacs, cp2k.
[0034] Further, the compilation process configuration file includes: adjustable parameters before compilation, compiling or compiling specified objects, copying binary executable files and runtime libraries;
[0035] Further, the basic information of the known software includes: installation instructions input by the user or developer, name and version number of the software, name and version number of the compiler, optional features, dependencies, target platform, and target architecture.
[0036] Further, according to the compilation process configuration files of several known software and the basic information of several known software, compile the compilation process configuration file of each known software into a binary executable program adapted to multiple platforms; specifically including:
[0037] Use a cross-compilation server. First, read the software download address provided by the configuration file, obtain the source code package of the software from the official software download address or the source code mirror server, and verify its hash value to ensure the correctness of the file;
[0038] Then, unzip the source code package to the specified directory;
[0039] Then, modify the parameters of the specified file (Makefile file) in the source code package according to the parameters provided by the configuration file;
[0040] Then, according to the compiler name and version number, dependencies, and architecture input by the user or developer, call the corresponding compiler and add the corresponding optimization options to compile the source code to generate a binary executable file or library file for the target architecture;
[0041] Finally, upload the binary executable file or library file to the mirror server according to the file hierarchy in the configuration file or the default.
[0042] Exemplarily, the cross-compilation server refers to: a server with a general architecture X86 in terms of hardware, and a cross-compilation toolchain that can generate executable programs for other architecture platforms (ARM architecture platform) is deployed in terms of software.
[0043] Further, in step S102: upload all binary executable programs to the mirror server; where the mirror server refers to a management system composed of a highly available storage array in terms of hardware and providing a mechanism for software upload and distribution that is not limited to the system environment in terms of software.
[0044] A mirror server refers to two or more servers with exactly the same content on the Internet and synchronized updates. Except for the main server, the rest are called mirror servers.
[0045] Further, in step S103: establish a communication link between the client and the mirror server, specifically referring to: deploy a cross-platform client at the login node, and establish a connection between the client and the remote mirror server through an Http request or network disk mounting method (such as NFS).
[0046] Embodiment 2
[0047] This embodiment provides a cross-platform software management system;
[0048] A cross-platform software management system includes: a client, the client is connected to a login node, the login node is connected to an image server, and the image server is connected to a cross-compilation server;
[0049] The cross-compilation server obtains the compilation process configuration files of several known software and the basic information of several known software; according to the compilation process configuration files of several known software and the basic information of several known software, compile the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms;
[0050] The cross-compilation server uploads all binary executable programs or library files to the image server;
[0051] The client establishes a communication link with the image server;
[0052] The client queries software from the image server through a specified command, and loads the environment variables of the required software from the image server to the client.
[0053] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A cross-platform software compilation method, characterized in that, Including: Obtaining the compilation process configuration files of several known software and the basic information of several known software; According to the compilation process configuration files of several known software and the basic information of several known software, compiling the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms; specifically including: Using a cross-compilation server, first reading the software download address provided by the configuration file, obtaining the source code package of the software from the official software download address or the source code mirror server, and verifying its hash value to ensure the correctness of the file; Then, decompressing the source code package to a specified directory; Then, modifying the parameters of the specified files in the source code package according to the parameters provided by the configuration file; Then, according to the compiler name, version number, dependencies, and architecture input by the user or developer, calling the corresponding compiler and adding corresponding optimization options to compile the source code to generate a binary executable file or library file for the target architecture; Finally, uploading the binary executable file or library file to the mirror server according to the file hierarchy in the configuration file or the default; Uploading all binary executable programs or library files to the mirror server; Establishing a communication link between the client and the mirror server; The client queries the software from the mirror server through a specified command, and loads the environment variables of the required software from the mirror server to the client.
2. The cross-platform software compilation method according to claim 1, characterized in that, The client obtains the instruction to query the software, queries all or the required software. If it is necessary to load and use the software, it inputs the instruction to load the software. The mirror server distributes the software to the client and loads the environment variables of the software for the client.
3. The cross-platform software compilation method according to claim 1, characterized in that, The known software includes: compiler, Message Passing Interface, math library, big data file database, or molecular dynamics simulation software.
4. The cross-platform software compilation method according to claim 1, characterized in that, The compilation process configuration file includes: adjustable parameters before compilation, compiling or compiling specified objects, copying binary executable files and runtime libraries.
5. The cross-platform software compilation method according to claim 1, characterized in that, The basic information of the known software includes: installation instruction input by the user or developer, name and version number of the software, name and version number of the compiler, optional features, dependencies, target platform, target architecture.
6. The cross-platform software compilation method according to claim 1, characterized in that, The cross-compilation server refers to: a server with a general architecture X86 in terms of hardware, and a cross-compilation toolchain for generating executable programs for other architecture platforms is deployed in terms of software.
7. The cross-platform software compilation method according to claim 1, characterized in that, The mirror server refers to a management system composed of a highly available storage array in terms of hardware, and providing a mechanism for software upload or distribution that supports the system environment in terms of software.
8. The cross-platform software compilation method according to claim 1, characterized in that, Establishing a communication link between the client and the mirror server specifically means: deploying a cross-platform client on the login node, and establishing a connection between the client and the remote mirror server through an Http request or network hard disk mounting.
9. A cross-platform software management system, characterized in that, Executing a cross-platform software compilation method as described in any one of claims 1-8, including: a client, the client is connected to the login node, the login node is connected to the mirror server, and the mirror server is connected to the cross-compilation server; The cross-compilation server obtains the compilation process configuration files of several known software and the basic information of several known software; according to the compilation process configuration files of several known software and the basic information of several known software, compiles the compilation process configuration file of each known software into a binary executable program or library file adapted to multiple platforms; The cross-compilation server uploads all binary executable programs or library files to the image server; The client establishes a communication link with the image server; The client queries software from the image server through a specified command and loads the environment variables of the required software from the image server to the client.
Citation Information
Patent Citations
Method and system for finishing software construction
CN101727347A
Software package release method and system based on multi-language environment
CN106528170A