Install the GO Runtime Environment and Its Development Tool LiteIDE on CentOS

Source: Internet
Author: User
Tags install go

Install the GO Runtime Environment and Its Development Tool LiteIDE on CentOS

Five years ago, I thought that if Microsoft had a set of C-language-based easy-to-Develop Web frameworks, the performance would be much higher than Asp. Net. Later, I learned that PHP has good performance, but I hate to write background code in HTML pages, so I once despised PHP. Recently, due to the popularity of cloud computing, the GO language has also been sought after. Next I will try to install GO runtime and development tools on the CentOS system.

1. Install the GO Runtime Environment

1. to install the GO runtime environment, make sure that the GCC compiler is installed on the machine. To check whether GCC is installed on the host, simply enter "gcc -- version". If the GCC version information is displayed, it indicates that the host has been installed, otherwise, the system prompts that the command cannot be found. If GCC is not installed, the installation is extremely simple, just like this:

sudo yum install gcc

2. Download The GO running environment package (FQ required): https://golang.org/dl /. The installation instructions are available at http://golang.org/doc/install. If you install it from the source code, the document address is http://golang.org/doc/install/source. Next I will talk about my installation steps:

First, extract the downloaded go1.4.2.linux-amd64.tar.gz package to the/tmp directory, and then copy the decompressed "go" folder to "/usr/local ".

2. Start the installation and go to the "/usr/local/go/src" directory. Run the following command as root:

sudo ./all.bash

After the installation is complete, the "all tests passed" prompt appears. In this prompt, We are prompted to add the "/usr/local/go/bin" PATH to the "PATH" environment variable. Therefore, we open "~ The/. bashrc file adds the GO environment variable to the PATH.

Then we enter ". ~ /. Bashrc "to reload the configuration file you just set. Enter "go" in the shell. If the instructions for the go command appear, the installation is successful.

Go language development tool LiteIDE x24 release and download

LiteIDE Development Tool Guide (Go language development tool)

Build a development environment using Google Go

Install Go Language Pack in Ubuntu

Go language programming (HD) full-version ebook

2. Install GO Integrated Development Tool LiteIDE

1. Download The LiteIDE source code package: https://github.com/visualfc/liteide.

2. Extract the downloaded package “liteide-master.zip to the "/tmp" directory, move the decompressed folder to the "/usr/local" directory, and rename it.

unzip liteide-master.zip -d /tmp
sudo mv /tmp/liteide-master /usr/local/liteide

3. Install the required Qt package

According to the official documentation, the Qt package is required to compile the liteide source code. Therefore, we must first download the latest Qt development package: https://qt-project.org/downloads. Taking me as an example, I downloaded an offline installation package "qt-opensource-linux-x64-5.4.1.run" over 500 MB ". Put it in the "/tmp" folder and double-click it to install it.

Then, set the Qt environment variable "QTDIR". I still put it in "~ In the/. bashrc file, Run "QTDIR = $ HOME/Qt5.4.1/5.4/gcc_64" on my machine ".

After setting the environment variables of Qt, we will officially execute the installation command:

(1) first enter the following directory:

cd /usr/local/liteide/build

(2) then run the update package command (Note: FQ before execution ):

./update_pkg.sh

(3) Compile linux liteide:

./build_linux.sh

An error is reported when the execution is half done. The prompt is as follows (If your machine does not report an error, Jump directly to step (4 ):

The error message indicates that the "lGL" cannot be found. Is this a magic horse? After several searches on the Internet, I finally found out what this error meant. The original errors such as "/usr/bin/ld: cannot find-lxxx" were all due to missing library files, the name format of the missing library is "libxxx. so ", so I should be missing" libGL. so file. So I tried to install it online:

sudo yum install libGL

The result shows that this package has been installed:

Then I want to know where it is:

rpm -ql mesa-libGL-9.2.5-6.20131218.el7_0.x86_64

The result is found below:

/Usr/lib64/libGL. so.1
/Usr/lib64/libGL. so.1.2.0
/Usr/share/doc/mesa-libGL-9.2.5
/Usr/share/doc/mesa-libGL-9.2.5/COPYING

After finding this, You can hard link it to the "/usr/lib" directory:

cd /usr/lib
ln /usr/lib64/libGL.so.1.2.0 /usr/lib/libGL.so

Of course, you can also soft link this to the "/usr/lib" directory by adding the "-s" parameter after the "ln" command.

Then try step (3) to install the SDK.

(4) Add a desktop shortcut to LiteIDE:

ln -s /usr/local/liteide/build/liteide/bin/liteide $HOME/Desktop/liteide

Finally, run the shortcut on the desktop to view the LiteIDE interface.

3. Configure and run LiteIDE

1. First, we need to add a "GOPATH" environment variable to LiteIDE, which is a bit like the project folder "E: \ VS2012 \ Projects" we set in Visual Studio ".

Find the menu bar, choose View> Manage GOPATH to open the Management window, and then add the GOPATH environment variable in the Management window:

2. Create a helloworld project:

3. Write the test code:

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.