With the holidays here, I finally had time to revisit a programming project I’d been meaning to complete/start. This is my sphere points project, which is available (shameless plug) in my github repo. The goal of which is to compute N equidistant points on . Along the way, I made a choice to implement much of the calculation in C++ 11. So far I’m really enjoying familiarizing myself with C++ latest enhancements. Presently, at the part where I want to compile and test the first bit of code which I’ve written, but g++ can’t find <random>, <array>, etc. After some googling it seems that my version of g++ (4.2.*) doesn’t support C++ 11. No problem. I just have to get the lastest version which supports C++ 11 — gcc 4.7. For those who might have found this post C++ 11 features are also supported on earlier versions of GCC/G++. A complete list and description of gcc compilers can be found here. Anyway, I chose to install via homebrew because of the convenience and gcc 4.7 is installed in /usr/local/*, preserving my current Xcode llvm configuration of gcc. This is what I did:

  • Homebrew provides a gcc formula for use with Xcode 4.2+. Homebrew provides older GCC formulae, e.g. Gcc@7 Homebrew provides some cross-compilers and toolchains, but these are named to avoid clashing with the default tools, e.g. X8664-elf-gcc Homebrew provides the LLVM Clang, which is bundled with the llvm formula.
  • SUNY GCC is an inclusive, accessible, student-centered community college located in Western NY. 65 Degree Programs, 7 locations & online. Apply for free today!

The latest version of GCC will always be available through the SynthiNet tap:
brew tap SynthiNet/synthinet

Fink offers GCC packages (all released versions) - similar to MacPorts, but also offers binaries; it does not have the developer versions, just the releases. There’s just something poetic about using brew in Ubuntu’s GNU bash shell running on a Linux compatibility layer in Windows 10 natively. And it works surprisingly well. Windows Subsystem. Note that if 'brew install gcc' updates brew and its formulae, it's likely to undo the changes to gcc.rb that enable building libgccjit. I also had an issue with /usr/bin/install and the -D option, which is a Linux thing, but maybe I just have a weird setup.

Install GCC 4.7.*
brew install gcc47

This page shows you how to install the tools to build, run, and debugMynewt OS applications that run on supported ARM target boards. It showsyou how to install the following tools on Mac OS, Linux and Windows:

  • ARM cross toolchain to compile and build Mynewt applications for thetarget boards.

  • Debuggers to load and debug applications on the target boards.

ARM maintains a pre-built GNU toolchain with gcc and gdb targeted atEmbedded ARM Processors, namely Cortex-R/Cortex-M processor families.Mynewt OS has been tested with version 4.9 of the toolchain and werecommend you install this version to get started. Mynewt OS willeventually work with multiple versions available, including the latestreleases.

Brew gcc version

Add the PX4/homebrew-px4 homebrew tap and install version 4.9 of thetoolchain. After installing, check that the symbolic link that homebrewcreated points to the correct version of the debugger.

Brew Gcc

Note: If no version is specified, brew will install the latestversion available.

On a Debian-based Linux distribution, gcc 4.9.3 for ARM can be installedwith apt-get as documented below. The steps are explained in depth athttps://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa.

  1. Download and run the installerto install arm-none-eabi-gcc and arm-none-eabi-gdb. Select the defaultdestination folder: C:Program Files (x86)GNU Tools ARM Embedded8 2018-q4-major.

    Notes:

    • Check the Addpathtoenvironmentvariable option before you click the Finish button for the installation.

    • You may select a different folder but the installationinstructions use the default values.

  2. Check that you are using the installed versionsarm-none-eabi-gcc and arm-none-eabi-gdb. Open a MinGW terminal and runthe which commands.

    Note: You must start a new MinGW terminal to inherit the newPath values.

Brew

Mynewt uses, depending on the board, either the OpenOCD or SEGGER J-Linkdebuggers.

OpenOCD (Open On-ChipDebugger) is open-source software that allows your computer to interfacewith the JTAG debug connector on a variety of boards. A JTAG connectionlets you debug and test embedded target devices. For more on OpenOCD goto http://openocd.org.

OpenOCD version 0.10.0 with nrf52 support is required. A binary for thisversion is available to download for Mac OS, Linux, and Windows.

Brew Gcc Version

  1. Install latest OpenOCD from Homebrew:

  1. Check the OpenOCD version you are using:

    You should see version: 0.10.0+dev-<latest#>.

  1. Download the binary tarball forLinux

  2. Change to the root directory:

  3. Untar the tarball and install into /usr/local/bin. Youwill need to replace ~/Downloads with the directory that thetarball is downloaded to.

    Note: You must specify the -p option for the tar command.

  4. Check the OpenOCD version you are using:

    You should see version: 0.10.0.

    If you see any of these error messages:

    • openocd: error while loading shared libraries: libhidapi-hidraw.so.0:cannot open shared object file: No such file or directory

    • openocd: error while loading shared libraries: libusb-1.0.so.0:cannot open shared object file: No such file or directory

    run the following command to install the libraries:

Brew Gcc Path

  1. Download the binary zip file forWindows.

  2. Extract into the C:openocd-0.10.0 folder.

  3. Add the path: C:openocd-0.10.0bin to your Windows UserPath environment variable. Note: You must add bin to the path.

  4. Check the OpenOCD version you are using. Open a new MinGWterminal and run the following commands:

    Note: You must start a new MinGW terminal to inherit the newPath values.

    You should see version: 0.10.0.

You can download and install Segger J-LINK Software and documentation pack fromSEGGER.

Brew Gcc Mac

Note: On Windows, perform the following after the installation:

Brew Gcc Reviews

  • Add the installation destination folder path to your Windows userPath environment variable. You do not need to add bin to thepath.

  • Open a new MinGW terminal to inherit the new Path values.