Linux Source Installation

Source: Internet
Author: User

1. Open source, compile program, executable file

Open Source: program code, written to human look at the program language, but the machine does not know, so cannot execute.

compiler : Translating program code into a machine-readable language, similar to the translator's role.

executable : A file that can be executed after the compiler has become a binary program and the machine is able to read it.

function Library : A function function that resembles a subroutine and can be called to execute.

Compile : The compilation process generates so-called target files that exist in the form of an *.o extension.

links : Sometimes references, calls to other external subroutines in the program, or utilizes function functions provided by other software, must be added to the library during the compilation process. This allows the compiler to link all program code with the library to generate the correct execution file.

2.configure, make, Tarball software

Configure: according to the source code detection program to find the necessary function libraries, compilers and other materials, and actively establish makefile files.

Make : based on the makefile definition, the source code, library, and compiler are used for compiling.

The tar files include : 1. Original code file, 2. Test program files, 3. The software's recommended description and installation instructions.

Easy use of 3.GCC

gcc-c hello.c---> compiles the source code into the target file, does not make the link and so on function.

gcc-o hello.c-c---> compile to optimize execution speed based on operating environment.

GCC sinc.c-lm-l/usr/lib-i/usr/include

-LM refers to the libm.so or LIBM.A function library

The path followed by-L is the search directory for the library that was just above

-I is followed by the directory where the include files within the source code are located

Gcc-o Hello hello.c Output The compiled result to a specific name

Gcc-o Hello Hello.c-wall output More information description

Basic syntax and variables for 4.makefile

Variables in the makefile:

1. Variable and variable contents are separated by "=" and can have spaces on both sides

2. The left side of the variable can not have a <tab>

3. Variable and variable content cannot have ":" on either side

4. Customary variables are "capital letters" and use variables to ${} to get

Makefile file format:

Target: Target file 1 target file 2

<tab> Gcc-o to create a new executable 1 target file 1 target file 2

5.tarball Software Installation process

./configure
--help
--prefix=/path/to/somewhere
--sysconfdir=/path/to/conffile_path
Function: 1, let the user select the compilation feature; 2, check the compilation environment;

1.tar XF tengine-1.4.2.tar.gz

CD tegnine-1.4.2

./configure--prefix=/usr/local/tengine--conf-path=/etc/tengine/tengine.conf

Make
Make install
/usr/local/tengine/sbin/nginx

1, modify the PATH environment variable, to be able to identify the binary file path of this program;
Modify the/etc/profile file
Create a file in the/etc/profile.d/directory with a name suffix of. SH, defined inside

Export path= $PATH:/path/to/somewhere
2, by default, the system search library file path/lib,/usr/lib; To add additional search paths:
Create a file with a suffix of. conf in/etc/ld.so.conf.d/, and then write the path you want to add directly to the file;
# Ldconfig notifies the system to re-search the library file
-V: Shows the process of re-searching the library
3. header file: Output to System
Default:/usr/include
Add header file search path, using links to:
/usr/local/tengine/include//usr/include/
Two different ways:
Ln-s/usr/local/tengine/include/*/usr/include/or
Ln-s/usr/local/tengine/include/usr/include/tengine
4. Man file path: The man directory installed in the directory specified by--prefix;/usr/share/man
1. Man-m/path/to/man_dir COMMAND
2, add a manpath in the/etc/man.config

6. Function Library Management

Static libraries:

Extension. A

Compile behavior: Compile the time to integrate directly into the execution program.

Standalone execution state: the compiled executable can be executed independently.

Ease of Upgrade: function library upgrade, all programs that include this data will have to be recompiled

Dynamic Libraries:

extension. so

Compile behavior: Dynamic function library at compile time, there is only one point in the program.

State of independent execution: cannot be executed independently.

Ease of upgrade: relatively easy.

7.ldconfig and/etc/ld.so.conf

If we load the used dynamic library into memory first, when the software needs to use the function dynamic library, it does not need to read from the beginning to the hard disk, which can speed up the reading speed of the dynamic function library.

Operation Steps:

1). First of all, we have to write down in the/etc/ld.so.conf the directory where you want to read the cache's current dynamic function library.

2). The next step is to read 2507803129 of the data into the cache using the Ldconfig executable file.

3). Also record a copy of the data in/etc/ld.so.cache

1. Add a row in/etc/ld.so.cache, or add a. conf file in/ETC/LD.SO.CACHE.D

2.ldconfig

3.ldconfig-p

8.ldd Inspection of dependencies between related repositories

LDD-V: List all content

-D: Re-display the missing link points

-R: Show elf-related error content

Example:

install jdk1.7 under Linux

1. First you need to see whether the current Linux system is 32-bit or 64-bit,

2. Downloading the JDK version from the official website is now in the 1.8 version, but it has been used in version 1.7. Put a link here

Http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk7-downloads-1880260.html

Here choose to download is jdk-7u79-linux-i586.tar.gz, the archive when a binary file, the direct decompression can be used.

3. Upload to the Linux server, the specific directory is

4. Set the configuration file for the JDK

Verification and use of 5.JDK

Linux Source Installation

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.