👺
Rookie's Notes
  • 😁Hi there 👋
  • 🦸‍♂️Key-value Storage
    • 😇MetaData
    • 😇CAP therom
    • 😇LSM Tree
    • 😍Google BigTable
    • 😍Google File System
    • 😍Google MapReduce
    • 🧐Bloom Filter
    • 🧐Cuckoo Filter:Better Than Bloom
    • 🤩LevelDB
      • 🤓LevelDB & BigTable
      • 🤓SSTable in LevelDB
      • 🤓Log source code analysis
    • 🤩RocksDB
      • 😙RocksDB & LevelDB
      • 😚General
      • 😚Optimization
    • 🤩TiKV
      • 🥳General
  • 🦸DPU Plus
    • 😄General
    • 😁Meson
    • 😁SSD
    • 😆NVMe
    • 🥰RDMA
      • 😍Import
      • 😅RoCE
      • 😋Elements
      • 😂Options
      • 🥳Service
      • 😃Memory Region
      • ☺️Protection Domain
      • 😁Address Handle
      • 😅Queue Pair
      • 😂Completion Queue ​
      • 😆Shared Receive Queue
      • 😆Verbs
      • 🥲用户态与内核态交互
  • 🦹‍♂️GPU & DB
    • 😀Crystal
    • 😄GPU Compression
    • 😆Mordred
    • 😃GPU & RDMA & DB
  • 🦸Databases
    • 😁CMU 15-445
      • 😉Buffer Pool
        • 😄Expand
      • 😉B+ Tree Index
        • 😌Pre: B & B+
        • 🤣Pre: B+Tree
        • 😂Expand
        • 😂Expand2: Delete
        • 😂Expand3: Index_Iterator
      • 😉Query Execution
      • 😉Concurrency Control
    • 😅CMU 15-721
      • 😇02 inmemory
      • 😇03 mvcc1
      • 😇04 mvcc2
      • 😇05 mvcc3
      • 😇06 oltpindexes1
  • 🦸‍♂️Block Chain
    • 😡Uniswap-v2 合约概览
    • 😭对接 Uniswap V2 兑换代币
    • 🤓bignumer.js中常见运算
  • 🦸‍♂️Utils
    • 😅typename or class?
    • 😁RALL
    • 🥲Smart Pointers
    • 🤣Parallelism and Concurrency
    • 😇Lock V1
    • 😇Lock V2
    • 🥰Thread Pooling
    • 😩Skiplist
    • 😅Miscellaneous Of C++
  • Group 1
    • 🫂Personal diaries
      • 😑2021中秋杂感
      • 😖2022玉玉日记(一)
      • 😚2022玉玉日记(二)
      • 🤔2022玉玉日记(三)
      • ☹️2022玉玉日记(四)
      • 🥲2022玉玉日记(五)
      • 🧐2023留学日记 (一)
Powered by GitBook
On this page
  • Install
  • Compile Configuration
  • Referance
Edit on GitHub
  1. DPU Plus

Meson

meson 入门介绍

Install

Meson是基于python3实现,至少需要python3.5才能运行,默认采用ninja作为后端。 在Ubuntu下最简单的是通过pip3安装

sudo apt-get install python3 python3-pip ninja-build
sudo pip3 install meson

也可以只将meson安装到当前用户目录下

pip3 install --user meson

这种方式会将meson安装到~/.local/bin目录下,因此需要将这个目录增加到PATH中。

Compile Configuration

下面是个例子:

$ cat > meson.build << EOF
> project('mesontest', 'c')
> executable('mesontest', test.c)
> EOF

$ meson builddir && cd builddir
$ ninja
$ ./mesontest
hello meson.

meson通过meson.build文件配置编译语言及文件,project指定项目名称及语言类型,executable指定可执行文件名及源文件。

meson builddir (meson build) 用于执行构建;

cd builddir 和 ninja 用于执行编译,其中 ninja 是后端编译器,相当于 make。

下面用 meson configure 查看meson内置的选项、默认值及可选值:

项目可以通过 meson_options.txt 来增加项目特有的选项。

meson configure
...she
Project options:
  Option  Default Value  Possible Values            Description
  gtk_doc auto           [enabled, disabled, auto]  Generate API documentation with gtk-doc
...

在生成编译配置时,可以通过 -D 指定编译选项:

meson builddir -Dprefix=/usr -Dgtk_doc=disabled -Dtests=disabled
cd builddir && ninja -j8
meson install

可以在源码根目录通过 configure更新编译选项,再执行ninja重新编译:

1 $ meson configure builddir -Dprefix=/home/dev/tmp

Referance

PreviousGeneralNextSSD

Last updated 2 years ago

🦸
😁
https://mesonbuild.com/Reference-manual.html