Step 1 INSTALL NETCDF Run this in a terminal window (from https://brew.sh/index.html) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" It takes a while to run. When it is finished, type this in the same terminal window: brew install netcdf This installs everything but hdf4 and hdfeos ******************************** HDF4, HDF5, HDFEOS and NETCDF4 ******************************** #----HDF4 include and lib path HDF4INC = /Users/setup/hdf-4.2.15/include HDF4LIB = /Users/setup/hdf-4.2.15/lib #----HDFEOS include and lib path HDFEOSINC = /Users/setup/hdfeos/include HDFEOSLIB = /Users/setup/hdfeos/bin/macintel64 #----HDF5 include, lib and bin path HDF5INC = /usr/local/Cellar/hdf5/1.12.1/include HDF5LIB = /usr/local/Cellar/hdf5/1.12.1/lib HDF5BIN = /usr/local/Cellar/hdf5/1.12.1/bin Brew install on 20220929 /opt/homebrew/Cellar/hdf5/1.12.2_2/include /opt/homebrew/Cellar/hdf5/1.12.2_2/lib /opt/homebrew/Cellar/hdf5/1.12.2_2/bin #-----NETCDF 4 include and lib path NETCDF4INC = /usr/local/Cellar/netcdf/4.8.0_2/include NETCDF4LIB = /usr/local/Cellar/netcdf/4.8.0_2/lib Brew install on 20220929 /opt/homebrew/Cellar/netcdf/4.8.1_3/include /opt/homebrew/Cellar/netcdf/4.8.1_3/lib #-----SZIP include and lib path SZIPINC = /usr/local/Cellar/szip/2.1.1_1/include SZIPLIB = /usr/local/Cellar/szip/2.1.1_1/lib Brew install on 20220929 /opt/homebrew/Cellar/szip/2.1.1_1/include /opt/homebrew/Cellar/szip/2.1.1_1/lib #----JPEG JPEG_DIR = /usr/local/Cellar/jpeg/9d JPEGINC = /usr/local/Cellar/jpeg/9d/include JPEGLIB = /usr/local/Cellar/jpeg/9d/lib Brew install on 20220929 /opt/homebrew/Cellar/jpeg/9d /opt/homebrew/Cellar/jpeg/9d/include /opt/homebrew/Cellar/jpeg/9d/lib #----ZLIB ZLIBINC = /usr/local/Cellar/zlib/1.2.11/include ZLIBLIB = /usr/local/Cellar/zlib/1.2.11/lib Brew install on 20220929 /opt/homebrew/Cellar/zlib/1.2.11/include /opt/homebrew/Cellar/zlib/1.2.11/lib #----Open MP include and lib path OMPINC = /usr/local/Cellar/gcc/11.2.0/include OMPLIB = /usr/local/Cellar/gcc/11.2.0 Brew install on 20220929 /opt/homebrew/Cellar/gcc/12.2.0/include /opt/homebrew/Cellar/gcc/12.2.0/lib ;******************************************* ; INSTALLING HDF4 ;******************************************* https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.15/bin/unix/ Hdf-4.2.15-macos11 Go to release_notes, file INSTALL *** Type mismatch error FORTRAN This is the fortran error. Have to search for -O2 in the Makefile, then add the fallow flag after FFLAGS -O2 https://forum.hdfgroup.org/t/hdf-4-2-14-compilation-error-with-gcc-10/6625 -fallow-argument-mismatch This also needs to be added in one place in the configure file ***implicit declaration of function C This is the C error. Have to search for -O2 in the Makefile, then add the Won-error flag after CFLAGS -O2 https://forum.hdfgroup.org/t/help-building-hdf4-with-clang-error-implicit-declaration-of-function-test-mgr-szip-is-invalid-in-c99/7680 -Wno-error=implicit-function-declaration **** configure command ./configure --with-zlib=/usr/local/Cellar/zlib/1.2.11 --with-jpeg=/usr/local/Cellar/jpeg/9d --with-szlib=/usr/local/Cellar/szip/2.1.1_1 --enable-hdf4-xdr --prefix=/Users/u0079358/hdf-4.2.15 ;************************************* ; INSTALLING HDFEOS ;************************************* HDF-EOS2.20v1.00.tar.Z https://wiki.earthdata.nasa.gov/display/DAS/Toolkit+Downloads cd to this directory:/Users/u0079358/hdfeos type this at the command line bin/INSTALL -cc_path /Library/Developer/CommandLineTools/usr/bin mac64 /usr/local/Cellar/zlib/1.2.11 /usr/local/Cellar/jpeg/9d /usr/local/Cellar/szip/2.1.1_1 /Users/u0079358/hdf-4.2.15 /usr/local/Cellar/hdf5/1.12.0_3 /Users/u0079358/hdfeos Below are just some info about errors I had to fix in the scripts. (base) mace-mac-01:hdfeos u0079358$ gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin20.4.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include x86_64 $pgs_machine Darwin $pgs_temp_ostype make $MAKECMD -f Makefile $make_file macintel64 $BRAND Have to edit this MACINTEL_COMP_FLAG #MACINTEL_COMP_FLAG="-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -fPIC -arch x86_64" MACINTEL_COMP_FLAG="-mmacosx-version-min=10.5 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC -arch x86_64" gcc -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk -fPIC -arch x86_64 -O -ansi -Df2cFortran -DMACINTEL -I. -I/Users/u0079358/hdfeos/include -I/usr/local/Cellar/szip/2.1.1_1/include -I/Users/u0079358/hdf-4.2.15/include -c EHapi.c -o /Users/u0079358/hdfeos/obj/macintel64/EHapi.o clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.5.sdk' [-Wmissing-sysroot] EHapi.c:10:10: fatal error: 'errno.h' file not found #include ^~~~~~~~~ 1 error generated. make[1]: *** [/Users/u0079358/hdfeos/obj/macintel64/EHapi.o] Error 1 make: *** [all] Error 2 /Users/u0079358/hdfeos/bin/INSTALL-Scripts/INSTALL-HDFEOS-Wrap -df HDF-EOS2.20v1.00.tar.Z -w_home /Users/u0079358/hdfeos/.install-hdfeoshome -cc_path /Library/Developer/CommandLineTools/usr/bin -install_dir /Users/u0079358/hdfeos