On macOS, the macports version of GMT (6.0.0) is currently broken for me due to a netcdf 4.7.4 update that broke backwards compatibility. I wasn’t able to find a simple way to revert netcdf and found it easier to just build the latest GMT from source. Thanks to the developers for making this process surprisingly quick and painless!
However, now I am trying to build GMTSAR from source, and found it asks for some things that are missing in the headers. I get lots of errors like this, all related to missing ‘nx’ and ‘ny’:
gcc -O2 -Wall -m64 -fPIC -fno-strict-aliasing -std=c99 -I/usr/local/include/gmt -I./ -I/opt/local/include -c -o bperp.o bperp.c
bperp.c:111:37: error: no member named 'nx' in 'struct GMT_GRID_HEADER'
theta = (float *)malloc(P->header->nx * sizeof(float));
~~~~~~~~~ ^
bperp.c:124:33: error: no member named 'ny' in 'struct GMT_GRID_HEADER'
dBh = (Bhf - Bh0) / P->header->ny;
~~~~~~~~~ ^
I just followed the same process last week on a different computer and it worked fine. Has something changed in the last few days to affect these values, or is there something subtle missing in my installation, possibly as a result of mixing macports with a build from source?
As an aside, I hope 6.1 can be released to macports soon so the netcdf fix becomes available there.