Gnu global linux install

Gnu global linux install

Copyright (c) 2000-2018 Tama Communications Corporation

GNU Global is a source code tagging system that works the same way across diverse environments, such as Emacs editor, Vi editor, Less viewer, Bash shell, various web browsers, etc.

You can locate various objects, such as functions, macros, structs, classes, in your source files and move there easily. It is useful for hacking on large projects which contain many sub-directories, many #ifdef and many main() functions. It is similar to ctags or etags, but is different from them in the following two points:

  • independence of any editor
  • capability to treat definition and reference

It runs in UNIX (POSIX) compatible operating system, like GNU and BSD.

GNU Global is part of the GNU project, and is free software. You can freely copy, modify and redistribute this program under GNU GPL.

GNU Global has the following features:

  • supports 5 languages by built-in parser. (definition and reference)
    C, Yacc, Java, PHP4 and assembly.
  • supports 25 languages by Pygments + Universal Ctags plug-in parser. (definition and reference)
    Awk, Dos batch, COBOL, C, C++, C#, Erlang, Fortran, Java, JavaScript, Lisp, Lua, Pascal, Perl, PHP, Python, Ruby, Matlab, OCaml, Scheme, Tcl, TeX, Verilog, Vhdl and Vim.
    To use the parser, please see the file ‘plugin-factory/PLUGIN_HOWTO.pygments’ in the package.
  • works the same way across diverse environments like follows:
    • Shell command line
    • Bash shell
    • Vi editor (Nvi, Elvis, vim)
    • Less viewer
    • Emacs editor (Emacs, Mule, Xemacs)
    • Web browser (See UNIX kernel source tour!.)
    • Doxygen documentation system
  • finds locations of specified symbol quickly.
  • locate not only definitions but also references.
  • allows duplicate tags.
  • locate paths which matches to the specified pattern.
  • hierarchical searches by default.
  • searches not only in a source project but also in library projects.
  • generates completion list for completing input method.
  • supports various output formats.
  • allows customizing of the set of candidate files to be tagged.
  • understands POSIX 1003.2 regular expression.
  • supports idutils as an external search engine.
  • tag files are independent of machine architecture.
  • supports incremental updating of tag files.
  • plug-in parser is available to treat new language.
  • supports customizing with gtags.conf.
  • generates a hypertext of source code.
  • compact format to save disk space.
  • supports client/server environment (TRAMP ready).
  • ignores binary files, dot files and specified files.
  • includes cscope-compatible program (gtags-cscope).
  • includes grep-like command (-g command).
  • deals with loop of symbolic links well.

Please also see ‘Comparison with Similar Tools’ in the OpenGrok project site for comparison with other tools.

If you have a plan to make a yet another editor with tag facility, you can use Global for it.

May the Global be under you like the globe!

Источник

jclosure / install_global.sh

#! /bin/bash
# install_global.sh
echo » install_global.sh . «
echo » install package for GNU global. «
sudo apt-get update
sudo apt-get -y install curl
sudo apt-get -y install wget
sudo apt-get -y install ncurses-dev
sudo apt-get -y install exuberant-ctags
sudo apt-get -y install python
CUR= ` pwd `
echo » install GNU global. «
# TODO: Make a dpkg instead of just install
# get latest from: https://ftp.gnu.org/gnu/global/
wget https://ftp.gnu.org/gnu/global/global-6.5.tar.gz
tar zxvf global-6.5.tar.gz
cd global-6.5
./configure
make
sudo make install
cd $CUR
# find a better way to do this..
echo » install pip. «
curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
echo » install pygments. «
sudo pip install pygments==1.6
echo » $0 done. «
exit 0
Читайте также:  Linux mint масштабирование экрана

This comment has been minimized.

Copy link Quote reply

jclosure commented Aug 3, 2017

This should be made into a .dpkg instead of installed directly. https://community.linuxmint.com/tutorial/view/162

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

haru-ake / using_gnu_global.md

Using GNU GLOBAL

About GNU GLOBAL

GNU GLOBAL is a source code tagging system that works the same way across diverse environments, such as Emacs editor, Vi editor, Less viewer, Bash shell, various web browsers, etc. You can locate various objects, such as functions, macros, structs, classes, in your source files and move there easily. It is useful for hacking a large projects which contain many sub-directories, many #ifdef and many main() functions. It is similar to ctags or etags

  • independence of any editor
  • capability to treat definition and reference

ctags や etags と似たようなもの。大きな違いは capability to treat definition and reference で、ようは ctags や etags では出来ない関数の呼び出し元の参照が出来る。

  • supports 6 languages by built-in parser. (definition and reference) C, C++, Yacc, Java, PHP4 and assembly.
  • supports 25 languages by Pygments + Universal Ctags plug-in parser. (definition and reference) Awk, Dos batch, COBOL, C, C++, C#, Erlang, Fortran, Java, JavaScript, Lisp, Lua, Pascal, Perl, PHP, Python, Ruby, Matlab, OCaml, Scheme, Tcl, TeX, Verilog, Vhdl and Vim.

ビルトインパーサだと 6 種類の言語に対応していて、プラグインパーサ(Pygments と Universal Ctags の組み合わせ) を使うと 25 種類の言語に対応している。

Pygments + Universal Ctags でタグ情報を生成出来るようにインストールする。

macOS で homebrew を使っているので下記のように。

まずは Universal Ctags をインストールする。

続いて GNU GLOBAL もインストールする。オプションに —with-ctags を付けると Exuberant Ctags も一緒にインストールされてしまい、Universal Ctags とコンフリクトするので今回は付けない。

default:\ のパーサに Pygments も併用するようにする。

Pygments と併用する Universal Ctags のパスを pygments-parser|Pygments plug-in parser:\ の中の ctagscom= に指定する。 ctags とだけ書いておけば PATH の通ったところにあるものを使ってくれる。絶対パス指定も出来るけど設定ファイルの共有が難しくなるので今回はしない。

Create tag files

タグ情報を生成してみる。ソースコードのルートディレクトリで gtags コマンドを実行すれば良い。 —explain オプションを付けると各ファイルの言語が何と認識されているか、パーサに何が使われているか等が分かる。

Pygments/Ctags が対応していない言語の場合はタグ情報の生成が出来ないので GRTAGS, GTAGS の中身が空(上記のコマンド出力のように) になる。

Pygments/Ctags と生成される GRTAGS, GTAGS の関係は下記の図が分かり易い。

Источник

1 Introduction to Global

1.1 Background

I have introduced many web code reading tools before, I want to see it recently Linux Kernel code, originally wanted to build one LXR server.

But thought of the internal use of the company GNU GLOBAL Server built. Then Baidu’s. Found to build GLOBAL Than LXR It’s much simpler, and equally powerful, suitable for individuals or small teams to read the code. Since LXR If this road is unworkable, let’s go another way. Use decisively GLOBAL Substitute LXR .

1.2 Global

Summary : GNU GLOBAL Is a source code marking system that works in different environments in the same way, such as Emacs editor, Vi editor, Less viewer , Bash shell , And various web Browser and so on.

GNU GLOBAL It is a source code marking system, which can read and index code in many aspects. GNU GLOBAL Work in different environments in the same way, such as Emacs editor, Vi editor, Less viewer , Bash shell , And various web Browser etc.

Use GNU GLOBAL , In your source code, you can find different objects and move them easily, such as functions, macros, structures, classes, etc. This is very useful for large projects, especially those that contain many subdirectories, many #ifdef And a lot main( ) Function item.

It is similar to ctags Or etag , But there are two differences:

Ability to handle definitions and references

GNU GLOBAL Can run on UNIX (POSIX) Compatible systems, such as GNU with BSD . GNU GLOBAL There are many languages ​​supported, it supports itself C, C++, Yacc, Java, PHP4 And the definition and reference of symbols in assembly language, also through Exuberant Ctags stand by 40 Index of symbol definitions for the remaining languages.

Читайте также:  Mac os читает windows файлы

As GNU Part of the project, GNU GLOBAL It is free software, you can freely copy, modify and redistribute under the plan GNU GPL .

Unix/Linux Users can install directly from the warehouse. No other settings are required after installation.

Windows Users can click here to download.

More about GNU GLOBAL For the introduction, please check here:

2 Installation

2.1 Use the built-in source to install global

2.2 Compile and install global

Ubuntu 14.04 Comes with GLOBAL Version is 5.7.1 But the official website is already 6.6 . So if you want to use the latest version GLOBAL , You need to compile and install it yourself.

  • Install and compile dependent libraries

Move to GNU GLOBAL Official download the latest tar.gz Pack and unwrap.

3 Use GLOBAL

Suppose we want to generate Linux Kernel Analysis of html
execute

Of course you can download it directly linux kernel tar After the package arrives locally, unzip it.

Enter Linux Kernel Directory

  • carried out gtags Generate index data

Of course, you can also add —sqlite3 Parameters, below are —help The given parameter help information.

tag After the file is generated, execute htags Command generation HTML file.

HTML » title=»»/>

3.2 Configuration Service

GLOBAL Comes with one HTTP SERVER , Can be used directly htags-server start up

htags-server » title=»»/>

If you run directly htags-server , I found that the external network cannot access my GLOBAL web The server, read the help file, and execute the following code:

If you do not fill in the port number, the default port 8000 , If you want to 8080 Port open service, it seems to be sudo , Otherwise report an error, for some reason.

If you want to use Apache Service came to visit web Service, you need to htags Add when -D Or -f Options.

For more help information, please refer to —help or refer to the official documentation.
Official document:http://www.gnu.org/software/global/globaldoc.html

3.3 Incremental update

GLOBAL supports incremental updates, global -u This command will automatically find project/GTAGS , And update its content. gtags The advantage is here, the incremental update of a single file is extremely fast, and it is almost instantaneous.

4 references

useCreative Commons Attribution-Non-commercial Use-Same Way Sharing 4.0 International License AgreementGet permission. Welcome to reprint, use, and republish, but be sure to keep the article’s signatureCheng Jian gatieme (Include link:http://blog.csdn.net/gatieme ), not for commercial purposes.

Modified works based on this article must be published under the same license. If you have any questions, please contact me.

Источник

1 Introduction to Global

1.1 Background

I have introduced many web code reading tools before, I want to see it recently Linux Kernel code, originally wanted to build one LXR server.

But thought of the internal use of the company GNU GLOBAL Server built. Then Baidu’s. Found to build GLOBAL Than LXR It’s much simpler, and equally powerful, suitable for individuals or small teams to read the code. Since LXR If this road is unworkable, let’s go another way. Use decisively GLOBAL Substitute LXR .

1.2 Global

Summary : GNU GLOBAL Is a source code marking system that works in different environments in the same way, such as Emacs editor, Vi editor, Less viewer , Bash shell , And various web Browser and so on.

Читайте также:  Lenovo ideapad freedos как установить windows

GNU GLOBAL It is a source code marking system, which can read and index code in many aspects. GNU GLOBAL Work in different environments in the same way, such as Emacs editor, Vi editor, Less viewer , Bash shell , And various web Browser etc.

Use GNU GLOBAL , In your source code, you can find different objects and move them easily, such as functions, macros, structures, classes, etc. This is very useful for large projects, especially those that contain many subdirectories, many #ifdef And a lot main( ) Function item.

It is similar to ctags Or etag , But there are two differences:

Ability to handle definitions and references

GNU GLOBAL Can run on UNIX (POSIX) Compatible systems, such as GNU with BSD . GNU GLOBAL There are many languages ​​supported, it supports itself C, C++, Yacc, Java, PHP4 And the definition and reference of symbols in assembly language, also through Exuberant Ctags stand by 40 Index of symbol definitions for the remaining languages.

As GNU Part of the project, GNU GLOBAL It is free software, you can freely copy, modify and redistribute under the plan GNU GPL .

Unix/Linux Users can install directly from the warehouse. No other settings are required after installation.

Windows Users can click here to download.

More about GNU GLOBAL For the introduction, please check here:

2 Installation

2.1 Use the built-in source to install global

2.2 Compile and install global

Ubuntu 14.04 Comes with GLOBAL Version is 5.7.1 But the official website is already 6.6 . So if you want to use the latest version GLOBAL , You need to compile and install it yourself.

  • Install and compile dependent libraries

Move to GNU GLOBAL Official download the latest tar.gz Pack and unwrap.

3 Use GLOBAL

Suppose we want to generate Linux Kernel Analysis of html
execute

Of course you can download it directly linux kernel tar After the package arrives locally, unzip it.

Enter Linux Kernel Directory

  • carried out gtags Generate index data

Of course, you can also add —sqlite3 Parameters, below are —help The given parameter help information.

tag After the file is generated, execute htags Command generation HTML file.

HTML » title=»»/>

3.2 Configuration Service

GLOBAL Comes with one HTTP SERVER , Can be used directly htags-server start up

htags-server » title=»»/>

If you run directly htags-server , I found that the external network cannot access my GLOBAL web The server, read the help file, and execute the following code:

If you do not fill in the port number, the default port 8000 , If you want to 8080 Port open service, it seems to be sudo , Otherwise report an error, for some reason.

If you want to use Apache Service came to visit web Service, you need to htags Add when -D Or -f Options.

For more help information, please refer to —help or refer to the official documentation.
Official document:http://www.gnu.org/software/global/globaldoc.html

3.3 Incremental update

GLOBAL supports incremental updates, global -u This command will automatically find project/GTAGS , And update its content. gtags The advantage is here, the incremental update of a single file is extremely fast, and it is almost instantaneous.

4 references

useCreative Commons Attribution-Non-commercial Use-Same Way Sharing 4.0 International License AgreementGet permission. Welcome to reprint, use, and republish, but be sure to keep the article’s signatureCheng Jian gatieme (Include link:http://blog.csdn.net/gatieme ), not for commercial purposes.

Modified works based on this article must be published under the same license. If you have any questions, please contact me.

Источник

Оцените статью