Chapter 1. Setting up a development workstation
Red Hat Enterprise Linux 10 supports development of custom applications. Learn about common development use cases and the required tools. You must ensure that the RHEL system, including a graphical environment, is installed and subscribed.
1.1. Enabling debug and source repositories Copy linkLink copied to clipboard!
To debug system components and measure their performance, enable the debug and source repositories. These repositories contain the required information for debugging and profiling but are disabled by default in a standard Red Hat Enterprise Linux installation.
Procedure
Enable the BaseOS debug information package channel:
# subscription-manager repos --enable rhel-10-for-$(uname -i)-baseos-debug-rpmsEnable the BaseOS source package channel:
# subscription-manager repos --enable rhel-10-for-$(uname -i)-baseos-source-rpmsEnable the AppStream debug information package channel:
# subscription-manager repos --enable rhel-10-for-$(uname -i)-appstream-debug-rpmsEnable the AppStream source package channel:
# subscription-manager repos --enable rhel-10-for-$(uname -i)-appstream-source-rpmsThe
$(uname -i)part is automatically replaced with a matching value for architecture of your system:Expand Table 1.1. Values produced by $(uname -i) for each architecture Architecture name Value 64-bit Intel and AMD
x86_64
64-bit ARM
aarch64
IBM POWER
ppc64le
64-bit IBM Z
s390x
1.2. Setting up to manage application versions Copy linkLink copied to clipboard!
To manage application versions in multi-developer projects, use Git, a distributed version control system included in Red Hat Enterprise Linux.
Procedure
Install the
gitpackage:# dnf install gitOptional: Set the full name associated with your Git commits:
$ git config --global user.name "Full_Name"Optional: Set the email address associated with your Git commits:
$ git config --global user.email "email@example.com"Replace Full Name and email@example.com with your name and email address.
Optional: To change the default text editor started by Git, set the value of the
core.editorconfiguration option:$ git config --global core.editor commandReplace command with the command to be used to start the selected text editor.
1.3. Setting up to develop applications using C and C++ Copy linkLink copied to clipboard!
To develop applications using C and C++, install the necessary development tools and compilers provided by Red Hat Enterprise Linux. This procedure describes how to install the standard development tools, including the GNU Compiler Collection (GCC), GNU Debugger (GDB), and the LLVM toolset.
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
clangcompiler and thelldlinker:# dnf install llvm-toolsetOptional: For Fortran dependencies, install the GNU Fortran compiler:
# dnf install gcc-gfortran
1.4. Setting up to debug applications Copy linkLink copied to clipboard!
To analyze and troubleshoot internal application behavior, {ProductName} offers multiple debugging and instrumentation tools.
Prerequisites
- The debug and source repositories is enabled.
Procedure
Install the tools for debugging:
# dnf install gdb valgrind systemtap ltrace straceInstall the
dnf-utilspackage to use thedebuginfo-installtool:# dnf install dnf-utilsRun a SystemTap helper script for setting up the environment:
# stap-prepNote that
stap-prepinstalls packages relevant to the currently running kernel, which might not be the same as the installed kernel. To ensurestap-prepinstalls the correctkernel-debuginfoandkernel-headerspackages, double-check the current kernel version by using theuname -rcommand and reboot your system if necessary.Make sure
SELinuxpolicies allow the relevant applications to run not only normally, but in the debugging situations, too. For more information, see Using SELinux.
Additional resources
1.5. Setting up to measure performance of applications Copy linkLink copied to clipboard!
To identify the causes of application performance loss, use the performance measurement tools included in Red Hat Enterprise Linux, such as perf, papi, valgrind, and SystemTap.
Prerequisites
- The debug and source repositories are enabled.
Procedure
Install the tools for performance measurement:
# dnf install perf papi pcp-zeroconf valgrind strace sysstat systemtapRun a SystemTap helper script for setting up the environment.
# stap-prepNote that stap-prep installs packages relevant to the currently running kernel, which might not be the same as the installed kernel. To ensure stap-prep installs the correct kernel-debuginfo and kernel-headers packages, double-check the current kernel version by using the
uname -rcommand and reboot your system if necessary.Enable and start the Performance Co-Pilot (PCP) collector service:
# systemctl enable pmcd && systemctl start pmcd