Atmospheric Toolbox

ERROR: MATLAB is required to build the MATLAB interface

I have no idea how to build a Matlab interface to harp software on Mac with M1 chip. When I ran ./configure --enable-matlab MATLAB=, got an error like the following:
ERROR: MATLAB is required to build the MATLAB interface.
Try setting the MATLAB environment variable to the root of your MATLAB installation
And, I got not too much information from here: Installation — HARP 1.14 documentation , so anyone can give me some hints about that plz.

As far as I can see MATLAB itself is not yet available for M1 itself. This means that you will run MATLAB as intel code within Rosetta on your mac.
To get HARP working with that version of MATLAB, you would then also have to compile HARP as intel code on your M1 mac. And you would also need intel versions of HDF4, HDF5, and coda.

This can be done by making use of a conda environment. The packages from conda-forge (for coda/harp) are currently only available as intel binaries for mac, so this means you would automatically get the right version. You would then only need to manually build HARP yourself, with MATLAB enabled, and install that within this conda environment. e.g.:

conda env create -n harp-matlab
conda activate harp-matlab
conda install -c conda-forge cmake coda
cd /path/to/source/of/harp-1.4
cmake . \
    -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
    -DHARP_BUILD_PYTHON=ON \
    -DHARP_BUILD_MATLAB=ON \
    -DCODA_INCLUDE_DIR="$CONDA_PREFIX/include" \
    -DJPEG_INCLUDE_DIR="$CONDA_PREFIX/include" \
    -DHDF4_INCLUDE_DIR="$CONDA_PREFIX/include" \
    -DHDF5_INCLUDE_DIR="$CONDA_PREFIX/include" \
    -DCODA_LIBRARY_DIR="$CONDA_PREFIX/lib" \
    -DJPEG_LIBRARY_DIR="$CONDA_PREFIX/lib" \
    -DHDF4_LIBRARY_DIR="$CONDA_PREFIX/lib" \
    -DHDF5_LIBRARY_DIR="$CONDA_PREFIX/lib" \
    -DZLIB_LIBRARY_DIR="$CONDA_PREFIX/lib"
make install

And then you will have to use whatever value your CONDA_PREFIX environment variable points to as HARP installdir in your startup.m. e.g. addpath /Users/yourname/miniconda3/envs/harp-matlab/lib/harp/matlab