GCC Toolset User Guide

Overview

To ensure the stability of the OS, the latest version of base software is not selected generally. Instead, a relatively stable version is used. openEuler 22.03 LTS uses GCC 10.3.1 as the baseline for development. For GCC 10.3.1, Fortran supports only some OpenMP 4.5 specifications, while C/C++ supports a few OpenMP 5.0 specifications. To support all OpenMP 4.5 specifications with Fortran, the GCC toolset is designed. For applications that require the OpenMP 4.5 specifications not supported by GCC 10.3.1, GCC Toolset 12 can be used to compile and build.

Installation and Deployment

Software Requirements

OS: openEuler 22.03 LTS SP4

Hardware Requirements

AArch64 architecture

Software Installation

To prevent conflicts between installation dependencies of GCC Toolset 12 and the default GCC, the software package of GCC Toolset 12 is prefixed with gcc-toolset-12-, followed by the name of the original GCC software package.

Install the default compiler GCC 10.3.1 in /usr/.

shell
yum install -y gcc gcc-c++ gcc-gfortran

Install GCC Toolset 12 in /opt/openEuler/gcc-toolset-12/root/usr/.

shell
yum install -y gcc-toolset-12-gcc*

How to Use

Because GCC Toolset 12 is installed in /opt/openEuler/gcc-toolset-12/root/usr/, run the following commands to use the software:

shell
export PATH=/opt/openEuler/gcc-toolset-12/root/usr/bin/:$PATH
export LD_LIBRARY_PATH=/opt/openEuler/gcc-toolset-12/root/usr/lib64/:$LD_LIBRARY_PATH

Note: GCC Toolset 12 is used only to support the OpenMP 4.5 specifications not supported by GCC 10.3.1. For other features, the default compiler GCC 10.3.1 is recommended to prevent unknown compilation errors.

Compatibility

This section describes the compatibility issues in some special scenarios. This project is in continuous iteration and issues will be fixed as soon as possible. Developers are welcome to join this project.

  • Currently, the GCC toolset solution applies only to the scenario requiring OpenMP 4.5 specifications.