Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Red Hat Enterprise Linux Server 6.5 installation GCC 4.9.2     - How do I switch from NetworkManager to systemd-network on Linux (Linux)

- Four levels to deal with Linux server attacks (Linux)

- Two programs HAProxy + Heartbeat (note, the secondary server vip, normal HAProxy boot method) (Server)

- DM9000 timing settings (Programming)

- Nodejs command-line program development tutorial (Programming)

- Differences Shell scripting languages and compiled languages (Programming)

- Red-black tree in C ++ (Programming)

- Linux command in the dialog whiptail (Linux)

- Ubuntu Tutorial: E: Failed to get lock / var / lib / apt / lists / lock - open (Linux)

- Advanced Linux security settings (Linux)

- How to properly set up a Linux swap partition (Linux)

- Install minimize RHEL / CentOS 7 things to do (Linux)

- Ubuntu mysql stop fail to solve the problem (Database)

- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)

- Cache implementation APP interacts with the server-side interface control Session (Server)

- Linux System Getting Started Learning: Disable Ubuntu Apport internal error reporting procedures (Linux)

- Linux Network Security Tips Share (Linux)

- OpenSSH server configuration file for each Common Definition (Server)

- Depth understanding of C language (Programming)

- Linux file time Comments ctime mtime atime (Linux)

 
         
  Red Hat Enterprise Linux Server 6.5 installation GCC 4.9.2
     
  Add Date : 2018-11-21      
         
         
         
  Now many programmers use GCC, how can we better use GCC. At present, GCC can be used to compile C / C ++, FORTRAN, JAVA, OBJC, ADA and other language programs, you can choose to install the supported languages as required. In this paper, the RedHat Linux installation GCC4.9.2 Case (due to the requirements for use in the project development process, not with the latest version of GCC), introduced Linux GCC installation process.

Prior to installation, the system must have a cc or gcc compiler, etc., and is available, or specify the compiler on the system environment variable CC. If there is no compiler on your system, you can not install the source code form of GCC 4.9.2. If this is the case, you can find a compatible system such as RPM and other binary format GCC packages to install and use on the Internet. This article describes the installation process is based on GCC package source code form, the package itself and the installation process is equally applicable to other Linux and Unix systems.

The original system may be the GCC compiler gcc commands, libraries, header files, and so on to the system are stored in different directories. In contrast, we now recommend a GCC version of GCC installed in a separate directory. This has the advantage that it does not need to be in the future when you can easily remove an entire directory can (GCC because no uninstall feature); drawback is that the installation is complete to do some setup work to make the compiler to work properly. In this paper the use of this program to install GCC 4.9.2, and after the installation is complete, still be able to use the original version of the low GCC compiler, it can exist simultaneously and use multiple versions of GCC compiler on a system that is.

Follow the steps and setting options provided herein, even if not previously installed GCC, can also be installed on a working version of the new GCC compiler on your system.

1 Download

On the GCC website (http://gcc.gnu.org) or through an online search you can find the download resources. The latest version of GCC 4.9.2. Files available for download are generally two forms: gcc-4.9.2.tar.gz and gcc-4.9.2.tar.bz2, but compression format is not the same, exactly the same content, you can download one.

RHLinux installed gcc-4.9.2 is relatively simple, but some aspects of the installation process is the need to pay attention, otherwise, may lead to an unsuccessful installation, or installation error. Specific installation process is as follows:

First, download and unzip the gcc RPM packages to the source directory (eg /opt/gcc-4.0.1)

1. Extract the RPM package:

[Root @ linuxhost] # tar xjvf gcc-4.0.1.tar.bz2 (generating source directory after decompression /opt/gcc-4.0.1)

2. Create an installation target directory:

[Root @ linux opt] # mkdir /usr/local/gcc-4.0.1/

3, enter the installation destination directory:

[Root @ linux opt] # cd /usr/local/gcc-4.0.1/ (This step is very important, when you configure the installation files, you need to perform configure command in the target directory)

[Root @ linux opt] # pwd

/usr/local/gcc-4.0.1

4, the installation configuration file:

[Root @ linux gcc-4.0.1] # /opt/gcc-4.0.1/configure --prefix = / usr / local / gcc-4.0.1 / (This step is very important and needs in the target directory for the installation, /opt/gcc-4.0.1/ source directory execute the configure command to configure the target directory to install gcc /usr/local/gcc-4.0.1/)

creating cache ./config.cache

checking host system type ... i686-pc-linux-gnu

5, compile and install the file:

[Root @ linux gcc-4.0.1] # pwd

/usr/local/gcc-4.0.1

[Root @ linux gcc-4.0.1] # make (compile in the target directory)

6, installed gcc:

[Root @ linux gcc-4.0.1] # pwd

/usr/local/gcc-4.0.1

[Root @ linux gcc-4.0.1] # make install (installation in the target directory)

If the installation steps and commands no errors, you can certainly install successfully.

From svn checkout svn: //gcc.gnu.org/svn/gcc/trunk GCC took the latest code, and intend to compile a study to learn what things to learn C ++ 11, resulting in the following problem configure the time:
    Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+
1. Download mpc-0.9.tar.gz from http://www.multiprecision.org/index.php?prog=mpc&page=download
2, ftp: //ftp.gnu.org/gnu/gmp/gmp-5.0.1.tar.bz2 Download gmp-5.0.1.tar.bz2
3, http: //ftp.gnu.org/gnu/mpfr/ download mpfr-3.1.0.tar.xz.
    To start the installation GMP. After extracting archive GMP to obtain the source code directory gmp-5.0.1. The establishment of a temporary build directory at the same level of that directory, here named temp. Then start to configure the installation option, enter the temp directory, enter the following command to configure:

../gmp-5.0.1/configure --prefix = / usr / local / gmp-5.0.1

    make

    sudo make install

    mpfr and installation methods mpc similar to gmp. But pay attention to configure dependencies when put gmp and mpfr options added, the specific configuration commands are as follows:

../mpfr-3.1.0/configure --prefix = / usr / local / mpfr-3.1.0 --with-gmp = / usr / local / gmp-5.0.1

../mpc-0.9/configure --prefix = / usr / local / mpc-0.9 --with-gmp = / usr / local / gmp-5.0.1 --with-mpfr = / usr / local / mpfr-3.1 .0

After installing these three libraries, you can officially start the install gcc.

    Of course, the link, just need to compile three lib.

    export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: /usr/local/mpc-0.9/lib: /usr/local/gmp-5.0.1/lib: /usr/local/mpfr-3.1.0/lib

    Then the typical configure, make, install trilogy.

    ../trunk/configure --prefix = / usr / local / gcc-4.7 --enable-threads = posix --disable-checking --disable-multilib --enable-languages = c, c ++
--with-gmp = / usr / local / gmp-5.0.1 --with-mpfr = / usr / local / mpfr-3.1.0 --with-mpc = / usr / local / mpc-0.9

      make

      make check (optional)

      sudo make install

    After a long wait:

 /usr/local/gcc-4.7/bin/g++ -v
Use the built-in specs.
COLLECT_GCC = / usr / local / gcc-4.7 / bin / g ++
COLLECT_LTO_WRAPPER = / usr / local / gcc-4.7 / libexec / gcc / x86_64-unknown-linux-gnu / 4.7.0 / lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured to: ../ trunk / configure --prefix = / usr / local / gcc-4.7 --enable-threads = posix --disable-checking --disable-multilib --enable-languages = c, c ++ --with -gmp = / usr / local / gmp-5.0.1 --with-mpfr = / usr / local / mpfr-3.1.0 --with-mpc = / usr / local / mpc-0.9
Thread model: posix
gcc version 4.7.0 20120113 (experimental) (GCC)

Start learning the C ++ 11.
     
         
         
         
  More:      
 
- Python 2.7 installed on CentOS 6.5 (Linux)
- Ubuntu Slingscold (Linux)
- Open Ubuntu system updates (Linux)
- CentOS 7 install Hadoop-cdh-2.5 on Mesos (Server)
- Linux package manager - yum (Linux)
- Installation Strongswan: on a Linux IPsec-based VPN tool (Linux)
- Ubuntu 12.04 64bit Install Source Insight 3.5 and create desktop icons (Linux)
- Upgrade to Linux Mint 16 petra Mint 17 Qiana (Linux)
- 32-bit and 64-bit integer in PHP and MySQL range (Database)
- ORA-28000 the account is locked fault simulation (Database)
- AngularJS achieve picture upload feature (Programming)
- Linux print file and send mail (Linux)
- SecureCRT session buffer size settings (Linux)
- Use ldap implement Windows Remote Desktop Ubuntu Linux (Linux)
- The next key to install Linux bash script PowerShell (Linux)
- Scope of variables in C # (Programming)
- Java concurrent programming combat (using synchronized synchronization method) (Programming)
- Help you enhance Python programming languages 27 (Programming)
- FastDFS installation and deployment (Server)
- MySQL IO SSD attempt at optimization (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.