How to install HPC gcc on Catalina and Big Sur

Last revision: December 16, 2020

On November 26, 2012, we switched entirely away from llvm on OS X, and went with the HPC (High Performance Computing) gcc 4.8.0. Starting with Catalina, macOS supports 64 bits only, with Xcode gcc based on llvm or clang only. Our old pfe64 continued to work with Catalina, but neither HPM gcc 4.8.0 nor Xcode gcc would build it.

The update process to HPC gcc 9.2.0 using Xcode 11.2.1 under macOS 10.15.1 (Catalina) was not smooth. We got things working via the following steps, which have been updated for, and continue to work with, macOS 11.1 (Big Sur), Xcode 12.3, and HPC gcc 10.2.0:

  1. Installed Xcode 12.3, and Command Line Tools for Xcode 12.3. Both were necessary for the HPC gcc. We also did "Install Extra Components" in Xcode -- not sure that's essential. We've had better luck downloading from the Apple Developer's site, rather than going through the App Store. That required logging in with an Apple ID.

  2. Disabled SIP (System Integrity Protection), so we could make /usr/local/ writable.

    We gave ourselves ownership of /usr/local with chown -R. That only actually changed the ownership of the tree below /usr/local, not /usr/local itself.

  3. Reenabled SIP.

  4. Installed gcc-10.2-bin.tar.gz from the HPC site using, after gunzip:
      sudo tar -xvf gcc-10.2-bin.tar -C /
    
    We did not have to do the following recommendation from the HPC site, but maybe it was inherited on our system from earlier Xcode installs, or maybe it came from the Xcode initialization "Install Extra Components":

    "And on Catalina, you may have to specifify an additional include path

      -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
    
    for the compiler to find the system headers."