ginan入门初探

ginan入门初探

  • [1 依赖项安装](#1 依赖项安装)
  • [2 编译](#2 编译)
  • [3 跑一个测试样例](#3 跑一个测试样例)

环境:Ubuntu 24.04 Linux 6.14.11

使用gcc 14.2编译

原项目地址:ginan原始仓库

我学习的项目地址:https://github.com/SupremeLyre/ginan

1 依赖项安装

首先参照scripts/installation/ubuntu22.sh内apt下载的列表,缺啥补啥。

然后按照文档里的指示,安装mongocxx-3.7.0

mongocxx的中文文档:https://www.mongodb.com/zh-cn/docs/languages/cpp/cpp-driver/current/get-started/

bash 复制代码
curl -OL https://github.com/mongodb/mongo-cxx-driver/releases/download/r3.7.0/mongo-cxx-driver-r3.7.0.tar.gz
tar -zxvf mongo-cxx-driver-r3.7.0.tar.gz
cd mongo-cxx-driver-r3.7.0/build
cmake ..                                \
    -DCMAKE_BUILD_TYPE=Release          \
    -DCMAKE_CXX_STANDARD=17
cmake --build .
sudo cmake --build . --target install

还需要安装mongodb,默认的配置文件都会把数据写进数据库里。

参考文档:https://www.mongodb.com/zh-cn/docs/v8.0/tutorial/install-mongodb-on-ubuntu/

2 编译

这个版本的mongocxx默认会装在build/install/中,直接在ginan/src/CMakeLists.txt中配置mongocxx_DIRbson_DIR

cmake 复制代码
set(mongocxx_DIR /home/supremelyre/deps/mongo-cxx-driver-r3.7.0/build/install/lib/cmake/mongocxx-3.7.0)
set(bsoncxx_DIR  /home/supremelyre/deps/mongo-cxx-driver-r3.7.0/build/install/lib/cmake/bsoncxx-3.7.0)

此时mongoRead.cpp有报错,让万能的copilot帮忙改了下。

这里可能大部分碰不到,多核编译时内存消耗很大,使用-j24时直接把32G内存撑爆了......

只用16个核就可以了,速度也不慢。

未完待续......

3 跑一个测试样例

以PPP定位为例,在exampleConfigs中,有很多个yaml文件,而且有peadataproducts三个链接,编译过了之后pea就链接到这里了,分别进入dataproducts,执行下载数据的脚本,我一直是用了点方法下载的,不知道正常能不能下。

其默认的ppp_example.yaml用到了mongodb,先把mongodb服务启动一下,

bash 复制代码
sudo systemctl start mongod.service

status内显示active则已经启动。

直接在exampleConfigs中执行

bash 复制代码
./pea -y ./ppp_example.yaml

即可算出ALIC站的位置。

相关推荐
崔小汤呀2 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应2 天前
vi编辑器使用
linux·后端·操作系统
何中应2 天前
Linux进程无法被kill
linux·后端·操作系统
何中应2 天前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应2 天前
Linux常用命令
linux·操作系统
葛立国2 天前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux
西岸行者3 天前
学习笔记:SKILLS 能帮助更好的vibe coding
笔记·学习
哇哈哈20213 天前
信号量和信号
linux·c++
不是二师兄的八戒3 天前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
欧云服务器3 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian