轉載自https://www.huaweicloud.com/kunpeng/software/fmt.html
環境要求
雲服務器要求
本文以雲服務器KC1實例測試,雲服務器配置如表1-1所示。
表1-1雲服務器配置
項目 |
說明 |
規格 |
kc1.large.2 | 2vCPUs | 4GB |
磁盤 |
系統盤:高IO(40GB) |
操作系統要求
操作系統要求如表1-2所示。
表1-2操作系統要求
項目 |
說明 |
下載地址 |
CentOS |
7.6 |
在公共鏡像中已提供。 |
Kernel |
4.14.0-115 |
在公共鏡像中已提供。 |
1. 配置編譯環境
1) 安裝wget工具。
yum install wget -y
2) 安裝或者升級cmake版本到3.1.0或更高版本。
cd /usr/local/src
yum remove cmake cmake-data
wget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz
tar -zxvf cmake-3.9.2.tar.gz
cd cmake-3.9.2
./configure
make && make install
----結束
2. 獲取源碼
獲取“fmt-6.0.0”源碼包。
cd /usr/local/src
wget https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz
3. 編譯和安裝
1) 解壓軟件包。
cd /usr/local/src
tar -zxvf 6.0.0.tar.gz
2) 進入fmt的安裝目錄。
cd fmt-6.0.0/
3) 生成Makefile文件。
mkdir build
cd build/
cmake ..
4) 安裝fmt。
make && make install
----結束
4. 運行和驗證
查詢fmt版本號。
fmt --version
回顯信息如下,則表示fmt安裝成功。
fmt (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ross Paterson.