当前位置: 首页 > news >正文

Ubuntu 24.04 LTS 安装GAMIT

Ubuntu 24.04 LTS 安装GAMIT

  • 错误定位
  • 卸载csh
  • 编译tcsh
  • GAMIT配置修改
  • GAMIT代码修改
  • GAMIT 不处理GPS L2C的小bug

熟悉GAMIT的朋友应该都知道,在GAMIT官网有一则Known Issue:不要在Ubuntu 24.04上安装GAMIT

MIT的几位佬测试,换了多个版本的gcc/gfortran编译都不成功,报错:

ar: creating libsofa.a*** Now type 'make test' to install the library and run tests ***cp libsofa.a ../../../../libsofa.a
Segmentation fault (core dumped)
Failure in make_gamit -- install_software terminated

哥们头铁,我就想在Ubuntu 24.04上装GAMIT,有没有办法呢?有的兄弟,有的。

错误定位

这个错误发生在make_gamit这个脚本里,发生这个错误之前的操作就是用make编译了libsofa这个库。而我们可以发现,在对应目录下的命令行里执行这个命令屁事没有。

make FC=gfortran

那么问题很明确了,就是这个版本的csh执行到这里内存管理出问题了…

卸载csh

ok,按照GAMIT作者的测试结论,Ubuntu 25.10并没有问题,那么我们自己编译一个最新版的csh替换掉就行了。在此之前,先把csh卸掉

sudo apt purge csh tcsh -y

编译tcsh

首先从官网下载tcsh的源码,当前最新的是6.24.10

wget http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/tcsh-6.24.10.tar.gz

然后利用configure生成makefile,以默认设置编译即可。

./configure
make -j$(nproc)
sudo make install

编译好的tcsh放在/usr/local/bin下,建立一个csh的链接

sudo ln -s /usr/local/bin/tcsh /usr/bin/csh

测试一下,没啥问题,命令行只会显示一个>

>

🆗

GAMIT配置修改

参考官网Known Issues中的建议,将libraries/Makefile.configgamit/solve/Makefile.generic中的FFLAGS添加-fallow-argument-mismatch

GAMIT代码修改

由于GAMIT采用的C语言标准较老,kf/plot/中调用了X11的部分出现了重定义的问题。因此,需要对头文件x1000.h进行更改,把全局变量添加extern

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <stdio.h>
/* #include <math.h> */
#include "x1000.icon"
#define WINFRAC 2      /* x1k window fraction of largest window (1/WINFRAC)*/
#define MAXSTRLEN 256/* maximum length of a label */extern Display     *display;
extern int          screen;
extern GC           gc;
extern XGCValues    gcv;
extern XFontStruct *font_info;
extern XEvent       report;
extern XSizeHints   size_hints;
extern Window       win;
extern Pixmap       icon_pixmap ;
extern Pixmap       clip_mask ;
extern XSetWindowAttributes setwinattr;
extern unsigned long valuemask;/* Definitions for defining the plotting area and the size of this area */extern float xvl, xvr, xvb, xvt  ; /* Virtual corrdinates of the cornors of thearea for plot (left, right, bottom, top */
extern float xwl, xwr, xwb, xwt; /* World coordinates of the cornors of thevirtual area */
extern int Window_width; /* current width of window in pixels */
extern int Window_height; /* current height of window in pixels */
extern int curr_charsize[2];  /* current character size for actual font used width and height (pixels) */
extern int usr_charsize    ;  /* User character size in pixels */
extern int Curx;           /* current x coord of cursor (viewport scale) */
extern int Cury;           /* current y coord of cursor (viewport scale) *//* Current font style and info */extern float jcenter;   /* Defines the centering to be used 0-1       for left through right justification */
extern float jheight;  /* Justification in height for strings (0-1.0 for bottom to top justifcation */
extern int jor_tan;     /* Defines orientation of baseline of the textstrings given as tan of angle */
extern int jzse;        /* Current character size as specified by userwhich is different from current font size (pixels) */
extern int jdash;      /* Current dash pattern (init to solid line)*/
extern int jwidth;      /* Current width of lines (init to 1 pixel)*/extern int jclip ;     /* Set to one to enable clipping, 0 for no clipping*/extern char font[MAXSTRLEN] ; /* Name of current font to be used */

然后在check_window.c内定义相关变量:

#include "x1000.h"
/* global variables */
Display     *display;
int          screen;
GC           gc;
XGCValues    gcv;
XFontStruct *font_info = NULL;
XEvent       report;
XSizeHints   size_hints;
Window       win;
Pixmap       icon_pixmap;
Pixmap       clip_mask;
XSetWindowAttributes setwinattr;
unsigned long valuemask = 0;float xvl, xvr, xvb, xvt;
float xwl, xwr, xwb, xwt;
int Window_width;
int Window_height;
int curr_charsize[2];
int usr_charsize = 0;
int Curx, Cury;float jcenter;
float jheight;
int jor_tan;
int jzse;
int jdash;
int jwidth;
int jclip;
char font[MAXSTRLEN];
/*以下代码不变*/

然后正常执行./install_software即可。

GAMIT 不处理GPS L2C的小bug

现在编译没啥问题了,之前还发现了一个小bug:20250901这个更新里面并没有读取GPS的L2C的观测值,在算项目数据时出现了这样的情况,GPS双频观测值是L1C和L2C,用LC_AUTCLN模式死活算不出来…

参考文献:

GAMIT解算北斗三号新频点(B1C、B2a)数据

改代码的位置在gamit/lib/sel_obtyp.f第67行 附近,添加载波相位观测值

        if( gnsslf.eq.'G5' ) then         call fill_obtypx(2,'L5 ',nobtyp,rxobtyp,iobtypx) call fill_obtypx(2,'L5X',nobtyp,rxobtyp,iobtypx) call fill_obtypx(2,'L5I',nobtyp,rxobtyp,iobtypx)call fill_obtypx(2,'L5Q',nobtyp,rxobtyp,iobtypx)elsecall fill_obtypx(2,'LC ',nobtyp,rxobtyp,iobtypx) call fill_obtypx(2,'L2 ',nobtyp,rxobtyp,iobtypx) 
c ADDcall fill_obtypx(2,'L2C',nobtyp,rxobtyp,iobtypx) call fill_obtypx(2,'L2X',nobtyp,rxobtyp,iobtypx)call fill_obtypx(2,'L2L',nobtyp,rxobtyp,iobtypx)call fill_obtypx(2,'L2Y',nobtyp,rxobtyp,iobtypx)call fill_obtypx(2,'L2S',nobtyp,rxobtyp,iobtypx)call fill_obtypx(2,'L2W',nobtyp,rxobtyp,iobtypx)endif

和第98行附近,添加伪距观测值

        if( gnsslf.eq.'G5' ) then   call fill_obtypx(4,'C5 ',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C5X',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C5I',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C5Q',nobtyp,rxobtyp,iobtypx)else   ! Default selectioncall fill_obtypx(4,'CC ',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2 ',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'P2 ',nobtyp,rxobtyp,iobtypx)
c ADDcall fill_obtypx(4,'C2C',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2X',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2L',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2Y',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2S',nobtyp,rxobtyp,iobtypx)call fill_obtypx(4,'C2W',nobtyp,rxobtyp,iobtypx) 

然后重新编译即可。

http://www.dtcms.com/a/410876.html

相关文章:

  • 路由器设置网站做羞羞的事网站
  • 网站定制合同慈溪公司做网站
  • 单细胞神经元可视化-- HarmonyOS Next
  • 深入理解 Highcharts Stock:为金融 / 时间序列可视化量身打造
  • 分布式专题——22 Kafka集群工作机制详解
  • 专业建站公司收费标准合肥市网站建设 小程序
  • TimescaleDB 按多个维度(列)进行压缩
  • Nacos敏感信息加密
  • JVM高频面试题---GC垃圾回收
  • 加强公司门户网站建设方案网站开发的薪资是多少
  • 合肥建站费用车网站建设策划书
  • 基于Spring Boot与SSM的健身房综合管理系统架构设计
  • 【以太来袭】1. 企业以太坊回归
  • TDengine 时序函数 CSUM 用户手册
  • 企业级大数据技术栈:基于Hadoop+Spark的全球经济指标分析与可视化系统实践
  • Spark核心技术解析:从RDD到Dataset的演进与实践
  • 《自动控制原理》第 2 章 线性控制系统的数学描述:2.1、2.2
  • 名者观看网站吸引人气的营销方案
  • 上海做网站的网站如何建设物流网站
  • Linux----gcc、g++的使用以及一些问题
  • 零基础软件设计师专栏计划
  • 插座工程量-图形识别轻松计量
  • IEEE TGRS 2025 | 突破小波U-Net局限,ASCNet实现更精准的红外去条纹!
  • 【每日一问】电气间隙和爬电距离有什么区别?
  • 网站邮件功能设计理论企业销售网站
  • 使用bert或roberta模型做分类训练时,分类数据不平衡时,可以采取哪些优化的措施
  • c语言网站上海有哪些企业
  • 网站搭建后提示建设中怎么申请自己公司的邮箱
  • 网站如何报备诚信经营网站的建设
  • CST微波混频电路 --- 频线任务,谐波平衡(Harmonic Balance)