上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 如果你用CPython写了一个扩展,然后要打包到wheel中发布,应该如何操作?你搜索网络,不管英文还是中文,得到的都是一知半解的答案。根据官方的粗浅文档,你可能可以很快完成一个wheel包,但和真正的wheel包差了十万八千里。这里主要考虑两个问题:1.包的结构,2.依赖库如何打包。 学习资源 因 阅读全文
posted @ 2022-10-18 17:00 MasonLee 阅读(810) 评论(0) 推荐(0) 编辑
摘要: 准备工作 部署私有 pip 库需要使用 pypiserver 这个 Python 包。我们建议使用 docker 部署,方便快捷。首先我们到部署的服务器上,创建一个存放配置和包的目录,我的是:/var/www/pypiserver 。 我们使用了 Docker swarm 来部署,参考了这里的配置: 阅读全文
posted @ 2022-10-17 15:17 MasonLee 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 安装wheel库 pip install wheel 制作whl文件非常简单 pip wheel --wheel-dir=./dist ./ python3 setup.py sdist bdist_wheel # 同时打包 --wheel-dir 指定生成.whl文件的存储位置,上面的命令,我是进 阅读全文
posted @ 2022-10-14 16:15 MasonLee 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 在这篇博文中,我将讨论如何开始使用Pipenv一个 Python 打包工具。这篇博文遵循 Ubuntu 工作流程,可以在 MacOS 和 Windows 中轻松复制。让我们开始吧。 什么是Pipenv? Pipenv 是 Python 的 Python 打包工具,是对使用Pip、Venv和 requ 阅读全文
posted @ 2022-10-14 13:56 MasonLee 阅读(147) 评论(0) 推荐(0) 编辑
摘要: pyo3 官方使用手册: 【点击查看】 maturin 构建使用工具: 【点击查看】 一、前言 安装 pip install maturin 主要有以下三个命令: maturin publish 将 crate 构建到 python 包中并将它们发布到 pypi。 maturin build构建轮子 阅读全文
posted @ 2022-10-14 10:46 MasonLee 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1,目录结构 2,代码清单 2.1,utils.h #ifndef __UTILS_H__ #define __UTILS_H__ #include <iostream> class Utils { private: public: static void print(std::string str 阅读全文
posted @ 2022-10-14 10:20 MasonLee 阅读(819) 评论(0) 推荐(0) 编辑
摘要: screen的一些常用命令和快捷键 安装 sudo apt install screen 命令 screen -S screen_name,新建screen,并指定名字 screen -d screen_name,detach正在使用的screen screen -R screen_name, 连接 阅读全文
posted @ 2022-10-13 14:32 MasonLee 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 其实,类互相引用是正常的现象,无法避免.怎么办? 吾从网上搜索了半天,发现解决办法限制多,也不利于其他类的使用.于是,吾找到了一个解决办法: 两个类的头文件互相include,然后声明对方. 两个类的头文件,不实现函数(特别是指使用对方的成员). 两个类的代码文件,实现各个函数. 这样,两个类完全是 阅读全文
posted @ 2022-10-12 14:11 MasonLee 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 有时候在设计数据结构的时候,可能会遇到两个类需要相互引用的情形。比如类A有类型为B的成员,而类B又有类型为A的成员。 那么这种情形下,两个类的设计上需要注意什么呢? 同一文件 尝试方案 将A和B的定义都放在一个文件中,例如: #include <iostream> class A { public: 阅读全文
posted @ 2022-10-12 14:10 MasonLee 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 在程序员的开发生涯中,读写配置文件必不可少。 配置文件有利于我们灵活配置工程,解决大量重复劳动,也方便调试。 配置文件的格式有很多,最简单的有一行一行的文本,也有像 json、xml、protocol buffer 这样结构化的格式,当然也有 yaml 这种格式。 今天的博文介绍的是如何在 C++ 阅读全文
posted @ 2022-10-12 14:09 MasonLee 阅读(547) 评论(0) 推荐(0) 编辑
摘要: 使用国内镜像加速更新 Rustup 工具链 我们需要指定 RUSTUP_DIST_SERVER(默认指向 https://static.rust-lang.org)和 RUSTUP_UPDATE_ROOT (默认指向https://static.rust-lang.org/rustup),这两个网站 阅读全文
posted @ 2022-10-12 09:10 MasonLee 阅读(961) 评论(0) 推荐(0) 编辑
摘要: Get started with CMake Tools on Linux CMake is an open-source, cross-platform tool that uses compiler and platform independent configuration files to 阅读全文
posted @ 2022-10-11 21:31 MasonLee 阅读(722) 评论(0) 推荐(1) 编辑
摘要: 需要引入cc依赖 Cargo.toml [package] name = "rust-call-c" version = "0.1.0" authors = ["ice <bsqql123@163.com>"] build = "build.rs" [dependencies] libc = "0. 阅读全文
posted @ 2022-10-11 17:12 MasonLee 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 刚入坑Rust,因为公司项目需求,需要将libjpeg-turbo移植到Rust中,在使用NDK完成交叉编译后,我对着几个库文件不知所措。国内Rust相关的文章太少,无奈只能到github和Stack Overflow上找答案。这篇文章的内容其实是Rust FFI章节的相关知识,在这里做一下总结。 阅读全文
posted @ 2022-10-11 17:09 MasonLee 阅读(971) 评论(0) 推荐(0) 编辑
摘要: git config --global user.email johndoe@example.com git config --global user.name "John Doe" git config --global credential.helper store 阅读全文
posted @ 2022-10-11 11:08 MasonLee 阅读(27) 评论(0) 推荐(0) 编辑
摘要: spdlog Install ubuntu sudo apt install libspdlog-dev 阅读全文
posted @ 2022-10-11 10:29 MasonLee 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 原因在于版本不统一,之前编译过CMakeLists.txt后,产生了缓存文件CMakeCache.txt, 解决方案:删除CMakeCache.txt文件,解决。 rm -f `find -name CMakeCache.txt` 阅读全文
posted @ 2022-10-11 09:47 MasonLee 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 在linux安装过程如下: 一,最简单的办法: 搜到所有的boost库 然后: sudo apt-get install libboost-all-dev 安装相应的库 二,[编译安装] https://www.boost.org/doc/libs/1_80_0/more/getting_start 阅读全文
posted @ 2022-10-10 16:57 MasonLee 阅读(637) 评论(0) 推荐(0) 编辑
摘要: Fresh from upgrading from Ubuntu 20.04 to 22.04, the Gnome-control-center (settings) was missing. I could not find anyone who resolved this specific i 阅读全文
posted @ 2022-10-10 16:52 MasonLee 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Ubuntu 22.04 LTS 已经发布了,作为系统爱好者,自然第一事件升级。 虚拟机里跑的21.10有图形化界面,可以通过软件更新器直接更新。 那么WSL环境下的Ubuntu该如何升级呢 首先使用命令,这里用的是nano作为编辑器,也可以用vim sudo nano /etc/update-ma 阅读全文
posted @ 2022-10-10 16:12 MasonLee 阅读(1474) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页