With open source, how can we compile our software?

Source: Internet
Author: User
With open source, how can we compile our software-Linux general technology-Linux programming and kernel information? For more information, see below. Basically, especially in Windows and Mac OS X systems, the developed software does not need to be compiled by users. After the programmer writes the code and compiles it, It is encapsulated into a binary form that can be executed by the computer, and the user can directly use it.

However, with the increase of open-source software, everyone can read and use the source code, so the last step of software compilation has been transferred to users, and they have to follow their own systems, windows XP, Windows Vista, Mac OS X Tiger, Panther, Linux x86 ...... For compilation.

If you find that you have to compile a piece of software code, the process is not complicated. Although the nature of each code segment varies, there is a set of common methods.

First, prepare the command line and editor. I will give a simple explanation of the mainstream operating systems:

Linux: a command line and a GCC editor are available. Enter gcc in the command line. If "command not found", install GCC.

Mac OS X: the command line is Terminal in Applications/Utilities. You need to download XCode, which contains the Apple editor.

Windows: Microsoft provides an editor in the free downloaded Visual Studio Express, but the Cygwin interface is more friendly. During installation, You must select all the installation packages in the "Devel" section.

Download: Workshop. Create a directory named "source" or "build", download it, and put it in the directory.

Decompress: Enter the working directory from the command line (run the cd command): the fastest method for cd source is:

Tar-xzvf example-3.2.8.tar.gz

This will decompress all the source code to a new subdirectory, and the file name is the same as that of the application. To enter the directory, you only need:

Cd example-3.2.8

Read the document: In the code package, there will be files such as README and INSTALL, which must be read. You can also use the less command to read from the command line: less INSTALL or directly open them in the appropriate format. They will tell you which packages to INSTALL, Installation Guide, and precautions.

Building: although they are different, the method is as follows: Enter./configure to run the configuration tool to tell you where the software and important files are missing. Sometimes you need to specify the location of a specific file on your computer, for example:

./Configure -- ssl-dir =/usr/local/include

It takes several minutes for the Configuration process to complete, and you can compile it. If an error occurs, refer to the Troubleshooting below. Enter:

Make

Compilation started after everything went smoothly. Compilation takes some time and all processes on your computer are occupied during running. Don't worry. At the end of compilation, if you still don't see the error, you have done it. All you have to do is put different files in the file system:

Make install

Troubleshooting. Check whether you perform the preceding steps strictly as required.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.