GMT 5.2.1在Ubuntu 16.04下安装报错的解决办法

在 Ubunut 16.04 下编译 GMT 5.2.1 的源码时,会出现如下错误而导致安装失败:

non-floating-point argument in call to function '__builtin_isnan'

解决办法是,找到源码 gmt-5.2.1/src/xyz2grd.c,将第752行的

(GMT_is_dnan (GMT→common.d.active[GMT_IN])) ? sprintf (e_value, "NaN") : sprintf (e_value, GMT→current.setting.format_float_out, GMT→common.d.nan_proxy[GMT_IN]);

改成

(GMT->common.d.active[GMT_IN]) ? sprintf (e_value, GMT->current.setting.format_float_out, GMT->common.d.nan_proxy[GMT_IN]) : sprintf (e_value, "NaN");

再编译即可。