Installing a native compiler - quasics/quasics-frc-sw-2015 GitHub Wiki

Preface

A "native" compiler is one that can turn code you write into a program that can run on your machine (e.g., your laptop or a lab workstation), rather than on some other piece of hardware (like one of the FRC robots, where it's running on the RoboRio hardware).

For FRC work, a native compiler is only needed if you're going to work with one of the small "training" bots (like a Romi or an XRP device), which simulate real FRC hardware by running the robot code you write on your computer, and sending information back-and-forth with the external robot while the program is running.

For Windows, this would generally be some form of Visual Studio (which is very different from VS Code), while macOS requires Xcode, and Linux (Ubuntu) requires the build-essential package.

For Windows

  1. Go to Microsoft's web site for Visual Studio (their compiler platform), and download/run the installer for "Visual Studio Community Edition".
    • Note: It should be possible to just use the "Build Tools for Visual Studio", which is a much smaller download/install. The functional difference between the two is that the "Build Tools" are just a compiler and libraries that you need to compile code to run on Windows, while the "Visual Studio Community Edition" comes with a bunch of other stuff (editor, debugger, etc.) that aren't useful in working with the training devices or other FIRST code. However, it looks like a base install of the Build Tools doesn't quite work "out of the box" with the training bots set up in VSC. (We're looking into this, to see if we can simplify things.)
  2. Once the installer brings up a list of different "Workloads" and other options to be installed, select the "Desktop development with C++" option.
  3. Under the "Installation details" shown on the right-hand side of the window, make sure that the following options are checked:
    • "C++ Clang tools for Windows"
      Screenshot 2024-01-13 142712
  4. Press the "Install" button on the lower-right corner of the screen.
    • Note: if you're rerunning this installer (e.g., to add stuff that was missed, or fix a broken install, etc.), this button will instead be labeled "Modify".
  5. The installation of the C++ tools will begin.
    • You may want to uncheck the option to "Start after installation", since you won't be using the full-blown Visual Studio environment to work with the training bot; instead, the FRC stuff for Visual Studio Code will automatically use the compiler, etc., in the background on your behalf.
  6. Once the installation process has completed, you may close the installer program window.

For macOS

  1. Run the "Terminal" program (found in your "Applications" folder, under "Utilities")
  2. At the prompt in the window it opens, run the command "clang --version" to check if the compiler is installed.
  3. If it reports an error (e.g., can't find the "clang" program, etc.), then run the command "xcode-select --install" to run the installer for the Xcode compiler tools for MacOS.

For Linux

  1. Open a Terminal window.
  2. At the prompt, run "gcc -v" to check if the compiler is installed.
  3. If the compiler isn't installed, first run "sudo apt-get update" to update your machine's list of available programs, and then run "sudo apt-get install build-essential gdb" to install the compiler/debugger you'll need.
⚠️ **GitHub.com Fallback** ⚠️