unix/linux Software Installationfirst we understand that on Unix like machines, a set of software is not just a program, but a bunch of program code files. For example main.c,haha.c,sin_value.c These three source code files. 1. Program Source Code1.1 compiling manually with the compile tool such as GCC#什么是gcc工具? The GNU GCC tool is a very generic C language compiler. gcc-c main.cgcc-c haha.cgcc-c sin_value.cgcc-c cos_value.cgenerates MAIN.O,HAHA.O,SIN_VALUE.O,COS_VALUE.O of 4 compiled files. connect several. o files and add the LIBM math function to generate the main executable file. gcc-o main main.o haha.o sin_value.o cos_value.o \-lm-l/usr/lib-l/lib#然后我们就可以跑main这个可执行文件了. [email protected] fwy]$./mainPlease input your Name:fengweiyuanPlease enter the degree angle (ex>):Hi, Dear Fengweiyuan, Nice to meet.The Sin is:0.94The Cos is: -0.341.2 Compile the source code with tools such as configure and make./configuredetects the user environment, checks whether the OS is suitable, etc. The makefile text file is then generated. 1. Whether there is a suitable compilation program, you can compile the program source code of the software translation. 2. Is there a function library or other dependent software that is required for the software? 3.OS platform, including kernel version, is suitable for this software. 4. The kernel header definition file exists. Makefile Records how the source code compiles and other information. For information about this step, you can refer to the Readme and install files. MakecleanNot necessarily, but it's safer to do it. If there is already a previously compiled. o file exists, of course, it is better to clear it up, so that we can determine the newly compiled execution file we can be sure to use their own machine to compile the completed. Makein the current directory search makefile This text file, the use of makefile to compile the source code, compiled into an executable file, placed in the current directory. (This process is like the 1.1 build. o file, connecting the. o file together and adding the work of the function library). make automatically determines whether the source code changes and automatically updates the execution file. Make InstallIf the makefile has an option to write about install, it will install the file that was compiled in the previous step to the default directory to complete the installation. These steps are one-to-one, the previous is not successful, and the latter cannot be executed. Summarybecause of the different OS library path, or the function library file name definition, or the default installation of the compiler program, and the kernel version is different. In theory, the binaries compiled on CentOS 5.x (the binary executable file containing the function library path information on the OS) cannot be executed on the SuSE. So the same set of software to be executed on different platforms, must be compiled repeatedly, so the source code is required. 2. Files that have been compiled2.1 Binary Distribution versiondirectly select the compiled binary distribution, which needs to be selected from the website according to the operating system version. In fact, in the specific operating system, the compiled binary files, we directly copy the use.
2.2rpm Packthe software to be installed is pre-compiled and then packaged into an RPM installation package. Baotou will have software-dependent information, before installing RPM package, RPM will first follow the information of the RPM header records to check whether the environment is satisfied, if not satisfied will not install. During installation, the information of the software is written to the local RPM database for future query, verification and anti-installation. therefore, RPM package is not cross-platform, to install this RPM package, then the platform to build this software file with the host environment consistent or equivalent.
srpm Package. **.src.rpm