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:
subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-debug-rpms subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-source-rpms subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-debug-rpms subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-source-rpms
# subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-debug-rpms # subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-source-rpms # subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-debug-rpms # subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-source-rpms
Copy to Clipboard Copied! 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
# dnf install git
Copy to Clipboard Copied! 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"
$ git config --global user.name "Full Name" $ git config --global user.email "email@example.com"
Copy to Clipboard Copied! 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
$ git config --global core.editor command
Copy to Clipboard Copied! Replace command with the command to be used to start the selected text editor.
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"
# dnf group install "Development Tools"
Copy to Clipboard Copied! Install the LLVM-based toolchain including the
clang
compiler andlldb
debugger:dnf install llvm-toolset
# dnf install llvm-toolset
Copy to Clipboard Copied! Optional: For Fortran dependencies, install the GNU Fortran compiler:
dnf install gcc-gfortran
# dnf install gcc-gfortran
Copy to Clipboard Copied!
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
# dnf install gdb valgrind systemtap ltrace strace
Copy to Clipboard Copied! Install the dnf-utils package in order to use the
debuginfo-install
tool:dnf install dnf-utils
# dnf install dnf-utils
Copy to Clipboard Copied! Run a SystemTap helper script for setting up the environment.
stap-prep
# stap-prep
Copy to Clipboard Copied! 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
# dnf install perf papi pcp-zeroconf valgrind strace sysstat systemtap
Copy to Clipboard Copied! Run a SystemTap helper script for setting up the environment.
stap-prep
# stap-prep
Copy to Clipboard Copied! 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
# systemctl enable pmcd && systemctl start pmcd
Copy to Clipboard Copied!