Folks interested in reading GRIB1, GRIB2, NetCDF, HDF and OPeNDAP using a unified syntax might want to check out
http://nctoolbox.github.io/nctoolbox/
there are no mexfiles either!
I was able run the file 'compile.m' successfully. However when I call the following function
c = cdi_varlist(filename,[]);
I get the following
error: cdi_varlist: No such file or directory
Although I'm pretty sure the file name and path is correct. I identified the error coming from the file cdi_mx.c at the following line
streamID = streamOpenRead(szInputFilename);
So basically 'streamOpenRead' cannot open my file although the path and the name are correct. I tried with and without the file extension (.grb). Also, no capabilities to read the contents of the file (e.g. \private\...) are actually required.
In 64-bit systems:
Be sure to compile netcdi, and cdf libraries with -fPIC enabled.
In newer versions of MATLAB: open cdi_mx.c and replace the obsolete function mxErrMsgIdAndTxt with something else (or just comment out). I succesfully used mexprintf instead.