X

News, tips, partners, and perspectives for the Oracle Linux operating system and upstream Linux kernel work

Getting Started with Oracle Arm Toolset 1

Why Use Oracle Arm Toolset 1?

Oracle Linux 7 for Arm was announced earlier this summer. Oracle includes the "Oracle Arm Toolset 1" [see release notes], which provides many popular development tools, including:

gcc v7.3.0 Supports the 2011 revision of the ISO C standard.
g++ v7.3.0 Supports the 2014 ISO C++ standard.
gfortran v7.3.0 Supports Fortran 2008
go 1.10.1 The Go Programming Language
gdb v8.0.1 The GNU debugger
binutils v2.30   Binary utilities

The above versions are much more recent than the base system versions.

The base system versions are intentionally kept stable for many years, in order to help ensure compatibility for device drivers and other components that may be intimately tied to a specific compiler version.

For your own applications, you might want to use more modern language features.

For example, Oracle Arm Toolset 1 includes support for C++14.

 

cobweb Illustration credit: Laura Bassett, via wikipedia

For a complete list of the software packages in Oracle Arm Toolset 1, see the packages listed at the Oracle Linux 7 Software Collections yum repo.

Steps

(1) repo

Download the Oracle Linux repo file:

# cd /etc/yum.repos.d
# wget http://yum.oracle.com/aarch64/public-yum-ol7.repo

(2) Enable the collection

In the repo file, set enabled=1 for ol7_software_collections:

Edit the .repo file.
Notice that there are many repositories.
At minimum, you should edit the section about the Software Collection Library to set  enabled=1

While you are there, review the other repositories, and decide which others you would like to enable.

You can view the Software Collection Library in a browser by going to:  http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/aarch64/index.html

(3) Install

# yum install 'oracle-armtoolset-1*'

(4) Enable a shell with the software collection

$ scl enable oracle-armtoolset-1 bash

Note that this will start a new shell.   (Of course, you could change the word ‘bash’ above to some other shell if you prefer.)

(5) Verify

Verify that the gcc command invokes the correct copy, and that paths are set as expected:

which gcc
echo $PATH
echo $MANPATH
echo $INFOPATH
echo $LD_LIBRARY_PATH 

Expected output:

    • The which command should return:
      /opt/oracle/oracle-armtoolset-1/root/usr/bin/gcc
    • All four echo commands should begin with:
      /opt/oracle/oracle-armtoolset-1/

 

(6) Wrong gcc?  Wrong paths?

If Step (5) gives unexpected output, then check whether your shell initialization files are re-setting the path variables. If so here are four possible solutions:

(6a) norc
Depending on your shell, there is probably an option to start up without initialization. For example, if you are a bash user, you could say:

scl enable oracle-armtoolset-1 "bash --noprofile --norc"

(6b) silence
Alternatively, you can edit your shell initialization files to avoid setting paths, leaving it up to  scl instead.

(6c) (RECOMMENDED) Set paths only in your login shell initialization files.
The easiest solution is probably to check out the documentation for your shell and notice that it probably executes certain file(s) at login time and certain other file(s) when a new sub shell is created. For example, bash at login time will look for
   ~/.bash_profile, ~/.bash_login, or ~/.profile
and for sub shells it looks for
   ~/.bashrc
If you do your path setting in ~/.bash_profile and avoid touching paths in .bashrc, then the scl enable command will successfully add Oracle Arm Toolset 1 to your paths.

(6d) (Kludge) enable last
 If for some reason you wish to set paths in your sub shell initialization file, then please ensure that the toolset's enable scriptlet is done last. Here is an example from the bottom of my current .bashrc

   # If this is a shell created by 'scl enable', then make sure that the
   # 'enable' scriplet is done last, after all other path setting has 
   # been completed.
   grandparent_cmd=$(ps -o cmd= $(ps -o ppid= $PPID))
   if [[ "$grandparent_cmd" =~ "scl enable" ]] ; then
      #echo "looks like scl"
      grandparent_which=${grandparent_cmd/scl enable}
      grandparent_which=${grandparent_which/bash}
      grandparent_which=${grandparent_which// }
      grandparent_enable=$(ls /opt/*/$grandparent_which/enable 2>/dev/null)
      if [[ -f $grandparent_enable ]] ; then
         sourceit="source $grandparent_enable"
         echo doing "'$sourceit'"
         $sourceit
      else
         echo "did not find the enable scriplet for '$grandparent_which'"
      fi
   fi

Sources

If you would like the sources:

wget http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/aarch64/getPackageSource/oracle-armtoolset-1-gcc-7.3.0-2.el7.src.rpm

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services