【GMT5】Ubuntu16.04下安装GMT5.2.1报错non-floating-point argument in call to function __builtin_isnan...

本文提供了解决GMT5.2.1在Linux环境下编译安装时遇到的NaN报错问题的方法。通过修改源码文件xyz2grd.c中的特定行,可以成功规避错误并完成安装。

按照SeisMan提供的教程进行安装:GMT 5.2.1 在 Linux 下的安装

检查GMT 的依赖关系完毕后,开始编译和安装,使用

make -j

后出现如下问题:

error: non-floating-point argument in call to function '__builting_isnan'
(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]);
......

1

GMT中文社区给了解决方法:GMT 5.2.1编译过程中NaN报错的解决办法。但是该网站未能被百度检索到,我搜索良久未能找到答案,无意浏览社区时候找到答案。解决方法贴出来:

在 Ubunut 16.04 或者其他比较新的 Linux 发行版下编译 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");

再编译即可。

将这个错误解决了就能顺利的按照SeisMan的教程安装了,有一些地方不一样但似乎正常安装了。以下是不一样的地方:

  • 他是gshhg-gmt-2.3.5  我是2.3.4。
  • 检查软件的依赖关系时,我的ZLIB library为空,LAPACK library为no。

转载于:https://www.cnblogs.com/shanchuan/p/8150328.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值