Installation of Unix/Linux software

Source: Internet
Author: User
Tags mathematical functions

Unix/Linux software installation first, we understand that on a Unix like machine, a set of software does not only have a program, but a bunch of program code files. For example, main. c, haha. c, and sin_value.c source code files. 1. manually compile the program source code 1.1 using gcc and other compilation tools # What is the gcc tool? The GNU gcc tool is a common C language compiler. Gcc-c main. cgcc-c haha. cgcc-c sin_value.cgcc-c cos_value.c generates four compiled files: main. o, haha. o, sin_value.o, and cos_value.o. Connect several. o files and add libm mathematical functions to generate the main executable file. Gcc-o main. o haha. o sin_value.o cos_value.o \-lm-L/usr/lib-L/lib # Then we can run the main executable file. [Padep @ cnsz081003 fwy] $. /mainPlease input your name: fengweiyuanPlease enter the degree angle (ex> 90): 110Hi, Dear fengweiyuan, nice to meet you. the Sin is: 0.94The Cos is:-0.341.2 use tools such as configure and make to compile The source code. /configure checks the user environment and whether the OS is suitable. The makefile text file is generated. 1. check whether there is a suitable Compilation Program. You can compile the program source code of the software. 2. Whether the function library or other dependent software required by the software already exists. 3. Whether the OS platform, including the kernel version, is suitable for the software. 4. Check whether the header definition file of the kernel exists. Makefile records how to compile the source code. For more information about this step, see README, INSTALL, and other files. Makeclean is not necessarily required, but it is safer to execute it. If you have already compiled the last time. the o file exists. Of course, it is better to clear it, so that we can determine that the newly compiled execution file is compiled by our own machine. Make will search for the makefile text file in the current directory, use makefile to compile the source code, compile it into an executable file, and put it in the current directory. (This process is like the above 1.1 generation. o file, connect the. o file together and add the function library ). Make automatically checks whether the source code has changed and updates the execution file. Make install if the makefile contains the install option, the file compiled in the previous step is installed in the default directory to complete the installation. These steps are performed one by one. If the previous steps fail, the subsequent steps cannot be executed. In summary, the path of the function library, the file name definition of the function library, or the compiled program installed by default, and the kernel version are different. Theoretically, binary files compiled on CentOS 5.x (the binary execution file contains the path of the function library on the OS) cannot be obtained and executed on SuSE. Therefore, to execute the same software on different platforms, the source code must be compiled repeatedly. 2. If the compiled binary distribution version of file 2.1 is selected, select the compiled binary distribution version from the website based on the operating system version. In fact, we can directly copy and use the compiled binary files on a specific operating system.
2. The software to be installed in the 2rpm package is pre-compiled and then packaged into an rpm installation package. There will be software dependency information in the header. Before installing the rpm package, the rpm will first check whether the environment meets the requirements according to the information recorded in the rpm header. If not, the rpm package will not be installed. During installation, the software information is written to the local RPM database for future query, verification, and reverse installation. Therefore, the rpm package is not cross-platform. to install this rpm package, the platform must be consistent or equivalent to the host environment where the software file was originally created.
Srpm package. **. Src. rpm

Related Article

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.