I. ============== Build GCC 10.1.0

1. Download and extract GCC

curl -L https://ftpmirror.gnu.org/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz | tar xf -

2. GCC 10 depends on a couple of other libraries (GSL, GMP, MPFR and ISL) that can be downloaded with:

cd gcc-10.1.0
contrib/download_prerequisites

3. Configure GCC

cd gcc-10.1.0 
mkdir build 
cd build

../configure --prefix=/Users/dorf1/Documents/Programming/gcc-10.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk --program-suffix=-10.1

The above command instructs the configure app to add a prefix to all the resulting executable programs, so for example if you want to invoke GCC 10.1.0 you will write gcc-10.1, the gcc command will invoke Apple’s version of clang.

4. Build and install
make -j 8
make install-strip

5. Add path 

export PATH=/Users/dorf1/Documents/Programming/gcc-10.1.0:$PATH

(To have this path each time you start a Terminal, put this line into .bash_profile or .zshrc)

II. ============== Build Openmpi-4.0.1

1. Download openmpi-4.0.1  (https://www.open-mpi.org/software/ompi/v4.0/)

2.  Configure build and install

./configure --prefix=/Users/dorf1/Documents/Programming/openmpi-4.0.1 CC=gcc-10.1 CXX=g++-10.1 FC=gfortran-10.1 F77=gfortran-10.1 --enable-static --disable-dlopen

make -j8 all
make -j8 install 

3. Add path the same way as was done for GCC

III. ============== Build hdf5-1.10.6

1. Download hdf5-1.10.6 (https://portal.hdfgroup.org/display/support/HDF5+1.10.6)

./configure --prefix=/Users/dorf1/Documents/Programming/hdf5-1.10.6/ CC=mpicc FC=mpifort CXX=mpicxx --enable-parallel --enable-fortran

make -j8 install

IV. ============== Follow standard instructions for COGENT/Chombo/Hypre build

For hypre use: ./configure CC=mpicc CXX=mpicxx --enable-maxdim=5

For Chombo make file use: Make.defs.local