Hướng dẫn cài đặt gcc-7.3.0 trên CentOS 6 và CentOS 7

Hướng dẫn cài đặt gcc-7.3.0 trên CentOS 6 và CentOS 7

Tay vợt xinh đẹp 26 tuổi Eugenie Bouchard người Canada nhận hàng triệu email

Average: 3 (2 votes)

Siêu cò nữ bốc lửa nhất thế giới Wanda Nara đốt cháy mạng xã hội

Average: 1 (1 vote)

Hướng dẫn cài đặt gcc-7.3.0 trên CentOS 6 và CentOS 7

In this tutorial, we will take a look at how to install GCC on CentOS 7. GCC or GNU Compiler Collection is released by the Free Software Foundation and as the name suggests, it is a very useful collection of programming compilers such as C, C++, Objective-C, Objective-C++, Fortran, Java, Go and Ada. GCC is an official compiler of the GNU operating system but also it is a standard compiler on many Unix operating systems such as Linux. Installing GCC on CentOS 7, is really an easy task and it shouldn’t take more than 10 minutes

1. Update the server

First of all log in to your CentOS 7 VPS via SSH as user root

ssh root@IP_Address -p Port_number

and make sure that all installed packages on the server are up to date

yum -y update

2. Install GCC from repository

GCC can be easily installed from the official CentOS repositories. Run the following command to install GCC on your server

yum -y install gcc

Once the installation is completed, you can the version of GCC installed on your server

gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As might be seen from the output, the GCC version distributed by CentOS 7 is 4.8.5 which is not the latest version of GCC.

You may also want to install gcc-c++. It will automatically include the C++ library and compile files with extensions that indicate they are C source as C++, instead of as C.

yum -y install gcc-c++

3. Install GCC from source

If you need a newer version of GCC than the one distributed by the official CentOS 7 repositories you can install it from source.

It is highly recommended to start a screen session before starting the installation. Run the following command

screen -U -S gcc

Download the tarball of the GCC version you want to install. In our example we will use GCC version 7.3.0

wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz

Unpack the tar archive and change the current working directory

tar zxf gcc-7.3.0.tar.gz
cd gcc-7.3.0

Install bzip2 and run the ‘download_prerequisites’ script to download some prerequisites needed by GCC. You have to run this from the top level of the GCC source tree.

yum -y install bzip2
./contrib/download_prerequisites

Once the prerequisites are downloaded execute the following command to start configuring the GCC build environment

./configure --disable-multilib --enable-languages=c,c++

Once it is completed, run the following command to compile the source code. It may take a few hours for the compilation to complete, so sit back and relax.

make -j 4
make install

4. Verify GCC installation on CentOS 7

After the compilation process is completed. You can check if GCC is properly installed.

gcc --version

gcc (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Of course, you don’t have to install GCC on CentOS 7,  if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to install GCC on your CentOS 7 server for you. They are available 24×7 and will take care of your request immediately.

Cherry Quahst Official

PS. If you liked this post, on how to install GCC on CentOS 7,  please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks

Bạn thấy bài viết này như thế nào?: 
Average: 10 (1 vote)

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Spaces.module là Drupal Multi-site alternative
Spaces.module là Drupal Multi-site alternative

If you want to share users, content and configuration between Drupal sites you have several options.

How To Get Facebook For Android Phones
How To Get Facebook For Android Phones

It may look like a very simple task; browsing through the Android market to get an app that suits you, but the reality is its not.

Cách thiết lập chiều rộng tối thiểu và tối đa các tab trong Firefox
Cách thiết lập chiều rộng tối thiểu và tối đa các tab trong Firefox

Nếu bạn thường xuyên mở rất nhiều tab trong Firefox, đôi khi bạn sẽ không thể nhìn thấy tất cả các tab đã mở do chúng quá nhỏ, và cách duy nhất để di chuyển giữa các tab là sử dụng các mũi tên di chuyển tab. Có vô số tiện ích sẵn có trên Firefox có thể giúp mở nhiều thanh tab, chẳng hạn như Tab Utilities. Tuy nhiên, tiện ích này không hề được coi lý tưởng, vì nó tạo ra rất nhiều động khi bạn mở nhiều tab.