LPJ6378137的个人博客分享 http://blog.sciencenet.cn/u/LPJ6378137

博文

在Vscode中使用Makefile文件实现POD程序的编译调试

已有 5834 次阅读 2022-5-7 18:09 |个人分类:Ginan|系统分类:科研笔记

在执行本文操作前应下载Ginan软件的源码(下载地址:GeoscienceAustralia/ginan: The Australian Government, through Positioning Australia (part of Geoscience Australia), is funding the design, development and operational service of a Global Navigation Satellite System (GNSS) position correction system - the Ginan service and toolkit. The application of the Ginan correction service by a GNSS device has the potential to increase positioning accuracy from meters to centimetres across Australia. The suite of software systems in this repository (the Ginan toolkit) will be used to create the service. It is available now under an open source licence. Ginan will give individuals and organisations no-cost access to the Ginan software and service as a public good. (github.com))提取POD模块相关的Fortran源码并编写Makefile文件。在Vscode中结合Makefile文件编译调试POD程序主要由以下几个步骤实现:

1、不熟悉Makefile文件编写,可以借助codeblock软件实现自动生成。

image.png

image.png

image.png

image.png

image.png

image.png

2、使用make命令向Makefile文件传递参数;

对步骤1中生成的Makefile文件进行适当修改。在Makefile文件中加入“CFLAGS = ${CFLAG}”,在执行make命令时直接指定变量CFLAGS的值,然后Makefile文件将根据输入的CFLAG的值来执行不同版本的gfortran命令进行编译。其中,执行“make CFLAG=-g”命令,将生成debug版本;执行“make CFLAG= -O3”命令,将生成release版本;执行“make clean”命令,将清理生成的可执行文件。

# make CFLAG=-g

# make CFLAG= -O3

# make clean

image.png

image.png


3、创建pod_main项目:

image.png

image.png

image.png

image.png

4、配置launch.json、tasks.json文件:

launch.json文件:

image.png

可执行文件路径:

image.png

调试程序的工作路径:

image.png

tasks.json文件:

image.png

5、使用“make CFLAG=-g”构建POD可执行文件及使用“make clean”进行清理:

image.png

image.png


6、打断点进行POD模块程序调试:

image.png

image.png

    依赖库:lib.tar.gz


参考博文

1、vsCode中使用makefile实现debug/release版本的编译_myyanjie的博客-CSDN博客_vscode中使用make

2、linux+vsCode+makefile -- 调试C_不一样的清流的博客-CSDN博客_vscode 调试makefile

3、VSCode 结合Makefile设置调试方法_gbmaotai的博客-CSDN博客_makefile vscode

4、Vscode 打开终端窗口_清风自在 流水潺潺的博客-CSDN博客_vscode运行终端

5、codeblocks使用fortran - CSDN















https://blog.sciencenet.cn/blog-3486472-1337493.html

上一篇:在 Ubuntu 20.04 上安装 Vscode并构建Fortran开发环境
下一篇:在Ubuntu20.04系统下安装GNSS数据处理软件—Ginan
收藏 IP: 203.168.5.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-29 01:36

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部