Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 1. Setting up a development workstation
Red Hat Enterprise Linux 9 supports the development of custom applications. To set up your system for development, install the required tools and utilities for the most common development use cases.
1.1. Enabling debug and source repositories Copier lienLien copié sur presse-papiers!
To access essential debugging data for system components, enable debug and source repositories. RHEL disables these by default to save space. Enable them to install debuginfo packages required for performance measurement and deep system troubleshooting.
Procedure
Enable the source and debug information package channels:
Enable the BaseOS debug repository:
# subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-debug-rpmsEnable the BaseOS source repository:
# subscription-manager repos --enable rhel-9-for-$(uname -i)-baseos-source-rpmsEnable the AppStream debug repository:
# subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-debug-rpmsEnable the AppStream source repository:
# subscription-manager repos --enable rhel-9-for-$(uname -i)-appstream-source-rpms+ 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.2. Setting up to manage application versions Copier lienLien copié sur presse-papiers!
Effective version control is essential to all multi-developer projects. Red Hat Enterprise Linux includes Git, a distributed version control system.
Procedure
Install the git package:
# 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 actual name and email address.
Optional: To change the default text editor started by Git, set 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++ Copier lienLien copié sur presse-papiers!
To develop C and C++ applications on Red Hat Enterprise Linux, you can use the development tools provided by Red Hat Enterprise Linux. This procedure describes how to install the standard development tools, including the GCC and LLVM toolchains.
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 andlldbdebugger:# dnf install llvm-toolsetOptional: For Fortran dependencies, install the GNU Fortran compiler:
# dnf install gcc-gfortran
1.4. Setting up to debug applications Copier lienLien copié sur presse-papiers!
To analyze and troubleshoot internal application behavior, Red Hat Enterprise Linux offers multiple debugging and instrumentation tools.
Prerequisites
- The debug and source repositories must be enabled.
Procedure
Install the tools useful for debugging:
# dnf install gdb valgrind systemtap ltrace straceInstall the dnf-utils package in order to use the
debuginfo-installtool:# dnf install dnf-utilsRun 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 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 -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.
1.5. Setting up tools to measure application performance Copier lienLien copié sur presse-papiers!
To identify the causes of application performance loss, you can use the performance measurement tools provided by Red Hat Enterprise Linux. This procedure describes how to install tools such as perf, Valgrind, SystemTap, and Performance Co-Pilot (PCP).
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 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 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 -rcommand and reboot your system if necessary.Enable the Performance Co-Pilot (PCP) collector service:
# systemctl enable pmcdStart the Performance Co-Pilot (PCP) collector service:
# systemctl start pmcd