Gnu software on linux

Installing C and C++ compiler (GNU GCC Compiler) On Ubuntu/Debian Linux

This post will guide you how to install the GNU C compiler and GNU C++ compiler under Ubuntu/Debian Linux. How do I install C, C++ compiler and Development Tools on Ubuntu 16.04/18.04 Linux. How to Install GNU GCC Compiler and Development Environment under Ubuntu/Debian Operating system. How to install the manpages for C and C++ development on Ubuntu.

What is GCC?

GCC is the GNU compiler collection, and it includes front ends for C, C++, Objective-C, Fortran, Ada, and Go, as well as libraries for these languages (libstdc++,…). GCC was originally written as the compiler for the GNU operating system.

To install GCC and G++ compiler, You need to install the build-essential package, and this package contains a list of packages which are essential for building Ubuntu Development including GCC compiler, G++ compiler, Make, dpkg-dev and other packages.

GCC is the compiler of C program, and G++ is the compiler of C++ program.

Installing Compilers on Ubuntu

You can simply install build-essential package using apt-get command on Ubuntu/Debian Linux, Type:

$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get install build-essential

Or you can also use the apt command to install package, type:

$ sudo apt update $ sudo apt upgrade $ sudo apt install build-essential
devops@devops-osetc:~$ sudo apt install build-essential sudo: unable to resolve host devops-osetc [sudo] password for devops: Reading package lists. Done Building dependency tree Reading state information. Done build-essential is already the newest version (12.1ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 599 not upgraded.

Now you should able to compile C/C++ programs using gcc/G++ compilers.

Checking Versions of Compiler

After you installed the build-essential package on your Ubuntu/Debian Linux system, you can check the installed version of gcc or g++ compiler to check if the compilers are installed properly. Type:

devops@devops-osetc:~$ gcc --version gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 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.
devops@devops-osetc:~$ g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 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.
devops@devops-osetc:~$ make --version GNU Make 4.1 Built for x86_64-pc-linux-gnu Copyright (C) 1988-2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Installing the manpages for C and C++ development

To install the manpages for c and c++ development, you can install manpages-dev package, type:

$ sudo apt-get install manpages-dev
devops@devops-osetc:~$ sudo apt-get install manpages-dev sudo: unable to resolve host devops-osetc Reading package lists. Done Building dependency tree Reading state information. Done manpages-dev is already the newest version (4.04-2). 0 upgraded, 0 newly installed, 0 to remove and 599 not upgraded.

Compile C and C++ Program with GNU GCC Compiler

Let’s write down a simple C program to test C compiler, open your vi text editor and appending the following code, and save as fio.c:

Читайте также:  Usb stick formatter linux

Save and close the file. and then execute the below command to compile the fio.c program as an executable file named as fio.type:

then you can run the C profile, type:

devops@devops-osetc:~$ gcc fio.c -o fio devops@devops-osetc:~$ ./fio hello world

You can also write a C++ program named fio.cc via vim editor, and append the following code:

#include using namespace std; int main()

Save and close the file fio.cc, and executing the following command to compile and execute it:

devops@devops-osetc:~$ vim fio.cc devops@devops-osetc:~$ g++ -o fio fio.cc devops@devops-osetc:~$ ./fio Hello world!

Источник

Gnu software on linux

With the abundance of inexpensive computers that can run GNU/Linux, as well as the greater availability of Internet access, many GNU volunteers today have all the computer facilities they need. However, there are still advantages to having central computers where GNU volunteers can work together without having to make their own machines accessible to others.

For that reason, the Free Software Foundation strongly encourages GNU software projects to use the machines at gnu.org as a home base. Using these machines also benefits the GNU Project indirectly, by increasing public awareness of GNU, and spreading the idea of working together for the benefit of everyone.

Savannah and version control

If you are developing an official GNU package, we strongly recommend using a public source control repository on Savannah, the GNU hosting server. To do this, first create yourself an account and then register your GNU package. After it is created, you will be able to choose a version control system, create web pages for your package, manage permissions for contributors to the pages, and many other features.

Mailing lists

We operate mailing lists for GNU software packages as needed, including both hand-managed lists and automatically managed lists.

Читайте также:  Red flag linux desktop

When a GNU package is registered on Savannah, a web interface allows developers to create and manage mailing lists dedicated to their package.

Each GNU package name ought to have at least a bug-reporting list with the canonical name bug- pkgname @gnu.org , plus any aliases that may be useful. Using Savannah, you can create lists for your package with names like this. Some packages share the list bug-gnu-utils@gnu.org but we now encourage packages to set up their own individual lists.

Packages can have other lists for announcements, asking for help, posting source code, for discussion among users, or whatever the package maintainer finds to be useful.

Mailing list archives for automatically-managed lists are available at lists.gnu.org (mbox archives can be downloaded by HTTPS), as well as through the list manager. Archives for hand-maintained lists are generally kept in /com/archive on the GNU machines.

When a mailing list becomes large enough to justify it, we can set up a gnu.* newsgroup with a two-way link to the mailing list.

Web pages

The master GNU web server is www.gnu.org. We very strongly recommend that GNU packages use https://www.gnu.org/software/ pkgname as their primary home page.

Using Savannah, developers can create and maintain their own pages at that url via a CVS “web repository,” separate from the package’s main source repository (which can use any supported version control system). More information on maintaining GNU web pages.

FTP

The primary ftp site for GNU software on https://ftp.gnu.org/gnu , which is mirrored worldwide. We very strongly recommend that all GNU packages upload their releases here (in addition to any other location you find convenient).

The Information for GNU Maintainers document has complete details on the ftp upload process, which is the same for both servers.

Login accounts

We provide shell login access to GNU machines to people who need them for work on GNU software. Having a login account is both a privilege and a responsibility, and they should be used only for your work on GNU. Instructions for obtaining an account machines are written separately.

On the general login machine, the gsrc package developers maintain a hierarchy of the current GNU package releases ( /gd/gnu/gnusys/live ), compiled from the original sources. To use it, source /gd/gnu/gnusys/live/setup .

Hydra: Continuous builds and portability testing

Continuous build tools (often referred to as continuous integration tools) allow programming errors to be spotted soon after they are introduced in a software project, which is particularly useful for cooperatively developed software.

Hydra is a free continuous build tool based on the Nix package manager. Administrators of the Hydra instance at the Delft University of Technology have generously offered slots for the GNU Project. Projects on Hydra get re-built at each commit or change in their dependencies, whichever comes first (dependencies include the standard build environment being used, which itself contains recent released versions of GCC, GNU make, etc.)

Читайте также:  Линукс обновление драйверов видеокарты

Currently it can build software on GNU/Linux ( i686 and x86_64 ) as well as FreeBSD, Darwin, Solaris, and Cygwin, and can cross-build for GNU/Hurd, GNU/Linux on other architectures, and MinGW. It can provide code coverage reports produced using LCOV. In addition to source tarballs and Nix packages, it can build packages for deb — and RPM -based distributions. Packages can be built against the latest versions of their dependencies; for instance, GnuTLS is built using GNU libtasn1 and GNU libgcrypt builds corresponding to their latest revision.

In addition to the web interface, Hydra can send notifications by email when the build status of a project changes—e.g., from SUCCEEDED to FAILED . When a build fails, its log and build tree are accessible from the web interface; the latter allows generated files (for example, config.log or testsuite.log ) to be inspected, which provides debugging hints.

Any GNU software package can request a slot on Hydra. Each package must provide its own “build recipe” written in the Nix language (a Nix expression, in Nix parlance). Nix expressions for GNU projects are available via Git. For simple projects using standard GNU build tools such as Automake and Autoconf, the recipe is usually fairly simple. For example, see the recipe for GNU Patch. You are welcome to ask for guidance on < hydra-users@gnu.org>.

After constructing your build recipe, email hydra-users@gnu.org and ask to be included in Hydra. Also make sure to become a member of the hydra-recipes project at Savannah. This will allow you to customize your project’s build job directly.

platform-testers: Manual portability testing

Another useful option for pre-release testing is the platform-testers mailing list. Time permitting, the people on this list build pre-releases on a wide variety of platforms upon request. (Volunteers to handle testing requests are needed! Just subscribe to the list and start participating.)

In contrast to the Hydra tool described above, the platform-testers list works essentially by hand, so each method has its advantages and disadvantages. Also, the platform-testers crew has access to a wider variety of platforms and compilers than the Hydra setup.

So, if you have a pre-release, you can write to the mailing list, providing (1) the url to the tarball, (2) the planned date of the release, and (3) the email address to which build reports should be sent. The builds and reports are made by hand by the volunteers on the list.

Источник

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