Trouble building GMTSAR with the most recent GMT

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.

Interesting. The nx and ny are around GMT 5 time 2013 but has been n_columns and n_rows ever since. I suggest GMTSAR quickly update their codes to use n_columns and n_rows instead since that is what GMT 6.1 will use (only). I will tell Eric Xu.

Thanks for the quick reply! I just found that the macports version of GMT has already been fixed (6.0.0_2), and GMTSAR still builds correctly with that GMT. However, it sounds like they are on borrowed time!