Connect to an AWS Arm-based instance

In this Learning Path, you’ll build and run a C++ application on any Neoverse-based system running Ubuntu 24.04 LTS. For example, you can use the first-generation Arm AGI CPU or an AWS Graviton 4 (r8g.xlarge) instance. Both are based on Arm Neoverse architecture and provide an Arm-native development environment.

Note

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.

Get set up

Connect to your instance using SSH or your preferred remote access method so 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.4 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

        
    

Install Different Versions of the GNU Compiler Collection

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 the most version of the GCC, as of May 2026, version 16. This is an experimental version pulled from the Ubuntu toolchain repository. You may need to press enter when prompted:

    

        
        
sudo apt update
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-16 g++-16 -y

    

Directly run the g++-16 --version command to confirm you have the same output as below:

    

        
        g++-16 (Ubuntu 16-20260315-1ubuntu1~24~ppa1) 16.0.1 20260315 (experimental) [trunk r16-8100-g3aca3bae8ee]
Copyright (C) 2026 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.

        
    
Tip

You can setup the default compiler using the following command and priority. This enables build systems such as CMake to choose the latest version of the compiler and is more convenient to simply type gcc compared to gcc-16.

    

        
        
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-16 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-16 200

    
Back
Next