In this Learning Path, you will build and run a C++ application on an AWS Graviton 4 (r8g.xlarge
) instance running Ubuntu 24.04 LTS.
If you are new to cloud computing, see Getting started with Servers and Cloud Computing . It provides an introduction to the Arm servers available from various cloud service providers.
Create the AWS instance using your AWS account.
Connect to the instance using SSH or AWS Session Manager so that you can enter shell commands.
Once connected, run the following commands to confirm the operating system and architecture:
cat /etc/*lsb*
You should see output similar to:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
Next, confirm that you are using a 64-bit Arm-based system using the following command:
uname -m
You should see the following output:
aarch64
An effective way to achieve optimal performance on Arm is not only through optimal flag usage, but also by using the most recent compiler version.
Older compilers might not fully leverage the latest hardware features, particularly when targeting cutting-edge Arm processors, resulting in less optimized code.
In your terminal, run the following commands to install an older version of the GNU Compiler Collection, version 9:
sudo apt update
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-9 g++-9 -y
Directly run the g++-9 --version
command to confirm you have the same output as below:
g++-9 (Ubuntu 9.5.0-6ubuntu2) 9.5.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.