Chapter 1. Setting up a development workstation
Red Hat Enterprise Linux 9 supports development of custom applications. To allow developers to do so, the system must be set up with the required tools and utilities. This chapter lists the most common use cases for development and the items to install.
1.1. Prerequisites
- The system must be installed, including a graphical environment, and subscribed.
1.2. Enabling debug and source repositories
A standard installation of Red Hat Enterprise Linux does not enable the debug and source repositories. These repositories contain information needed to debug the system components and measure their performance.
Procedure
Enable the source and debug information package channels: The
$(uname -i)
part is automatically replaced with a matching value for architecture of your system:Architecture name Value 64-bit Intel and AMD
x86_64
64-bit ARM
aarch64
IBM POWER
ppc64le
64-bit IBM Z
s390x
1.3. Setting up to manage application versions
Effective version control is essential to all multi-developer projects. Red Hat Enterprise Linux is shipped with Git, a distributed version control system.
Procedure
Install the git package:
# dnf install git
Optional: Set the full name and email address associated with your Git commits:
$
git config --global user.name "Full Name"
$git config --global user.email "email@example.com"
Replace Full Name and email@example.com with your actual name and email address.
Optional: To change the default text editor started by Git, set value of the
core.editor
configuration option:$
git config --global core.editor command
Replace command with the command to be used to start the selected text editor.
Additional resources
Linux manual pages for Git and tutorials:
$ man git $ man gittutorial $ man gittutorial-2
Note that many Git commands have their own manual pages. As an example see git-commit(1).
1.4. Setting up to develop applications using C and C++
Red Hat Enterprise Linux includes tools for creating C and C++ applications.
Prerequisites
- The debug and source repositories must be enabled.
Procedure
Install the Development Tools package group including GNU Compiler Collection (GCC), GNU Debugger (GDB), and other development tools:
# dnf group install "Development Tools"
Install the LLVM-based toolchain including the
clang
compiler andlldb
debugger:# dnf install llvm-toolset
Optional: For Fortran dependencies, install the GNU Fortran compiler:
# dnf install gcc-gfortran
1.5. Setting up to debug applications
Red Hat Enterprise Linux offers multiple debugging and instrumentation tools to analyze and troubleshoot internal application behavior.
Prerequisites
- The debug and source repositories must be enabled.
Procedure
Install the tools useful for debugging:
# dnf install gdb valgrind systemtap ltrace strace
Install the dnf-utils package in order to use the
debuginfo-install
tool:# dnf install dnf-utils
Run a SystemTap helper script for setting up the environment.
# stap-prep
Note that stap-prep installs packages relevant to the currently running kernel, which might not be the same as the actually installed kernel(s). To ensure stap-prep installs the correct kernel-debuginfo and kernel-headers packages, double-check the current kernel version by using the
uname -r
command and reboot your system if necessary.-
Make sure
SELinux
policies allow the relevant applications to run not only normally, but in the debugging situations, too. For more information, see Using SELinux.
1.6. Setting up to measure performance of applications
Red Hat Enterprise Linux includes several applications that can help a developer identify the causes of application performance loss.
Prerequisites
- The debug and source repositories must be enabled.
Procedure
Install the tools for performance measurement:
# dnf install perf papi pcp-zeroconf valgrind strace sysstat systemtap
Run a SystemTap helper script for setting up the environment.
# stap-prep
Note that stap-prep installs packages relevant to the currently running kernel, which might not be the same as the actually installed kernel(s). To ensure stap-prep installs the correct kernel-debuginfo and kernel-headers packages, double-check the current kernel version by using the
uname -r
command and reboot your system if necessary.Enable and start the Performance Co-Pilot (PCP) collector service:
# systemctl enable pmcd && systemctl start pmcd