CN117234521A - File compiling method, device, equipment and storage medium - Google Patents

File compiling method, device, equipment and storage medium Download PDF

Info

Publication number
CN117234521A
CN117234521A CN202311324115.1A CN202311324115A CN117234521A CN 117234521 A CN117234521 A CN 117234521A CN 202311324115 A CN202311324115 A CN 202311324115A CN 117234521 A CN117234521 A CN 117234521A
Authority
CN
China
Prior art keywords
file
target
file set
compiling
link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311324115.1A
Other languages
Chinese (zh)
Inventor
郑靖博
杨超
付新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dameng Database Co Ltd
Original Assignee
Shanghai Dameng Database Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Dameng Database Co Ltd filed Critical Shanghai Dameng Database Co Ltd
Priority to CN202311324115.1A priority Critical patent/CN117234521A/en
Publication of CN117234521A publication Critical patent/CN117234521A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file compiling method, device, equipment and storage medium. The method comprises the following steps: receiving a target file set and a link script corresponding to the target file set, wherein the target file in the target file set is a file obtained by compiling a source file by a compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set; executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file. By the technical scheme, the compiling compatibility is improved, and meanwhile, the complexity of a compiling environment and the performance loss are reduced.

Description

File compiling method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a file compiling method, device, equipment and storage medium.
Background
gcc (GNU Compiler Collection, compiler) is a compiler capable of compiling multiple languages. The initial gcc is a Compiler (GNU C Compiler) that is a C language, and now supports c++, java, and other languages in addition to C language. While gcc supports a variety of hardware platforms. glibc is a library of libcs issued by GNU, i.e., C runtime. glibc is the lowest api in the Linux (Unix) system, and almost any other runtime will depend on glibc.
Different versions of the implementation of a partial function in the glibc library are possible. Taking the memcpy function as an example, but not limited to, memcpy function, memcpy is a memory copy function. In the version of glibc 2.17, the memcpy function has two implementation methods, memcpy@glibc_2.2.5 and memcpy@glibc_2.14. In the glibc2.12 version, the memcpy function only exists for one implementation of memcpy@glibc_2.2.5. Wherein, memcpy@GLIBC_2.14 has a certain degree of performance improvement compared with memcpy@GLIBC_2.2.5.
The gcc compilation flow is approximately as follows: and executing a compiling command on the compiling terminal to compile the source file into the target file. And linking the target file with the C operation library to generate a final file, and sending the final file to the target terminal.
When the final file uses the high version function of glibc, the final file cannot be run in an operating system that uses a low version glibc. Compiling the final file will typically be chosen based on two cases:
1. and selecting a compiling terminal of the operating system which is the same as or similar to the target terminal version to compile the final file. And the consistency of the environment is ensured.
2. And selecting a compiling terminal of the low-version glibc operating system to compile the final file. And the compatibility of the program is ensured.
The two cases correspond to the following problems, respectively:
1. although the final file can be matched with the target terminal, the problem of compatibility cannot occur, but an operating system required in the generation process is complex, so that the compiling environment is complex, and the workload and the version variety are increased.
2. The linking is performed using a low version glibc, i.e. a function of the low version glibc, whereas there is a certain performance optimization of a function of the high version glibc, with which the optimized function cannot be used. Although compatibility issues can be reduced, there may be some performance penalty.
Disclosure of Invention
The embodiment of the invention provides a file compiling method, device, equipment and storage medium, which can improve compiling compatibility, reduce the complexity of a compiling environment and reduce performance loss.
According to an aspect of the present invention, there is provided a file compiling method including:
receiving a target file set and a link script corresponding to the target file set, wherein the target file in the target file set is a file obtained by compiling a source file by a compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set;
executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
According to another aspect of the present invention, there is provided a file compiling method including:
acquiring a source file set;
compiling the source files in the source file set by calling a compiling command to obtain a target file set;
obtaining a link script corresponding to a target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set;
and sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
According to another aspect of the present invention, there is provided a file compiling apparatus including:
the system comprises a target file set and a link script receiving module, wherein the target file set and the link script corresponding to the target file set are sent by a compiling terminal, the target file in the target file set is a file obtained by compiling a source file by the compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set;
the link script execution module is used for executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
According to another aspect of the present invention, there is provided a file compiling apparatus including:
a source file set acquisition module for acquiring a source file set;
the target file set generating module is used for calling a compiling command to compile a source file in the source file set to obtain a target file set;
the link script acquisition module is used for acquiring a link script corresponding to the target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set;
and the target file set and link script sending module is used for sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file compiling method according to any one of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement a file compiling method according to any embodiment of the present invention when executed.
The embodiment of the invention receives the target file set sent by the compiling terminal and the link script corresponding to the target file set, wherein the target file in the target file set is a file obtained by compiling a source file by the compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set; executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponds to at least one target file, so that the compiling compatibility is improved, and meanwhile, the complexity of the compiling environment and the performance loss are reduced.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of compiling files in an embodiment of the invention;
FIG. 2 is a flow chart of another method of compiling files in an embodiment of the invention;
FIG. 3 is a schematic diagram of a file compiling apparatus according to an embodiment of the invention;
FIG. 4 is a schematic diagram of another file compiling apparatus according to an embodiment of the invention;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
Example 1
Fig. 1 is a flowchart of a file compiling method according to an embodiment of the present invention, where the method may be applied to a file compiling situation, and the method may be performed by a file compiling device according to an embodiment of the present invention, where the device may be implemented in a software and/or hardware manner, as shown in fig. 1, and the method specifically includes the following steps:
s110, receiving a target file set sent by the compiling terminal and a link script corresponding to the target file set.
The target file in the target file set is a file obtained by compiling the source file by the compiling terminal, and the link script comprises: and a link command corresponding to each target file in the target file set.
It should be noted that, the embodiment of the present invention is applied to a compiling system, which includes: the file compiling method provided by the embodiment of the invention is executed by the target terminal.
Specifically, the compiling terminal acquires a source file set, and the compiling terminal invokes a compiling command to compile source files in the source file set to obtain a target file corresponding to each source file. And the compiling terminal generates a target file set according to the target files corresponding to each source file. The method comprises the steps that a compiling terminal obtains a link script corresponding to a target file set, the compiling terminal sends the target file set and the link script corresponding to the target file set to the target terminal, and the target terminal receives the target file set and the link script corresponding to the target file set sent by the compiling terminal.
S120, executing the link script to obtain a final file set.
Wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
It should be noted that, a final file is generated from at least one target file.
Specifically, the link script is executed, and the mode of obtaining the final file set may be: reading the target file corresponding to each link command according to the identification information of the target file carried in each link command in the link script; and linking the target file corresponding to each linking command with the C operation library to obtain a final file set. The way to execute the linking script to obtain the final file set may be: and reading the target file corresponding to each link command according to the identification information of the target file carried in each link command in the link script, and processing the target file according to the function identification information corresponding to the target file and the function version calling function to obtain a final file.
Optionally, executing the link script to obtain a final file set, including:
reading the target file corresponding to each link command according to the identification information of the target file carried in each link command in the link script;
and linking the target file corresponding to each linking command with the C operation library to obtain a final file set.
The target file corresponding to each link command is a target file stored in the same file set with the link command.
Wherein, the link command is used for generating the final file based on the target file, for example, the link command for generating the final file (test) based on the target file (test.o) may be: gcc test.o-otest. It should be noted that the link command includes, but is not limited to gcc, and the above is only one example.
For example, if the link command is gcc test.o-o test, the target file corresponding to the test.o may be read according to the identification information test.o of the target file.
Specifically, the way of linking the target file corresponding to each linking command with the C runtime library to obtain the final file set may be: inquiring the C operation library according to the target file to obtain the function name and the function version corresponding to the target file; and calling the function version and the function corresponding to the function name to process the target file to obtain a final file, and generating a final file set according to the final file corresponding to each link command. The method for linking the target file corresponding to each linking command with the C operation library to obtain the final file set may also be: and linking the target file corresponding to each link command with the C operation library to obtain a final file corresponding to each link command, and generating a final file set according to the final file corresponding to each link command.
Optionally, linking the target file corresponding to each linking command with the C running library to obtain a final file set, including:
the following steps are sequentially executed for the target file corresponding to each link command: acquiring function identification information corresponding to the target file; determining a function name according to the function identification information; inquiring a function version corresponding to the function name in the C operation library according to the function name; determining an objective function corresponding to the objective file according to the function version and the function name;
determining a final file corresponding to each link command according to each link command, the target file corresponding to each link command and the target function corresponding to each target file;
and generating a final file set according to the final file corresponding to each link command.
Specifically, the method for obtaining the function identification information corresponding to the target file may be: the method comprises the steps of identifying target files according to the format of function identification information to obtain function identification information used by the target files, wherein one target file can correspond to at least one function identification information.
Specifically, the method for querying the function version corresponding to the function name in the C runtime according to the function name may be: and C, the function version corresponding to each function name is stored in the operation library, and the target terminal queries the operation library C according to the function names to obtain the function version corresponding to the function names.
Specifically, the final file corresponding to each link command is determined according to each link command, the target file corresponding to each link command and the target function corresponding to each target file. For example, if the link command a corresponds to the target file X and the target function corresponding to the target file X is the function H, the final file corresponding to the link command a may be determined based on the link command a, the target file X, and the function H corresponding to the target file X. Or, if the link command B corresponds to the target file Y, and the target function corresponding to the target file Y is the function H and the function G, the final file corresponding to the link command B may be determined based on the link command B, the target file Y, the function H and the function G.
It should be noted that, in the case that the target file does not include a function version, that is, the function version is not specified, the method and the device can be implemented through the technical scheme provided by the embodiment of the invention. If the target file includes a function version, that is, if the function version is specified, the target file needs to be processed by the specified function version, which cannot be achieved by the technical scheme provided by the embodiment of the invention.
Optionally, after executing the linking script to obtain the final file set, the method further includes:
after receiving the final file generation completion information returned by the link command;
and deleting the target file corresponding to the link command.
In order to prevent the target file from occupying the storage space of the target terminal, it is necessary to delete the target file corresponding to the link command after generating the final file.
In addition, other intermediate files generated by the link command also need to be cleaned. After cleaning, the occupation of the storage space of the target terminal can be effectively reduced.
The embodiment of the invention provides a two-stage compiling method, which reduces compiling complexity and performance loss by distributing compiling commands and linking commands to different terminals for execution, namely, postponing linking actions to execution in an operation (installation) stage. The technical scheme provided by the embodiment of the invention has the following advantages:
1. any compiling terminal can be selected to execute the compiling command to generate the target file, so that the dependency degree on the terminal is reduced. The complexity of the compiling environment is reduced,
2. the link command is executed on the target terminal and can be linked with the glibc of the target terminal, so that a high-version function of the glibc of the target terminal can be used, and the problem of incompatibility is avoided.
3. The two-stage compilation remains transparent to the user and consistent with the final effect exhibited by conventional flow compilation.
According to the technical scheme of the embodiment, a target file set sent by the compiling terminal and a link script corresponding to the target file set are received, wherein the target file in the target file set is a file obtained by compiling a source file by the compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set; executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponds to at least one target file, so that the compiling compatibility is improved, and meanwhile, the complexity of the compiling environment and the performance loss are reduced.
Example two
Fig. 2 is a flowchart of a file compiling method according to an embodiment of the present invention, where the method may be applied to a file compiling situation, and the method may be performed by a file compiling device according to an embodiment of the present invention, where the device may be implemented in a software and/or hardware manner, as shown in fig. 2, and the method specifically includes the following steps:
s210, acquiring a source file set.
It should be noted that, the embodiment of the present invention is applied to a compiling system, which includes: the file compiling method provided by the embodiment of the invention is executed by the compiling terminal.
Wherein the source files include, but are not limited to, c files. For example, the source file may be: test.c.
Wherein the source file set comprises at least one source file.
S220, compiling the source files in the source file set by calling a compiling command to obtain the target file set.
Wherein the compile command is for compiling the source file into the target file. For example, the compiling command for compiling the source file (test.c) to obtain the target file (test.o) may be:
gcc-c test.c-o test.o;
it should be noted that the compiling command includes but is not limited to gcc, and the above is only one example.
Specifically, the manner of calling the compiling command to compile the source files in the source file set to obtain the target file set may be: and calling a compiling command to compile the source files in the source file set in sequence to obtain target files corresponding to each source file, and generating a target file set according to the target files corresponding to each source file.
S230, obtaining a link script corresponding to the target file set.
Wherein the link script comprises: and a link command corresponding to each target file in the target file set.
The link command is used to generate a final file based on the target file, for example, the link command used to generate the final file (test) based on the target file (test.o) may be: gcc test.o-o test. It should be noted that the link command includes, but is not limited to gcc, and the above is only one example.
S240, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set.
Specifically, the target file set and the link script corresponding to the target file set are sent to the target terminal, so that the target terminal executes the link script, and the mode of obtaining the final file set may be: generating a file set to be sent according to the target file set and a link script corresponding to the target file set; and sending the file set to be sent to a target terminal so that the target terminal executes a link script to obtain a final file set. The target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script, and the mode of obtaining the final file set can be as follows: if the link script carries the target identifier, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set. The target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script, and the mode of obtaining the final file set can be as follows: copying the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
Optionally, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set, including:
generating a file set to be sent according to the target file set and a link script corresponding to the target file set;
and sending the file set to be sent to a target terminal so that the target terminal executes a link script to obtain a final file set.
It should be noted that, in order to facilitate execution of the link command, it may be agreed that the compiling terminal combines the target file set and the link script corresponding to the target file set into the file set to be sent in advance, and then sends the file set to be sent obtained after the combination to the target terminal, so that the target terminal processes the target files in the target file set according to the link command in the link script.
Optionally, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set, including:
if the link script carries the target identifier, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set.
The target identifier may be a preset identifier for indicating a compiling type, for example, if the link script carries the target identifier, the compiling type may be determined to be a first type, and if the link script does not carry the target identifier, the compiling type may be determined to be a second type.
Optionally, the method further comprises:
and if the link script does not carry the target mark, executing the link script to obtain a final file set, and transmitting the final file set to a target terminal.
It should be noted that, an identifier for identifying a compiling type may be configured in the link script in advance, for example, if the link script carries a target identifier, it may be determined that the compiling type is a first type, and the target file set and the link script corresponding to the target file set are sent to the target terminal, so that the target terminal executes the link script to obtain a final file set. If the link script does not carry the target identifier, determining that the compiling type is the second type, executing the link script by the compiling terminal to obtain a final file set, and transmitting the final file set to the target terminal by the compiling terminal.
The link script provided by the embodiment of the invention can support various types of compiling, including but not limited to obtaining a final file set through a compiling terminal, obtaining a target file through the compiling terminal and obtaining the final file set through the target terminal.
According to the technical scheme, a source file set is obtained; compiling the source files in the source file set by calling a compiling command to obtain a target file set; obtaining a link script corresponding to a target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set; and sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set, and the compiling compatibility is improved, and meanwhile, the complexity of a compiling environment and the performance loss are reduced.
Example III
Fig. 3 is a schematic structural diagram of a file compiling apparatus according to an embodiment of the present invention. The embodiment may be applicable to the case of file compiling, and the apparatus may be implemented in a software and/or hardware manner, and may be integrated in any device that provides a file compiling function, as shown in fig. 3, where the file compiling apparatus specifically includes: a target file set and link script receiving module 310 and a link script executing module 320.
The system comprises a target file set and a link script receiving module, wherein the target file set and the link script receiving module is used for receiving the target file set sent by the compiling terminal and the link script corresponding to the target file set, the target files in the target file set are files obtained by compiling a source file by the compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set;
the link script execution module is used for executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
The product can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a file compiling apparatus according to an embodiment of the present invention. The embodiment may be applicable to the case of file compiling, and the apparatus may be implemented in a software and/or hardware manner, and may be integrated in any device that provides a file compiling function, as shown in fig. 4, where the file compiling apparatus specifically includes: a source file set acquisition module 410, a target file set generation module 420, a link script acquisition module 430, and a target file set and link script transmission module 440.
The source file set acquisition module is used for acquiring a source file set;
the target file set generating module is used for calling a compiling command to compile a source file in the source file set to obtain a target file set;
the link script acquisition module is used for acquiring a link script corresponding to the target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set;
and the target file set and link script sending module is used for sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
The product can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as a file compiling method.
In some embodiments, the file compilation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the file compilation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the file compilation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method for compiling a file, the method being applied to a compiling system, the compiling system comprising: the file compiling method is executed by the target terminal and comprises the following steps:
receiving a target file set and a link script corresponding to the target file set, wherein the target file in the target file set is a file obtained by compiling a source file by a compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set;
executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
2. The method of claim 1, wherein executing the linking script results in a final set of files, comprising:
reading the target file corresponding to each link command according to the identification information of the target file carried in each link command in the link script;
and linking the target file corresponding to each linking command with the C operation library to obtain a final file set.
3. The method of claim 2, wherein linking the target file corresponding to each linking command with the C-running library to obtain a final file set, includes:
the following steps are sequentially executed for the target file corresponding to each link command: acquiring function identification information corresponding to the target file; determining a function name according to the function identification information; inquiring a function version corresponding to the function name in the C operation library according to the function name; determining an objective function corresponding to the objective file according to the function version and the function name;
determining a final file corresponding to each link command according to each link command, the target file corresponding to each link command and the target function corresponding to each target file;
and generating a final file set according to the final file corresponding to each link command.
4. The method of claim 1, further comprising, after executing the linking script to obtain the final set of files:
after receiving the final file generation completion information returned by the link command;
and deleting the target file corresponding to the link command.
5. A method for compiling a file, the method being applied to a compiling system, the compiling system comprising: the file compiling method is executed by the compiling terminal and comprises the following steps:
acquiring a source file set;
compiling the source files in the source file set by calling a compiling command to obtain a target file set;
obtaining a link script corresponding to a target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set;
and sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
6. The method according to claim 5, wherein sending the target file set and the link script corresponding to the target file set to the target terminal, so that the target terminal executes the link script to obtain the final file set, includes:
generating a file set to be sent according to the target file set and a link script corresponding to the target file set;
and sending the file set to be sent to a target terminal so that the target terminal executes a link script to obtain a final file set.
7. The method according to claim 5, wherein sending the target file set and the link script corresponding to the target file set to the target terminal, so that the target terminal executes the link script to obtain the final file set, includes:
if the link script carries the target identifier, the target file set and the link script corresponding to the target file set are sent to a target terminal, so that the target terminal executes the link script to obtain a final file set.
8. A file compiling apparatus, characterized by being applied to a compiling system, the compiling system comprising: the file compiling device is configured in the target terminal, and comprises:
the system comprises a target file set and a link script receiving module, wherein the target file set and the link script corresponding to the target file set are sent by a compiling terminal, the target file in the target file set is a file obtained by compiling a source file by the compiling terminal, and the link script comprises: a link command corresponding to each target file in the target file set;
the link script execution module is used for executing the link script to obtain a final file set, wherein the final file set comprises: at least one final file, each final file corresponding to at least one target file.
9. A file compiling apparatus, characterized by being applied to a compiling system, the compiling system comprising: the file compiling device is configured in the compiling terminal and comprises:
a source file set acquisition module for acquiring a source file set;
the target file set generating module is used for calling a compiling command to compile a source file in the source file set to obtain a target file set;
the link script acquisition module is used for acquiring a link script corresponding to the target file set, wherein the link script comprises: a link command corresponding to each target file in the target file set;
and the target file set and link script sending module is used for sending the target file set and the link script corresponding to the target file set to a target terminal so that the target terminal executes the link script to obtain a final file set.
10. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the file compilation method of any of claims 1-7.
11. A computer readable storage medium storing computer instructions for causing a processor to implement the file compilation method of any of claims 1-7 when executed.
CN202311324115.1A 2023-10-12 2023-10-12 File compiling method, device, equipment and storage medium Pending CN117234521A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311324115.1A CN117234521A (en) 2023-10-12 2023-10-12 File compiling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311324115.1A CN117234521A (en) 2023-10-12 2023-10-12 File compiling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117234521A true CN117234521A (en) 2023-12-15

Family

ID=89091112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311324115.1A Pending CN117234521A (en) 2023-10-12 2023-10-12 File compiling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117234521A (en)

Similar Documents

Publication Publication Date Title
CN113961351A (en) Distributed training method, device, equipment and storage medium for deep learning model
CN111026493B (en) Interface rendering processing method and device
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN109766088B (en) Program generation method, program generation device, data processing method and server
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN117234521A (en) File compiling method, device, equipment and storage medium
CN115187821A (en) Method for verifying correctness before and after model conversion, related device and program product
CN114218166A (en) Data processing method and device, electronic equipment and readable storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN111338968A (en) Project function module debugging method, device, medium and electronic equipment
CN111176718A (en) Script online method and device, storage medium and electronic equipment
CN113835893B (en) Data processing method, device, equipment, storage medium and program product
CN116775171B (en) Architecture switching method and device, electronic equipment and storage medium
CN117270862A (en) Software pluggable method, device, equipment and medium based on dynamic compiling
CN114326689B (en) Method, device, equipment and storage medium for brushing firmware of vehicle
CN113127006B (en) Service deployment method, device, equipment and storage medium
CN117667463A (en) Interaction method, device, equipment and medium of Node and Python
CN117407044A (en) Configuration method, device, equipment and medium of cross-terminal assembly
CN114416215A (en) Function calling method and device
CN117311976A (en) Vector graphic file processing method, device, equipment and storage medium
CN117075861A (en) Method, device, equipment and medium for constructing backlight module
CN117608584A (en) Multi-program compiling method, device, equipment and storage medium
CN117873452A (en) Static variable management method, device, electronic equipment and storage medium
CN116756061A (en) External equipment adaptation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination