fuse初使用-eins

fuse的github及介绍fuse-githubfuse-wiki-zhmeson;ninjawget + tar 得到fuse源代码(我下载的是3.10.5),发现没有自己熟悉的configure、makefile,傻眼了一度以为自己下载的压缩包有问题,是不是贡献者忘了??(无比自信的我)对比了几版之后,我发现meson.build这个小东西meson 提供一种支持并行的编译环境,把他当成makefile的替代品就可以了;至于ninja,在这里是meson的默认后端 。可惜的是,我
摘要由CSDN通过智能技术生成

fuse的github及介绍

  1. fuse-github
  2. fuse-wiki-zh

meson;ninja

wget + tar 得到fuse源代码(我下载的是3.10.5),发现没有自己熟悉的configure、makefile,傻眼了
一度以为自己下载的压缩包有问题,是不是贡献者忘了??(无比自信的我)
对比了几版之后,我发现meson.build这个小东西

meson 提供一种支持并行的编译环境,把他当成makefile的替代品就可以了;至于ninja,在这里是meson的默认后端 。
可惜的是,我在meson官网并没有检索到Linux相关的东西,只讲了window环境下的安装和配置

sudo apt-get install python3 python3-pip ninja-build 
whereis ninja
ninja: /usr/bin/ninja /usr/share/man/man1/ninja.1.gz

sudo pip3 install meson
meson -h
usage: meson [-h] {
   setup,configure,dist,install,introspect,init,test,wrap,subprojects,help,rewrite,compile,devenv} ...
......//关于options的具体含义,略

编译安装fuse

  1. 新建一个临时build目录
dafei@ubuntu:~/kcode/fuse-3.10.5$ cd build
dafei@ubuntu:~/kcode/fuse-3.10.5/build$ meson ..
The Meson build system
Version: 0.60.1
Source dir: /home/dafei/mypath/fuse-3.10.5
Build dir: /home/dafei/mypath/fuse-3.10.5/build
Build type: native build
Project name: libfuse3
Project version: 3.10.5
C compiler for the host machine: cc (gcc 4.4.7 "cc (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7")
C linker for the host machine: cc ld.bfd 2.34
Host machine cpu family: x86_64
Host machine cpu: x86_64

meson好强,dotdot就把我的底牌搞清楚了

  1. 根据README的提示,我们可以用mesonconf命令修改编译选项
mesonconf #list options
mesonconf -D disable-mtab=true # set an option
//第一次使用啥也不敢动,就用mesonconf感受感受
//but,它显示command not found 
apt-get install meson //无果

结果还是 mesonconf:command not found
我比较了mesonconf和meson configure的具体含义,目前来看是等价的,或许是meson升级了呢

  1. 接下来是使用ninja(编译安装libfuse)
dafei@ubuntu:~/kcode/fuse-3.10.5/build$ ls
build.ninja            config.h  example  lib         meson-logs     meson-uninstalled  util
compile_commands.json  doc       include  meson-info  meson-private  test
ninja 
//报错 
FAILED: example/passthrough_hp.p/passthrough_hp.cc.o 
c++ -Iexample/passthrough_hp.p -Iexample -I../example -Iinclude -I../include -Ilib -I../lib -I. -I.. -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++0x -O2 -g -D_REENTRANT -DHAVE_CONFIG_H -D_GNU_SOURCE -Wno-sign-compare -Wmissing-declarations -Wwrite-strings -fno-strict-aliasing -pthread -MD -MQ example/passthrough_hp.p/passthrough_hp.cc.o -MF example/passthrough_hp.p/passthrough_hp.cc.o.d -o example/passthrough_hp.p/passthrough_hp.cc.o -c ../example/passthrough_hp.cc

发现可能是gcc版本的问题,我用的是4.4版本的,还是之前为了编译内核特地下的低版本的gcc。本地最新版本的也就是gcc-9了,不是很想搞,幸好还有一种方法:patch
https://github.com/koba-e964/libfuse/tree/fix-initializer-list中对example/passthrough.cc打个补丁

不管用,还是update-alternatives把g++版本调至g++ - 9,这里源代码已经打过补丁了(没试过无patch会怎样)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值