Winse Blog

走走停停都是风景, 熙熙攘攘都向最好, 忙忙碌碌都为明朝, 何畏之.

请求复制/镜像

在测试一个新功能,如果写入原程序的情况下再写一份到新的程序呢?比如Elasticsearch和OpenSearch。还有把生产的流量引一份出来测试,如果来实现呢?

一般的转换功能复制,如logstash、vector,但这些不能返回结果,不符合。只能往反向代理上找:nginx。

nginx_http_mirror_module模块

当请求到达 Nginx 时,如果 Nginx 开启了流量镜像功能,就会将请求复制一份,并根据 mirror location 中的配置来处理这份复制的请求。

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  listen 9200;
  server_name elasticsearch;
  client_max_body_size 50m;

# error_log /var/log/nginx/elasticsearch-errors.log;
# access_log /var/log/nginx/elasticsearch.log;

  location / {
  
    # Deny Nodes shutdown API
    if ($request_filename ~ "_shutdown") { 
      return 403;
      break;
    }
    
    # Deny access to cluster API
    if ($request_filename ~ "_cluster") {
      return 403;
      break;
    }
    
    # Pass requests to ETasticsearch
    proxy_pass http://localhost:9201;
    proxy_redirect off;
    
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    
    # For CORS Ajax 
    proxy_pass_header Access-Control-Allow-origin;
    proxy_pass_header Access-Control-Allow-Method proxy_hide_header Access-Control-Allow-Headers;
    add_header Access-control-A1low-Headers 'X-Requested-with, Content-Type';
    # add_header Access-Control-Allow-credentials true;
        
    # Authorize access 
    #auth basic "elasticsearch";
    #auth_basic_user_file /usr/local/etc/elasticsearch/passwords;
    
    mirror /mirror;
    mirror_request_body on;
  }
  
  location /mirror {
    internal; # 指定此location只能被“内部的”请求调用
  
    # Pass requests to OpenSearch
    proxy_pass http://127.0.0.1:19200$request_uri;
    proxy_redirect off:
  
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
  }
}

server {
  listen 127.0.0.1:19200;
  location / { # 增加一层,方便在nginx中输出日志定位问题
    proxy_pass https://192.168.1.21:9200;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
  
    proxy_set_header Authorization "Basic YWRtaW46YWRtaW4=";

shell中计算base64的时刻要注意加上 -ne ,也可以直接网上 https://tool.chinaz.com/tools/base64.aspx 算一下。

1
echo -ne 'admin:admin'|base64 -

–END

微信对接OpenAI

前篇通过sms申请国外手机号注册了OpenAI,在网页上体验了一把ChatGPT。由于需要翻墙,在手机上使用起来并不是很方便,也不能把账号给所有想用的朋友用,范围受限。

最近OpenAI的接口功对接,以及很多文章讲微信对接的文章,我也蹭着这股风把原来的公众号捡起来熟悉熟悉。

使用开源的方案

参考文章:

搞一台国外的服务器(同事通过自己的机器+翻墙也是可以的)

安装Python3.8(OpenAI接口有要求)

我用的服务器是CentOS7的,已经安装了Python3.6,官方yum中最新的也就3.6。使用scl(Software Collections,类似NVM多版本共存)的方式安装:

再回顾:如果还要更多个python版本,安装conda也是一个不错的选择。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
[root@izt4nhcmmx33bjwcsdmf8oz ~]# sudo yum install centos-release-scl

[root@izt4nhcmmx33bjwcsdmf8oz ~]# yum install rh-python38
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: mirror.vodien.com
 * centos-sclo-sclo: mirror.vodien.com
Resolving Dependencies
--> Running transaction check
---> Package rh-python38.x86_64 0:2.0-4.el7 will be installed
--> Processing Dependency: rh-python38-runtime for package: rh-python38-2.0-4.el7.x86_64
--> Processing Dependency: rh-python38-python for package: rh-python38-2.0-4.el7.x86_64
--> Processing Dependency: rh-python38-python-pip for package: rh-python38-2.0-4.el7.x86_64
--> Processing Dependency: rh-python38-python-setuptools for package: rh-python38-2.0-4.el7.x86_64
--> Running transaction check
---> Package rh-python38-python.x86_64 0:3.8.13-1.el7 will be installed
--> Processing Dependency: rh-python38-python-libs(x86-64) = 3.8.13-1.el7 for package: rh-python38-python-3.8.13-1.el7.x86_64
--> Processing Dependency: libpython3.8.so.rh-python38-1.0()(64bit) for package: rh-python38-python-3.8.13-1.el7.x86_64
---> Package rh-python38-python-pip.noarch 0:19.3.1-3.el7 will be installed
---> Package rh-python38-python-setuptools.noarch 0:41.6.0-7.el7 will be installed
---> Package rh-python38-runtime.x86_64 0:2.0-4.el7 will be installed
--> Running transaction check
---> Package rh-python38-python-libs.x86_64 0:3.8.13-1.el7 will be installed
--> Processing Dependency: rh-python38-python-pip-wheel for package: rh-python38-python-libs-3.8.13-1.el7.x86_64
--> Processing Dependency: rh-python38-python-setuptools-wheel for package: rh-python38-python-libs-3.8.13-1.el7.x86_64
--> Running transaction check
---> Package rh-python38-python-pip-wheel.noarch 0:19.3.1-3.el7 will be installed
---> Package rh-python38-python-setuptools-wheel.noarch 0:41.6.0-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================
 Package                                              Arch                    Version                         Repository                       Size
====================================================================================================================================================
Installing:
 rh-python38                                          x86_64                  2.0-4.el7                       centos-sclo-rh                  2.8 k
Installing for dependencies:
 rh-python38-python                                   x86_64                  3.8.13-1.el7                    centos-sclo-rh                   71 k
 rh-python38-python-libs                              x86_64                  3.8.13-1.el7                    centos-sclo-rh                  7.7 M
 rh-python38-python-pip                               noarch                  19.3.1-3.el7                    centos-sclo-rh                  1.6 M
 rh-python38-python-pip-wheel                         noarch                  19.3.1-3.el7                    centos-sclo-rh                  1.0 M
 rh-python38-python-setuptools                        noarch                  41.6.0-7.el7                    centos-sclo-rh                  636 k
 rh-python38-python-setuptools-wheel                  noarch                  41.6.0-7.el7                    centos-sclo-rh                  299 k
 rh-python38-runtime                                  x86_64                  2.0-4.el7                       centos-sclo-rh                  1.1 M

Transaction Summary
====================================================================================================================================================
Install  1 Package (+7 Dependent packages)

Total download size: 12 M
Installed size: 48 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/centos-sclo-rh/packages/rh-python38-2.0-4.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f2ee9d55: NOKEY
Public key for rh-python38-2.0-4.el7.x86_64.rpm is not installed
(1/8): rh-python38-2.0-4.el7.x86_64.rpm                                                                                      | 2.8 kB  00:00:00     
(2/8): rh-python38-python-3.8.13-1.el7.x86_64.rpm                                                                            |  71 kB  00:00:00     
(3/8): rh-python38-python-pip-19.3.1-3.el7.noarch.rpm                                                                        | 1.6 MB  00:00:00     
(4/8): rh-python38-python-pip-wheel-19.3.1-3.el7.noarch.rpm                                                                  | 1.0 MB  00:00:00     
(5/8): rh-python38-python-setuptools-41.6.0-7.el7.noarch.rpm                                                                 | 636 kB  00:00:00     
(6/8): rh-python38-python-libs-3.8.13-1.el7.x86_64.rpm                                                                       | 7.7 MB  00:00:00     
(7/8): rh-python38-python-setuptools-wheel-41.6.0-7.el7.noarch.rpm                                                           | 299 kB  00:00:00     
(8/8): rh-python38-runtime-2.0-4.el7.x86_64.rpm                                                                              | 1.1 MB  00:00:00     
----------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                21 MB/s |  12 MB  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Importing GPG key 0xF2EE9D55:
 Userid     : "CentOS SoftwareCollections SIG (https://wiki.centos.org/SpecialInterestGroup/SCLo) <security@centos.org>"
 Fingerprint: c4db d535 b1fb ba14 f8ba 64a8 4eb8 4e71 f2ee 9d55
 Package    : centos-release-scl-rh-2-3.el7.centos.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : rh-python38-runtime-2.0-4.el7.x86_64                                                                                             1/8 
  Installing : rh-python38-python-pip-wheel-19.3.1-3.el7.noarch                                                                                 2/8 
  Installing : rh-python38-python-setuptools-wheel-41.6.0-7.el7.noarch                                                                          3/8 
  Installing : rh-python38-python-setuptools-41.6.0-7.el7.noarch                                                                                4/8 
  Installing : rh-python38-python-3.8.13-1.el7.x86_64                                                                                           5/8 
  Installing : rh-python38-python-libs-3.8.13-1.el7.x86_64                                                                                      6/8 
  Installing : rh-python38-python-pip-19.3.1-3.el7.noarch                                                                                       7/8 
  Installing : rh-python38-2.0-4.el7.x86_64                                                                                                     8/8 
  Verifying  : rh-python38-2.0-4.el7.x86_64                                                                                                     1/8 
  Verifying  : rh-python38-python-pip-wheel-19.3.1-3.el7.noarch                                                                                 2/8 
  Verifying  : rh-python38-python-setuptools-wheel-41.6.0-7.el7.noarch                                                                          3/8 
  Verifying  : rh-python38-python-3.8.13-1.el7.x86_64                                                                                           4/8 
  Verifying  : rh-python38-python-pip-19.3.1-3.el7.noarch                                                                                       5/8 
  Verifying  : rh-python38-python-libs-3.8.13-1.el7.x86_64                                                                                      6/8 
  Verifying  : rh-python38-python-setuptools-41.6.0-7.el7.noarch                                                                                7/8 
  Verifying  : rh-python38-runtime-2.0-4.el7.x86_64                                                                                             8/8 

Installed:
  rh-python38.x86_64 0:2.0-4.el7                                                                                                                    

Dependency Installed:
  rh-python38-python.x86_64 0:3.8.13-1.el7                              rh-python38-python-libs.x86_64 0:3.8.13-1.el7                              
  rh-python38-python-pip.noarch 0:19.3.1-3.el7                          rh-python38-python-pip-wheel.noarch 0:19.3.1-3.el7                         
  rh-python38-python-setuptools.noarch 0:41.6.0-7.el7                   rh-python38-python-setuptools-wheel.noarch 0:41.6.0-7.el7                  
  rh-python38-runtime.x86_64 0:2.0-4.el7                               

Complete!
[root@izt4nhcmmx33bjwcsdmf8oz ~]# 

检测一下,查看Python版本:

1
2
3
4
5
6
7
[root@izt4nhcmmx33bjwcsdmf8oz ~]# scl enable rh-python38 bash

[root@izt4nhcmmx33bjwcsdmf8oz ~]# python --version
Python 3.8.13
[root@izt4nhcmmx33bjwcsdmf8oz ~]# pip --version 
pip 19.3.1 from /opt/rh/rh-python38/root/usr/lib/python3.8/site-packages/pip (python 3.8)
[root@izt4nhcmmx33bjwcsdmf8oz ~]# 

下载代码:

1
[root@izt4nhcmmx33bjwcsdmf8oz ~]# git clone https://github.com/zhayujie/bot-on-anything

对接个人微信

1 安装依赖

参考 https://github.com/zhayujie/chatgpt-on-wechat 的说明:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## [root@izt4nhcmmx33bjwcsdmf8oz Python-3.8.1]# yum install libffi-devel

[root@izt4nhcmmx33bjwcsdmf8oz ~]# pip3 install itchat-uos==1.5.0.dev0
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting itchat-uos==1.5.0.dev0
  Downloading http://mirrors.aliyun.com/pypi/packages/31/2b/0be7e46195dc3c461518b046a6fb9c34c97cd2fd44847b840a0011686575/itchat_uos-1.5.0.dev0-py3-none-any.whl (52kB)
     |████████████████████████████████| 61kB 1.9MB/s 
Collecting requests
  Downloading http://mirrors.aliyun.com/pypi/packages/d2/f4/274d1dbe96b41cf4e0efb70cbced278ffd61b5c7bb70338b62af94ccb25b/requests-2.28.2-py3-none-any.whl (62kB)
     |████████████████████████████████| 71kB 2.0MB/s 
Collecting pyqrcode
  Downloading http://mirrors.aliyun.com/pypi/packages/37/61/f07226075c347897937d4086ef8e55f0a62ae535e28069884ac68d979316/PyQRCode-1.2.1.tar.gz
Collecting pypng
  Downloading http://mirrors.aliyun.com/pypi/packages/3e/b9/3766cc361d93edb2ce81e2e1f87dd98f314d7d513877a342d31b30741680/pypng-0.20220715.0-py3-none-any.whl (58kB)
     |████████████████████████████████| 61kB 1.8MB/s 
Collecting certifi>=2017.4.17
  Downloading http://mirrors.aliyun.com/pypi/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl (155kB)
     |████████████████████████████████| 163kB 1.7MB/s 
Collecting idna<4,>=2.5
  Downloading http://mirrors.aliyun.com/pypi/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (61kB)
     |████████████████████████████████| 71kB 1.9MB/s 
Collecting urllib3<1.27,>=1.21.1
  Downloading http://mirrors.aliyun.com/pypi/packages/fe/ca/466766e20b767ddb9b951202542310cba37ea5f2d792dae7589f1741af58/urllib3-1.26.14-py2.py3-none-any.whl (140kB)
     |████████████████████████████████| 143kB 1.3MB/s 
Collecting charset-normalizer<4,>=2
  Downloading http://mirrors.aliyun.com/pypi/packages/20/a2/16b2cbf5f73bdd10624b94647b85c008ba25059792a5c7b4fdb8358bceeb/charset_normalizer-3.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195kB)
     |████████████████████████████████| 204kB 1.5MB/s 
Installing collected packages: certifi, idna, urllib3, charset-normalizer, requests, pyqrcode, pypng, itchat-uos
    Running setup.py install for pyqrcode ... done
Successfully installed certifi-2022.12.7 charset-normalizer-3.0.1 idna-3.4 itchat-uos-1.5.0.dev0 pypng-0.20220715.0 pyqrcode-1.2.1 requests-2.28.2 urllib3-1.26.14

[root@izt4nhcmmx33bjwcsdmf8oz ~]# pip3 install --upgrade openai
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting openai
  Downloading http://mirrors.aliyun.com/pypi/packages/2f/15/b29ed5ad2eed1f49b8b3e2067fbbbb63cfbfc496ca2a27b772bcf0907ad8/openai-0.27.0-py3-none-any.whl (70kB)
     |████████████████████████████████| 71kB 1.7MB/s 
Collecting tqdm
  Downloading http://mirrors.aliyun.com/pypi/packages/e6/02/a2cff6306177ae6bc73bc0665065de51dfb3b9db7373e122e2735faf0d97/tqdm-4.65.0-py3-none-any.whl (77kB)
     |████████████████████████████████| 81kB 1.9MB/s 
Collecting aiohttp
  Downloading http://mirrors.aliyun.com/pypi/packages/d2/e5/cef5eeb11d7e8bac830b3bee1c8311b19bf8e8a1c45fe14b876c70adcd06/aiohttp-3.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0MB)
     |████████████████████████████████| 1.0MB 1.5MB/s 
Requirement already satisfied, skipping upgrade: requests>=2.20 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from openai) (2.28.2)
Collecting yarl<2.0,>=1.0
  Downloading http://mirrors.aliyun.com/pypi/packages/b3/0d/0ba1f2022b9a36ae670c1f3c579ed08d0958398cb6beaf4687e606ad33d4/yarl-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (262kB)
     |████████████████████████████████| 266kB 1.7MB/s 
Collecting aiosignal>=1.1.2
  Downloading http://mirrors.aliyun.com/pypi/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl
Collecting attrs>=17.3.0
  Downloading http://mirrors.aliyun.com/pypi/packages/fb/6e/6f83bf616d2becdf333a1640f1d463fef3150e2e926b7010cb0f81c95e88/attrs-22.2.0-py3-none-any.whl (60kB)
     |████████████████████████████████| 61kB 1.7MB/s 
Requirement already satisfied, skipping upgrade: charset-normalizer<4.0,>=2.0 in /opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages (from aiohttp->openai) (3.0.1)
Collecting frozenlist>=1.1.1
  Downloading http://mirrors.aliyun.com/pypi/packages/ec/ab/a440db757401a1e8863c9abb374a77cb2884eda74ffbf555dedcf1fbe7f6/frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161kB)
     |████████████████████████████████| 163kB 1.8MB/s 
Collecting multidict<7.0,>=4.5
  Downloading http://mirrors.aliyun.com/pypi/packages/fe/0c/8469202f8f4b0e65816f91c3febc4bda7316c995b59ecdf3b15c574f7a24/multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121kB)
     |████████████████████████████████| 122kB 1.9MB/s 
Collecting async-timeout<5.0,>=4.0.0a3
  Downloading http://mirrors.aliyun.com/pypi/packages/d6/c1/8991e7c5385b897b8c020cdaad718c5b087a6626d1d11a23e1ea87e325a7/async_timeout-4.0.2-py3-none-any.whl
Requirement already satisfied, skipping upgrade: idna<4,>=2.5 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests>=2.20->openai) (3.4)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests>=2.20->openai) (2022.12.7)
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests>=2.20->openai) (1.26.14)
Installing collected packages: tqdm, multidict, yarl, frozenlist, aiosignal, attrs, async-timeout, aiohttp, openai
Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-22.2.0 frozenlist-1.3.3 multidict-6.0.4 openai-0.27.0 tqdm-4.65.0 yarl-1.8.2
[root@izt4nhcmmx33bjwcsdmf8oz ~]# 

2 修改配置用个人微信方式使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# cp config-template.json config.json

[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# cat config.json 
{
  "model": {
    "type" : "chatgpt",
    "openai": {
      "api_key": "sk-xxx",
      "proxy": "",
      "conversation_max_tokens": 1000,
      "character_desc": "你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。"
    }
  },

  "channel": {
    "type": "wechat",
    "single_chat_prefix": ["bot", "@bot"],
    "single_chat_reply_prefix": "[bot] ",
    "group_chat_prefix": ["@bot"],
    "group_name_white_list": ["ChatGPT测试群"],
    "image_create_prefix": ["画", "看", "找一张"],

    "terminal": {
    },

    "wechat": {
    },

配置解释说明:

1
2
3
4
5
  "single_chat_prefix": ["bot", "@bot"], # 私聊时文本需要包含该前缀才能触发机器人回复
  "single_chat_reply_prefix": "[bot] ", # 私聊时自动回复的前缀,用于区分真人
  "group_chat_prefix": ["@bot"], # 群聊时包含该前缀则会触发机器人回复
  "group_name_white_list": ["ChatGPT测试群", "ChatGPT测试群2"], # 开启自动回复的群名称列表
  "image_create_prefix": ["画", "看", "找"], # 开启图片回复的前缀

可以把 group_chat_prefix 改成你要使用的微信号的名称,这样人家@你,就能触发机器人了。

3 启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# cat startup.sh 
#!/bin/bash

scl enable rh-python38 - << \EOF

mv nohup.out{,$(date +'%Y%m%d%H%M')}
touch nohup.out
nohup python3 app.py & tail -f nohup.out

EOF

[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# 

[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# sh startup.sh 

启动后,会输出一个二维码,使用微信扫描登录。然后建群 ChatGPT测试群 就可以和ChatGPT聊天了。

对接微信公众号

1 做域名外网映射

微信公众号要求443或者80端口,首先用 花生壳 做一个映射(还不要求外网ip的443端口)。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[root@izt4nhcmmx33bjwcsdmf8oz ~]# wget "https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.rpm" -O phddns_5.2.0_amd64.rpm
--2023-03-16 12:59:06--  https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.rpm

Resolving down.oray.com (down.oray.com)... 163.181.42.225, 163.181.42.228, 163.181.42.223, ...
Connecting to down.oray.com (down.oray.com)|163.181.42.225|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 295240 (288K) [application/x-redhat-package-manager]
Saving to: ‘phddns_5.2.0_amd64.rpm’

100%[==========================================================================================================>] 295,240     1.25MB/s   in 0.2s   

2023-03-16 12:59:07 (1.25 MB/s) - ‘phddns_5.2.0_amd64.rpm’ saved [295240/295240]

[root@izt4nhcmmx33bjwcsdmf8oz ~]# 

[root@izt4nhcmmx33bjwcsdmf8oz ~]# rpm -ivh phddns_5.2.0_amd64.rpm       
Preparing...                          ################################# [100%]

+----------------Phtunnel start install--------------+

Updating / installing...
   1:phddns-5.2.0-1                   ################################# [100%]
Binary file /proc/1/cmdline matches
Created symlink from /etc/systemd/system/multi-user.target.wants/phtunnel.service to /usr/lib/systemd/system/phtunnel.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/phddns_mini_httpd.service to /usr/lib/systemd/system/phddns_mini_httpd.service.

+-----------Phtunnel Service Install Success---------+


+--------------------------------------------------------+
|                Oray Phtunnel Linux 5.2.0               |
+--------------------------------------------------------+
|     SN: orayc1xxxxx   Default password: admin     |
+--------------------------------------------------------+
| Usage: phddns(start|status|stop|restart|reset|version) |
+--------------------------------------------------------+
|       Remote Management Address http://b.oray.com      |
+--------------------------------------------------------+

[root@izt4nhcmmx33bjwcsdmf8oz ~]# 

# 卸载:yum remove phddns
# phddns start(启动)| status(状态)| stop(停止)|restart(重启)| reset(重置)|enable(开机自启动)|disable(关闭开机自启动)|version(版本)

用上面的SN号和密码登录,在linux上会以一个设备的方式,然后绑定到我们的账号,

然后再到自己的账号设置 https://console.hsk.oray.com/forward 内网穿透,配置一个https映射的。

2 修改配置连接公众号

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# cat config.json 
{
  "model": {
    "type" : "chatgpt",
    "openai": {
      "api_key": "sk-xxxxxx",
      "proxy": "",
      "conversation_max_tokens": 1000,
      "character_desc": "你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。"
    }
  },

  "channel": {
    "type": "wechat_mp",
    "single_chat_prefix": ["bot", "@bot"],
    "single_chat_reply_prefix": "[ChatGPT] ",
    "group_chat_prefix": ["@bot"],
    "group_name_white_list": ["ChatGPT测试群", "ChatGPT哇哇哇", "刘兰家", "ChatGPT"],
    "image_create_prefix": ["画", "看", "找一张"],

    "terminal": {
    },

    "wechat": {
    },

    "wechat_mp": {
      "token": "xxxxxx",
      "port": "3000"
    },
  

3 安装依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# scl enable rh-python38 bash 
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# pip3 install werobot
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting werobot
  Downloading http://mirrors.aliyun.com/pypi/packages/84/98/6a16bc6c9b3c216efd28babe06f1891ff1fe3f7f96dfb88516545a8c9b30/WeRoBot-1.13.1-py2.py3-none-any.whl (44kB)
     |████████████████████████████████| 51kB 2.0MB/s 
Collecting bottle
  Downloading http://mirrors.aliyun.com/pypi/packages/bb/1f/5977ea88c6a3df6199db97d320e5da816d415d1eb75a987a1f6823d5cc9d/bottle-0.12.25-py3-none-any.whl (90kB)
     |████████████████████████████████| 92kB 1.8MB/s 
Requirement already satisfied: requests in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from werobot) (2.28.2)
Collecting xmltodict
  Downloading http://mirrors.aliyun.com/pypi/packages/94/db/fd0326e331726f07ff7f40675cd86aa804bfd2e5016c727fa761c934990e/xmltodict-0.13.0-py2.py3-none-any.whl
Requirement already satisfied: certifi>=2017.4.17 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests->werobot) (2022.12.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests->werobot) (1.26.14)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/rh/rh-python38/root/usr/local/lib64/python3.8/site-packages (from requests->werobot) (3.0.1)
Requirement already satisfied: idna<4,>=2.5 in /opt/rh/rh-python38/root/usr/local/lib/python3.8/site-packages (from requests->werobot) (3.4)
Installing collected packages: bottle, xmltodict, werobot
Successfully installed bottle-0.12.25 werobot-1.13.1 xmltodict-0.13.0
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# 

再下载一个敏感字过滤文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# wget https://raw.githubusercontent.com/qloog/sensitive_words/master/keywords
--2023-03-16 13:52:30--  https://raw.githubusercontent.com/qloog/sensitive_words/master/keywords
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 289615 (283K) [text/plain]
Saving to: ‘keywords’

100%[==========================================================================================================>] 289,615     --.-K/s   in 0.009s  

2023-03-16 13:52:31 (32.0 MB/s) - ‘keywords’ saved [289615/289615]

[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# mv keywords  sensitive_words.txt
[root@izt4nhcmmx33bjwcsdmf8oz bot-on-anything]# 

配置好后,先启动服务,再修改微信公众号接口地址。

启动还是用上面的脚本即可:

1
2
Bottle v0.12.25 server starting up (using AutoServer())...
Listening on http://0.0.0.0:3000/

4 修改微信公众号的接口地址

设置与开发 - 基本配置服务器配置服务器地址令牌TOKEN 与 config.json 里面的一致。

然后就可以用微信公众号与ChatGPT聊天了。

自己码

1 对接

参考:

在微信公众号开启接口自动回复功能,在基本配置-服务器配置指定地址和令牌。

服务器地址(URL) https://xxx.goho.co/

地址的端口要是80的,我们可以通过 花生壳内网映射外网的软件 来配置一个https,指定到本地机器启动的服务。

2 socks proxy:

3 pkg 打包nodejs程序

–END

记git Reset –hard

平时不是所有的改动都提交,也保留一些临时代码。今天在主干上提交了后,需要reset后退到前几天的版本,但是直接checkout是新建一个分支,如果reset sort还需要处理index,麻烦,就在eclipse中点击了reset hard,我勒个去,直接把 原来提交过的代码 改动没提交的 给还原了!!!

https://stackoverflow.com/questions/9529078/how-do-i-use-git-reset-hard-head-to-revert-to-a-previous-commit

First, it’s always worth noting that git reset –hard is a potentially dangerous command, since it throws away all your uncommitted changes. For safety, you should always check that the output of git status is clean (that is, empty) before using it.

–END

注册OpenAI

ChatGPT再一次火,自己也想尝试一下子。找到官网https://chat.openai.com但注册的时刻需要手机验证码,咱国内的手机号码是不行的。

搜索之后找到可以通过虚拟手机号来接收短信完成注册的方法:一文教你快速注册OpenAi(ChatGPT),国内也可以!

实操步骤如下:

注册登录sms并充值

1、 注册登录 https://sms-activate.org/# ,可直接使用国内邮箱。

2、 充值的时刻,先搜一下openai服务需要的金额。

然后选择又上角的余额下拉菜单的充值按钮,然后选择支付宝,充对应金额的钱(我这里是10卢布)。

支付成功后,要等一小会(反正我刷了几分钟,充值页面最下面可以看充值历史),本来是充10卢布的,到账10.55卢布。

3、 搜openai,在提供的列表中选择一个国家购买,就能得到一个对应国家的号码

一开始我是选马来西亚的,但是openai注册的时刻说这个号码被注册次数太多,后面换了印度的10.5(汇率多出的0.5还是蛮好的),就可以了。

邮箱注册openai

直接https://chat.openai.com/chat使用国内的邮箱注册,然后在填手机号码的页面选择sms中的国家和提供的号码,等几十秒就能在sms的页面看到6位数字的短信验证码

注意: 需要翻墙才能访问!!!

玩玩

hello world

–END

信创环境迁移浅析-以Postgres为例

国内服务器操作系统主要还是在Linux各个发行版上嫁接过来的,又做了各种小改动,本来在主流的操作系统上可以比较容易安装的应用迁移带来了各种困难,路径异常的艰辛。

首先,纯源码编译方式这种不在我的选择之中,网上也有很多参考。不重复了,同时这种方式不具有操作简单和可脚本话的潜质! 如: 银河麒麟v10 安装 postgis 主要还是寻求包管理yum/rpm的方式进行安装。 其次,寻找依赖版本时,以系统自带能适配最佳;再就是不改变系统核心前提下(gcc,glibc),使用rpmbuild重新编译依赖的src.rpm。

下面以kylin v10安装postgres9.6+postgis2.4为例进行说明。

第一步,了解系统

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[root@col ~]# cat /etc/os-release 
NAME="Kylin Linux Advanced Server"
VERSION="V10 (Tercel)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Tercel)"
ANSI_COLOR="0;31"

[root@col ~]# cat /etc/kylin-release 
Kylin Linux Advanced Server release V10 (Tercel)


[root@col ~]# uname -a 
Linux col 4.19.90-17.ky10.aarch64 #1 SMP Sun Jun 28 14:27:40 CST 2020 aarch64 aarch64 aarch64 GNU/Linux


[root@col ~]# tail -n10 /proc/cpuinfo  
processor       : 15
model name      : HUAWEI,Kunpeng 920
BogoMIPS        : 200.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm
CPU implementer : 0x48
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd01
CPU revision    : 0


[root@col ~]# yum list glibc
Last metadata expiration check: 1:03:03 ago on Sat 23 Jul 2022 07:54:01 PM CST.
Installed Packages
glibc.aarch64                                                                     2.28-36.1.ky10                                                                     @anaconda
[root@col ~]# yum list gcc
Last metadata expiration check: 1:04:34 ago on Sat 23 Jul 2022 07:54:01 PM CST.
Installed Packages
gcc.aarch64                                                                 7.3.0-20190804.h30.ky10                                                                  @anaconda
[root@col ~]# yum list cpp
Last metadata expiration check: 1:04:42 ago on Sat 23 Jul 2022 07:54:01 PM CST.
Installed Packages
cpp.aarch64                                                                 7.3.0-20190804.h30.ky10                                                                  @anaconda

第二步 安装一下应用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
[root@col ~]# vi /etc/yum.repos.d/pgdg-redhat-all.repo 
[pgdg-common]
name=PostgreSQL common RPMs for RHEL / Rocky 8 - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-8-$basearch
enabled=1
gpgcheck=0

[pgdg96]
name=PostgreSQL 9.6 for RHEL / Rocky 8 - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-8-$basearch
enabled=1
gpgcheck=0

[epel]
name=epel
baseurl=https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/
enabled=1
gpgcheck=0

[pgdg96-source]
name=PostgreSQL 9.6 for RHEL / Rocky 8 - $basearch - Source
baseurl=https://download.postgresql.org/pub/repos/yum/srpms/9.6/redhat/rhel-8-$basearch
enabled=0
gpgcheck=0

[pgdg96-debuginfo]
name=PostgreSQL 9.6 for RHEL / Rocky 8 - $basearch - Debuginfo
baseurl=https://download.postgresql.org/pub/repos/yum/debug/9.6/redhat/rhel-8-$basearch
enabled=0
gpgcheck=0


[root@col ~]# yum install postgresql96 postgresql96-server postgis24_96
PostgreSQL common RPMs for RHEL / Rocky 8 - aarch64                                                                                           122 kB/s | 406 kB     00:03    
PostgreSQL 9.6 for RHEL / Rocky 8 - aarch64                                                                                                    19 kB/s | 276 kB     00:14    
epel                                                                                                                                           13 kB/s |  12 MB     16:11    
Error: 
 Problem: package postgis24_96-2.4.9-3.rhel8.aarch64 requires libgdal.so.28()(64bit), but none of the providers can be installed
  - package postgis24_96-2.4.9-3.rhel8.aarch64 requires gdal32-libs >= 3.2.0, but none of the providers can be installed
  - package gdal32-libs-3.2.2-12.rhel8.aarch64 requires libhdf5.so.103()(64bit), but none of the providers can be installed
  - package gdal32-libs-3.2.2-13.rhel8.aarch64 requires libhdf5.so.103()(64bit), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides libgfortran.so.5()(64bit) needed by hdf5-1.10.5-4.el8.aarch64
  - nothing provides libgfortran.so.5(GFORTRAN_8)(64bit) needed by hdf5-1.10.5-4.el8.aarch64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

如果按centos8的包管理hdf5-1.10.5-4.el8.aarch64,可以看出 libgfortran.so.5(GFORTRAN_8)(64bit) 依赖最终就依赖到 gcc-8.5.0 。gcc升级会比较复杂。

参照 Linux SRPM源码包安装 rpmrebuild 提取spec重新打包的方式,使用rpmbuild在当前系统上重新编译打包。

1
[root@col ~]# yum install rpmrebuild -y 

hdf5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[root@col ~]# rpmbuild --rebuild hdf5-1.10.5-4.el8.src.rpm 
Installing hdf5-1.10.5-4.el8.src.rpm
warning: hdf5-1.10.5-4.el8.src.rpm: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
error: Failed build dependencies:
        hamcrest is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        java-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        javapackages-tools is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        junit is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        krb5-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        libaec-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        mpich-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        openmpi-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        openssl-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
        slf4j is needed by hdf5-1.10.5-4.ky10.ky10.aarch64

查找 https://pkgs.org/search/?q=hamcrest 并下载java相关的模块centos8依赖:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
[root@col ~]# ll *.rpm
-rw------- 1 root root  305031 Jul 23 22:12 cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  147131 Jul 23 22:11 easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  131075 Jul 23 22:08 hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   60043 Jul 23 22:08 hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw-r--r-- 1 root root 8739906 Jul 22 14:57 hdf5-1.10.5-4.el8.src.rpm
-rw------- 1 root root  307067 Jul 23 22:08 junit-4.12-9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  457315 Jul 23 22:12 objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  108627 Jul 23 22:12 objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  305655 Jul 23 22:12 qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   78511 Jul 23 22:08 slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch.rpm

[root@col ~]# yum install ./hamcrest-* ./junit-* ./slf4j-* ./easymock-* ./qdox-* ./cglib-* ./objectweb-asm-* ./objenesis-*
Last metadata expiration check: 0:48:28 ago on Sat 23 Jul 2022 09:25:01 PM CST.
Dependencies resolved.
==============================================================================================================================================================================
 Package                                         Architecture                Version                                                   Repository                        Size
==============================================================================================================================================================================
Installing:
 hamcrest                                        noarch                      1.3-23.module_el8.0.0+30+832da3a1                         @commandline                     128 k
 hamcrest-core                                   noarch                      1.3-23.module_el8.0.0+30+832da3a1                         @commandline                      59 k
 junit                                           noarch                      1:4.12-9.module_el8.0.0+30+832da3a1                       @commandline                     300 k
 slf4j                                           noarch                      1.7.25-4.module_el8.0.0+39+6a9b6e22                       @commandline                      77 k
 easymock                                        noarch                      3.5-4.module_el8.0.0+30+832da3a1                          @commandline                     144 k
 qdox                                            noarch                      2.0-3.M9.module_el8.0.0+30+832da3a1                       @commandline                     298 k
 cglib                                           noarch                      3.2.4-7.module_el8.0.0+30+832da3a1                        @commandline                     298 k
 objectweb-asm                                   noarch                      6.2-5.module_el8.0.0+30+832da3a1                          @commandline                     447 k
 objenesis                                       noarch                      2.6-2.module_el8.0.0+30+832da3a1                          @commandline                     106 k
Installing dependencies:
 copy-jdk-configs                                noarch                      3.7-3.ky10                                                ks10-adv-os                       23 k
 java-1.8.0-openjdk-headless                     aarch64                     1:1.8.0.242.b08-1.h5.ky10                                 ks10-adv-os                       32 M
 javapackages-filesystem                         noarch                      5.3.0-2.ky10                                              ks10-adv-os                      9.8 k
 javapackages-tools                              noarch                      5.3.0-2.ky10                                              ks10-adv-os                       30 k

Transaction Summary
==============================================================================================================================================================================
Install  13 Packages

Total size: 34 M
Total download size: 32 M
Installed size: 111 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): javapackages-filesystem-5.3.0-2.ky10.noarch.rpm                                                                                         36 kB/s | 9.8 kB     00:00    
(2/4): copy-jdk-configs-3.7-3.ky10.noarch.rpm                                                                                                  72 kB/s |  23 kB     00:00    
(3/4): javapackages-tools-5.3.0-2.ky10.noarch.rpm                                                                                             641 kB/s |  30 kB     00:00    
(4/4): java-1.8.0-openjdk-headless-1.8.0.242.b08-1.h5.ky10.aarch64.rpm                                                                        259 kB/s |  32 MB     02:07    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                         260 kB/s |  32 MB     02:07     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: copy-jdk-configs-3.7-3.ky10.noarch                                                                                                                   1/1 
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                        1/1 
  Preparing        :                                                                                                                                                      1/1 
  Installing       : javapackages-filesystem-5.3.0-2.ky10.noarch                                                                                                         1/13 
  Installing       : copy-jdk-configs-3.7-3.ky10.noarch                                                                                                                  2/13 
  Installing       : java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                       3/13 
  Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                       3/13 
  Installing       : hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch                                                                                              4/13 
  Installing       : javapackages-tools-5.3.0-2.ky10.noarch                                                                                                              5/13 
  Installing       : objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch                                                                                               6/13 
  Installing       : cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch                                                                                                     7/13 
  Installing       : qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch                                                                                                     8/13 
  Installing       : objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch                                                                                                   9/13 
  Installing       : easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch                                                                                                   10/13 
  Installing       : hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch                                                                                                  11/13 
  Installing       : junit-1:4.12-9.module_el8.0.0+30+832da3a1.noarch                                                                                                   12/13 
  Installing       : slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch                                                                                                   13/13 
  Running scriptlet: copy-jdk-configs-3.7-3.ky10.noarch                                                                                                                 13/13 
  Running scriptlet: slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch                                                                                                   13/13 
  Verifying        : copy-jdk-configs-3.7-3.ky10.noarch                                                                                                                  1/13 
  Verifying        : java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                       2/13 
  Verifying        : javapackages-filesystem-5.3.0-2.ky10.noarch                                                                                                         3/13 
  Verifying        : javapackages-tools-5.3.0-2.ky10.noarch                                                                                                              4/13 
  Verifying        : hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch                                                                                                   5/13 
  Verifying        : hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch                                                                                              6/13 
  Verifying        : junit-1:4.12-9.module_el8.0.0+30+832da3a1.noarch                                                                                                    7/13 
  Verifying        : slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch                                                                                                    8/13 
  Verifying        : easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch                                                                                                    9/13 
  Verifying        : qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch                                                                                                    10/13 
  Verifying        : cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch                                                                                                    11/13 
  Verifying        : objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch                                                                                              12/13 
  Verifying        : objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch                                                                                                  13/13 

Installed:
  hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch    hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch           junit-1:4.12-9.module_el8.0.0+30+832da3a1.noarch    
  slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch     easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch                 qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch     
  cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch      objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch            objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch   
  copy-jdk-configs-3.7-3.ky10.noarch                   java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.ky10.aarch64    javapackages-filesystem-5.3.0-2.ky10.noarch         
  javapackages-tools-5.3.0-2.ky10.noarch              

Complete!
[root@col ~]# 

[root@col ~]# yum install java-devel javapackages-tools krb5-devel libaec-devel mpich-devel openssl-devel
Last metadata expiration check: 0:54:34 ago on Sat 23 Jul 2022 09:25:01 PM CST.
Package javapackages-tools-5.3.0-2.ky10.noarch is already installed.
Dependencies resolved.
==============================================================================================================================================================================
 Package                                          Architecture                    Version                                           Repository                           Size
==============================================================================================================================================================================
Installing:
 java-1.8.0-openjdk-devel                         aarch64                         1:1.8.0.242.b08-1.h5.ky10                         ks10-adv-os                         7.8 M
 krb5-devel                                       aarch64                         1.17-9.ky10                                       ks10-adv-os                         160 k
 libaec-devel                                     aarch64                         1.0.4-1.ky10                                      ks10-adv-os                         9.9 k
 mpich-devel                                      aarch64                         3.2.1-10.ky10                                     ks10-adv-os                         121 k
 openssl-devel                                    aarch64                         1:1.1.1d-9.ky10                                   ks10-adv-os                         1.7 M
Installing dependencies:
 e2fsprogs-devel                                  aarch64                         1.45.3-4.p01.ky10                                 ks10-adv-os                         287 k
 hwloc                                            aarch64                         1.11.9-3.ky10                                     ks10-adv-os                         1.7 M
 java-1.8.0-openjdk                               aarch64                         1:1.8.0.242.b08-1.h5.ky10                         ks10-adv-os                         382 k
 keyutils-libs-devel                              aarch64                         1.5.10-11.ky10                                    ks10-adv-os                         9.8 k
 libaec                                           aarch64                         1.0.4-1.ky10                                      ks10-adv-os                          34 k
 libverto-devel                                   aarch64                         0.3.1-2.ky10                                      ks10-adv-os                          16 k
 lua-filesystem                                   aarch64                         1.6.3-10.ky10                                     ks10-adv-os                          17 k
 mpich                                            aarch64                         3.2.1-10.ky10                                     ks10-adv-os                         1.0 M
 Lmod                                             aarch64                         8.7.7-1.el8                                       epel                                261 k
 lua-term                                         aarch64                         0.07-9.el8                                        epel                                 16 k

Transaction Summary
==============================================================================================================================================================================
Install  15 Packages

Total download size: 13 M
Installed size: 60 M
Is this ok [y/N]: y
Downloading Packages:
(1/15): e2fsprogs-devel-1.45.3-4.p01.ky10.aarch64.rpm                                                                                          46 kB/s | 287 kB     00:06    
(2/15): java-1.8.0-openjdk-1.8.0.242.b08-1.h5.ky10.aarch64.rpm                                                                                 60 kB/s | 382 kB     00:06    
(3/15): keyutils-libs-devel-1.5.10-11.ky10.aarch64.rpm                                                                                        454 kB/s | 9.8 kB     00:00    
(4/15): krb5-devel-1.17-9.ky10.aarch64.rpm                                                                                                    7.4 MB/s | 160 kB     00:00    
(5/15): libaec-1.0.4-1.ky10.aarch64.rpm                                                                                                       1.9 MB/s |  34 kB     00:00    
(6/15): libaec-devel-1.0.4-1.ky10.aarch64.rpm                                                                                                 619 kB/s | 9.9 kB     00:00    
(7/15): libverto-devel-0.3.1-2.ky10.aarch64.rpm                                                                                               1.1 MB/s |  16 kB     00:00    
(8/15): lua-filesystem-1.6.3-10.ky10.aarch64.rpm                                                                                              1.1 MB/s |  17 kB     00:00    
(9/15): mpich-3.2.1-10.ky10.aarch64.rpm                                                                                                       491 kB/s | 1.0 MB     00:02    
(10/15): mpich-devel-3.2.1-10.ky10.aarch64.rpm                                                                                                3.4 MB/s | 121 kB     00:00    
(11/15): hwloc-1.11.9-3.ky10.aarch64.rpm                                                                                                      161 kB/s | 1.7 MB     00:10    
(12/15): openssl-devel-1.1.1d-9.ky10.aarch64.rpm                                                                                              376 kB/s | 1.7 MB     00:04    
(13/15): lua-term-0.07-9.el8.aarch64.rpm                                                                                                       15 kB/s |  16 kB     00:01    
(14/15): java-1.8.0-openjdk-devel-1.8.0.242.b08-1.h5.ky10.aarch64.rpm                                                                         274 kB/s | 7.8 MB     00:28    
(15/15): Lmod-8.7.7-1.el8.aarch64.rpm                                                                                                         9.0 kB/s | 261 kB     00:29    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                         346 kB/s |  13 MB     00:39     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                      1/1 
  Installing       : lua-term-0.07-9.el8.aarch64                                                                                                                         1/15 
  Installing       : lua-filesystem-1.6.3-10.ky10.aarch64                                                                                                                2/15 
  Installing       : Lmod-8.7.7-1.el8.aarch64                                                                                                                            3/15 
  Running scriptlet: Lmod-8.7.7-1.el8.aarch64                                                                                                                            3/15 
  Installing       : libverto-devel-0.3.1-2.ky10.aarch64                                                                                                                 4/15 
  Installing       : libaec-1.0.4-1.ky10.aarch64                                                                                                                         5/15 
  Installing       : keyutils-libs-devel-1.5.10-11.ky10.aarch64                                                                                                          6/15 
  Installing       : java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                                7/15 
  Running scriptlet: java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                                7/15 
  Installing       : hwloc-1.11.9-3.ky10.aarch64                                                                                                                         8/15 
  Installing       : mpich-3.2.1-10.ky10.aarch64                                                                                                                         9/15 
  Running scriptlet: mpich-3.2.1-10.ky10.aarch64                                                                                                                         9/15 
  Installing       : e2fsprogs-devel-1.45.3-4.p01.ky10.aarch64                                                                                                          10/15 
  Running scriptlet: e2fsprogs-devel-1.45.3-4.p01.ky10.aarch64                                                                                                          10/15 
  Installing       : krb5-devel-1.17-9.ky10.aarch64                                                                                                                     11/15 
  Installing       : openssl-devel-1:1.1.1d-9.ky10.aarch64                                                                                                              12/15 
  Installing       : mpich-devel-3.2.1-10.ky10.aarch64                                                                                                                  13/15 
  Installing       : java-1.8.0-openjdk-devel-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                         14/15 
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                         14/15 
  Installing       : libaec-devel-1.0.4-1.ky10.aarch64                                                                                                                  15/15 
  Running scriptlet: java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                               15/15 
  Running scriptlet: java-1.8.0-openjdk-devel-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                         15/15 
  Running scriptlet: libaec-devel-1.0.4-1.ky10.aarch64                                                                                                                  15/15 
  Verifying        : e2fsprogs-devel-1.45.3-4.p01.ky10.aarch64                                                                                                           1/15 
  Verifying        : hwloc-1.11.9-3.ky10.aarch64                                                                                                                         2/15 
  Verifying        : java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                                3/15 
  Verifying        : java-1.8.0-openjdk-devel-1:1.8.0.242.b08-1.h5.ky10.aarch64                                                                                          4/15 
  Verifying        : keyutils-libs-devel-1.5.10-11.ky10.aarch64                                                                                                          5/15 
  Verifying        : krb5-devel-1.17-9.ky10.aarch64                                                                                                                      6/15 
  Verifying        : libaec-1.0.4-1.ky10.aarch64                                                                                                                         7/15 
  Verifying        : libaec-devel-1.0.4-1.ky10.aarch64                                                                                                                   8/15 
  Verifying        : libverto-devel-0.3.1-2.ky10.aarch64                                                                                                                 9/15 
  Verifying        : lua-filesystem-1.6.3-10.ky10.aarch64                                                                                                               10/15 
  Verifying        : mpich-3.2.1-10.ky10.aarch64                                                                                                                        11/15 
  Verifying        : mpich-devel-3.2.1-10.ky10.aarch64                                                                                                                  12/15 
  Verifying        : openssl-devel-1:1.1.1d-9.ky10.aarch64                                                                                                              13/15 
  Verifying        : Lmod-8.7.7-1.el8.aarch64                                                                                                                           14/15 
  Verifying        : lua-term-0.07-9.el8.aarch64                                                                                                                        15/15 

Installed:
  java-1.8.0-openjdk-devel-1:1.8.0.242.b08-1.h5.ky10.aarch64       krb5-devel-1.17-9.ky10.aarch64                             libaec-devel-1.0.4-1.ky10.aarch64               
  mpich-devel-3.2.1-10.ky10.aarch64                                openssl-devel-1:1.1.1d-9.ky10.aarch64                      e2fsprogs-devel-1.45.3-4.p01.ky10.aarch64       
  hwloc-1.11.9-3.ky10.aarch64                                      java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.ky10.aarch64       keyutils-libs-devel-1.5.10-11.ky10.aarch64      
  libaec-1.0.4-1.ky10.aarch64                                      libverto-devel-0.3.1-2.ky10.aarch64                        lua-filesystem-1.6.3-10.ky10.aarch64            
  mpich-3.2.1-10.ky10.aarch64                                      Lmod-8.7.7-1.el8.aarch64                                   lua-term-0.07-9.el8.aarch64                     

Complete!
[root@col ~]# 

[root@col ~]# rpmbuild --rebuild hdf5-1.10.5-4.el8.src.rpm 
Installing hdf5-1.10.5-4.el8.src.rpm
warning: hdf5-1.10.5-4.el8.src.rpm: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
error: Failed build dependencies:
        openmpi-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64

再编译openmpi

源码查找后选择centos8的版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[root@col ~]# rpmbuild --rebuild openmpi-4.1.1-2.el8.src.rpm 
Installing openmpi-4.1.1-2.el8.src.rpm
warning: openmpi-4.1.1-2.el8.src.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
error: Failed build dependencies:
        hwloc-devel >= 2.2.0 is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        libevent-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        libfabric-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        opensm-devel > 3.3.0 is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        papi-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        pmix-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        rdma-core-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        rpm-mpi-hooks is needed by openmpi-4.1.1-2.ky10.ky10.aarch64
        ucx-devel is needed by openmpi-4.1.1-2.ky10.ky10.aarch64

下载依赖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
[root@col ~]# ll *.rpm
-rw------- 1 root root  305031 Jul 23 22:12 cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  147131 Jul 23 22:11 easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  131075 Jul 23 22:08 hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   60043 Jul 23 22:08 hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw-r--r-- 1 root root 8739906 Jul 22 14:57 hdf5-1.10.5-4.el8.src.rpm
-rw------- 1 root root  254060 Jul 23 22:32 hwloc-devel-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root   67048 Jul 23 22:32 hwloc-gui-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root 2085332 Jul 23 22:32 hwloc-libs-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root  307067 Jul 23 22:08 junit-4.12-9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  457315 Jul 23 22:12 objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  108627 Jul 23 22:12 objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root 9846455 Jul 23 22:26 openmpi-4.1.1-2.el8.src.rpm
-rw------- 1 root root  685564 Jul 24 06:23 pmix-2.2.4rc1-1.el8.aarch64.rpm
-rw------- 1 root root   60776 Jul 24 06:23 pmix-devel-2.2.4rc1-1.el8.aarch64.rpm
-rw------- 1 root root  305655 Jul 23 22:12 qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   13320 Jul 23 22:27 rpm-mpi-hooks-8-2.el8.noarch.rpm
-rw------- 1 root root   78511 Jul 23 22:08 slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch.rpm
-rw------- 1 root root  541892 Jul 23 22:27 ucx-1.10.1-2.el8.aarch64.rpm
-rw------- 1 root root  162896 Jul 23 22:27 ucx-devel-1.10.1-2.el8.aarch64.rpm

[root@col ~]# yum install ./rpm-mpi-hooks-8-2.el8.noarch.rpm ./ucx-* 
Last metadata expiration check: 1:03:14 ago on Sat 23 Jul 2022 09:25:01 PM CST.
Dependencies resolved.
==============================================================================================================================================================================
 Package                                    Architecture                         Version                                      Repository                                 Size
==============================================================================================================================================================================
Installing:
 rpm-mpi-hooks                              noarch                               8-2.el8                                      @commandline                               13 k
 ucx                                        aarch64                              1.10.1-2.el8                                 @commandline                              529 k
 ucx-devel                                  aarch64                              1.10.1-2.el8                                 @commandline                              159 k

Transaction Summary
==============================================================================================================================================================================
Install  3 Packages

Total size: 701 k
Installed size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                      1/1 
  Installing       : ucx-1.10.1-2.el8.aarch64                                                                                                                             1/3 
  Running scriptlet: ucx-1.10.1-2.el8.aarch64                                                                                                                             1/3 
  Installing       : ucx-devel-1.10.1-2.el8.aarch64                                                                                                                       2/3 
  Installing       : rpm-mpi-hooks-8-2.el8.noarch                                                                                                                         3/3 
  Running scriptlet: rpm-mpi-hooks-8-2.el8.noarch                                                                                                                         3/3 
  Verifying        : rpm-mpi-hooks-8-2.el8.noarch                                                                                                                         1/3 
  Verifying        : ucx-1.10.1-2.el8.aarch64                                                                                                                             2/3 
  Verifying        : ucx-devel-1.10.1-2.el8.aarch64                                                                                                                       3/3 

Installed:
  rpm-mpi-hooks-8-2.el8.noarch                              ucx-1.10.1-2.el8.aarch64                              ucx-devel-1.10.1-2.el8.aarch64                             

Complete!

[root@col ~]# yum remove hwloc
Dependencies resolved.
=============================================================================================================================================================================
 Package                                  Architecture                         Version                                       Repository                                 Size
=============================================================================================================================================================================
Removing:
 hwloc                                    aarch64                              1.11.9-3.ky10                                 @ks10-adv-os                              3.2 M
Removing dependent packages:
 hwloc-devel                              aarch64                              1.11.9-3.ky10                                 @ks10-adv-os                              405 k
 pmix-devel                               aarch64                              3.1.4-2.oe1                                   @ks10-adv-os                              295 k
Removing unused dependencies:
 munge                                    aarch64                              0.5.13-3.oe1                                  @ks10-adv-os                              442 k
 pmix                                     aarch64                              3.1.4-2.oe1                                   @ks10-adv-os                              2.7 M

Transaction Summary
=============================================================================================================================================================================
Remove  5 Packages

Freed space: 7.0 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1 
  Erasing          : pmix-devel-3.1.4-2.oe1.aarch64                                                                                                                      1/5 
  Running scriptlet: pmix-devel-3.1.4-2.oe1.aarch64                                                                                                                      1/5 
  Erasing          : hwloc-devel-1.11.9-3.ky10.aarch64                                                                                                                   2/5 
  Erasing          : pmix-3.1.4-2.oe1.aarch64                                                                                                                            3/5 
  Running scriptlet: pmix-3.1.4-2.oe1.aarch64                                                                                                                            3/5 
  Erasing          : hwloc-1.11.9-3.ky10.aarch64                                                                                                                         4/5 
  Running scriptlet: munge-0.5.13-3.oe1.aarch64                                                                                                                          5/5 
  Erasing          : munge-0.5.13-3.oe1.aarch64                                                                                                                          5/5 
  Running scriptlet: munge-0.5.13-3.oe1.aarch64                                                                                                                          5/5 
  Verifying        : hwloc-1.11.9-3.ky10.aarch64                                                                                                                         1/5 
  Verifying        : hwloc-devel-1.11.9-3.ky10.aarch64                                                                                                                   2/5 
  Verifying        : munge-0.5.13-3.oe1.aarch64                                                                                                                          3/5 
  Verifying        : pmix-3.1.4-2.oe1.aarch64                                                                                                                            4/5 
  Verifying        : pmix-devel-3.1.4-2.oe1.aarch64                                                                                                                      5/5 

Removed:
  hwloc-1.11.9-3.ky10.aarch64      hwloc-devel-1.11.9-3.ky10.aarch64      pmix-devel-3.1.4-2.oe1.aarch64      munge-0.5.13-3.oe1.aarch64      pmix-3.1.4-2.oe1.aarch64     

Complete!
[root@col ~]# 


[root@col ~]# yum install libevent-devel libfabric-devel papi-devel rdma-core-devel opensm-devel ./hwloc-libs-2.2.0-3.el8.aarch64.rpm ./hwloc-devel-2.2.0-3.el8.aarch64.rpm ./hwloc-gui-2.2.0-3.el8.aarch64.rpm ./pmix-2.2.4rc1-1.el8.aarch64.rpm ./pmix-devel-2.2.4rc1-1.el8.aarch64.rpm            

[root@col ~]# rpmbuild --rebuild openmpi-4.1.1-2.el8.src.rpm 

[root@col ~]# yum install ~/rpmbuild/RPMS/aarch64/openmpi-4.1.1-2.ky10.ky10.aarch64.rpm ~/rpmbuild/RPMS/aarch64/openmpi-devel-4.1.1-2.ky10.ky10.aarch64.rpm 

mpich

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
[root@col ~]# rpmbuild --rebuild hdf5-1.10.5-4.el8.src.rpm   
Installing hdf5-1.10.5-4.el8.src.rpm
warning: hdf5-1.10.5-4.el8.src.rpm: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
error: Failed build dependencies:
        mpich-devel is needed by hdf5-1.10.5-4.ky10.ky10.aarch64
      
[root@col ~]# yum install mpich-devel mpich 
Last metadata expiration check: 1:55:24 ago on Sun 24 Jul 2022 04:56:06 AM CST.
Error: 
 Problem 1: package hwloc-1.11.9-3.ky10.aarch64 obsoletes hwloc-libs provided by hwloc-libs-2.2.0-3.el8.aarch64
  - package mpich-3.2.1-10.ky10.aarch64 requires libhwloc.so.5()(64bit), but none of the providers can be installed
  - package openmpi-4.1.1-2.ky10.ky10.aarch64 requires libhwloc.so.15()(64bit), but none of the providers can be installed
  - conflicting requests
  - problem with installed package openmpi-4.1.1-2.ky10.ky10.aarch64
 Problem 2: package mpich-3.2.1-10.ky10.aarch64 requires libhwloc.so.5()(64bit), but none of the providers can be installed
  - package hwloc-1.11.9-3.ky10.aarch64 obsoletes hwloc-libs provided by hwloc-libs-2.2.0-3.el8.aarch64
  - package mpich-devel-3.2.1-10.ky10.aarch64 requires mpich = 3.2.1-10.ky10, but none of the providers can be installed
  - package openmpi-devel-4.1.1-2.ky10.ky10.aarch64 requires libhwloc.so.15()(64bit), but none of the providers can be installed
  - conflicting requests
  - problem with installed package openmpi-devel-4.1.1-2.ky10.ky10.aarch64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)


[root@col ~]# ll *.rpm
-rw------- 1 root root   305031 Jul 23 22:12 cglib-3.2.4-7.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   147131 Jul 23 22:11 easymock-3.5-4.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   131075 Jul 23 22:08 hamcrest-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root    60043 Jul 23 22:08 hamcrest-core-1.3-23.module_el8.0.0+30+832da3a1.noarch.rpm
-rw-r--r-- 1 root root  8739906 Jul 22 14:57 hdf5-1.10.5-4.el8.src.rpm
-rw------- 1 root root   254060 Jul 23 22:32 hwloc-devel-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root    67048 Jul 23 22:32 hwloc-gui-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root  2085332 Jul 23 22:32 hwloc-libs-2.2.0-3.el8.aarch64.rpm
-rw------- 1 root root   307067 Jul 23 22:08 junit-4.12-9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root 30515938 Jul 24 06:55 mpich-3.4.1-1.el8.src.rpm
-rw------- 1 root root   457315 Jul 23 22:12 objectweb-asm-6.2-5.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root   108627 Jul 23 22:12 objenesis-2.6-2.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root  9846455 Jul 23 22:26 openmpi-4.1.1-2.el8.src.rpm
-rw------- 1 root root   685564 Jul 24 06:23 pmix-2.2.4rc1-1.el8.aarch64.rpm
-rw------- 1 root root    60776 Jul 24 06:23 pmix-devel-2.2.4rc1-1.el8.aarch64.rpm
-rw------- 1 root root   305655 Jul 23 22:12 qdox-2.0-3.M9.module_el8.0.0+30+832da3a1.noarch.rpm
-rw------- 1 root root    13320 Jul 23 22:27 rpm-mpi-hooks-8-2.el8.noarch.rpm
-rw------- 1 root root    78511 Jul 23 22:08 slf4j-1.7.25-4.module_el8.0.0+39+6a9b6e22.noarch.rpm
-rw------- 1 root root   541892 Jul 23 22:27 ucx-1.10.1-2.el8.aarch64.rpm
-rw------- 1 root root   162896 Jul 23 22:27 ucx-devel-1.10.1-2.el8.aarch64.rpm


[root@col ~]# rpmbuild --rebuild --nocheck mpich-3.4.1-1.el8.src.rpm                                                                                    

[root@col ~]# rpm -ivh --force ~/rpmbuild/RPMS/aarch64/mpich-3.4.1-1.ky10.ky10.aarch64.rpm ~/rpmbuild/RPMS/aarch64/mpich-devel-3.4.1-1.ky10.ky10.aarch64.rpm           
error: Failed dependencies:
        redhat-rpm-config is needed by mpich-devel-3.4.1-1.ky10.ky10.aarch64
[root@col ~]# rpm -ivh --force --nodeps ~/rpmbuild/RPMS/aarch64/mpich-3.4.1-1.ky10.ky10.aarch64.rpm ~/rpmbuild/RPMS/aarch64/mpich-devel-3.4.1-1.ky10.ky10.aarch64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:mpich-3.4.1-1.ky10.ky10          ################################# [ 50%]
   2:mpich-devel-3.4.1-1.ky10.ky10    ################################# [100%]

这次终于可以编译hdf5了,时间会相对长一点,慢慢等。

1
2
3
[root@col ~]# rpmbuild --rebuild hdf5-1.10.5-4.el8.src.rpm

[root@col ~]# yum install ~/rpmbuild/RPMS/aarch64/hdf5-1.10.5-4.ky10.ky10.aarch64.rpm ~/rpmbuild/RPMS/aarch64/hdf5-devel-1.10.5-4.ky10.ky10.aarch64.rpm 

armadillo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@col ~]# yum install postgresql96 postgresql96-server postgis24_96                                  
Last metadata expiration check: 0:46:44 ago on Sun 24 Jul 2022 07:56:56 AM CST.
Error: 
 Problem: package postgis24_96-2.4.9-3.rhel8.aarch64 requires libgdal.so.28()(64bit), but none of the providers can be installed
  - package postgis24_96-2.4.9-3.rhel8.aarch64 requires gdal32-libs >= 3.2.0, but none of the providers can be installed
  - package gdal32-libs-3.2.2-12.rhel8.aarch64 requires libhdf5.so.103()(64bit), but none of the providers can be installed
  - package gdal32-libs-3.2.2-13.rhel8.aarch64 requires libhdf5.so.103()(64bit), but none of the providers can be installed
  - cannot install both hdf5-1.8.20-7.ky10.aarch64 and hdf5-1.10.5-4.ky10.ky10.aarch64
  - package armadillo-9.600.6-3.oe1.aarch64 requires libhdf5.so.10()(64bit), but none of the providers can be installed
  - package gdal32-libs-3.2.2-12.rhel8.aarch64 requires libarmadillo.so.9()(64bit), but none of the providers can be installed
  - package gdal32-libs-3.2.2-13.rhel8.aarch64 requires libarmadillo.so.9()(64bit), but none of the providers can be installed
  - cannot install the best candidate for the job
  - nothing provides libgfortran.so.5()(64bit) needed by hdf5-1.10.5-4.el8.aarch64
  - nothing provides libgfortran.so.5(GFORTRAN_8)(64bit) needed by hdf5-1.10.5-4.el8.aarch64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

[root@col ~]# yum list armadillo --showduplicates
Last metadata expiration check: 0:47:59 ago on Sun 24 Jul 2022 07:56:56 AM CST.
Available Packages
armadillo.aarch64                                                                  9.600.6-3.oe1                                                                  ks10-adv-os
armadillo.aarch64                                                                  10.8.2-1.el8                                                                   epel       

gdal32-libs 依赖的是 libarmadillo.so.9 ,直接找openEuler的版本armadillo-9.600.6-4.oe1.src.rpm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
[root@col ~]# rpmbuild --rebuild armadillo-9.600.6-4.oe1.src.rpm 
Installing armadillo-9.600.6-4.oe1.src.rpm
warning: armadillo-9.600.6-4.oe1.src.rpm: Header V3 RSA/SHA1 Signature, key ID b25e7f66: NOKEY
error: bad date in %changelog: Fri 26 Mar 2021 sunguoshuai <sunguoshuai@huawei.com> - 9.600.6-4
error: Failed build dependencies:
        SuperLU-devel is needed by armadillo-9.600.6-4.ky10.aarch64
        arpack-devel is needed by armadillo-9.600.6-4.ky10.aarch64
        lapack-devel is needed by armadillo-9.600.6-4.ky10.aarch64
        openblas-devel is needed by armadillo-9.600.6-4.ky10.aarch64

[root@col ~]# yum install SuperLU-devel arpack-devel-3.5.0
Last metadata expiration check: 0:55:00 ago on Sun 24 Jul 2022 07:56:56 AM CST.
Dependencies resolved.
=============================================================================================================================================================================
 Package                                     Architecture                         Version                                     Repository                                Size
=============================================================================================================================================================================
Installing:
 SuperLU-devel                               aarch64                              5.2.1-6.oe1                                 ks10-adv-os                               22 k
 arpack-devel                                aarch64                              3.5.0-7.oe1                                 ks10-adv-os                              8.2 k
Installing dependencies:
 SuperLU                                     aarch64                              5.2.1-6.oe1                                 ks10-adv-os                              139 k
 arpack                                      aarch64                              3.5.0-7.oe1                                 ks10-adv-os                              141 k
 openblas                                    aarch64                              0.3.3-3.ky10                                ks10-adv-os                               46 M
 openblas-devel                              aarch64                              0.3.3-3.ky10                                ks10-adv-os                               83 k

Transaction Summary
=============================================================================================================================================================================
Install  6 Packages

Total download size: 47 M
Installed size: 286 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): SuperLU-devel-5.2.1-6.oe1.aarch64.rpm                                                                                                 3.5 kB/s |  22 kB     00:06    
(2/6): arpack-3.5.0-7.oe1.aarch64.rpm                                                                                                         11 kB/s | 141 kB     00:12    
(3/6): SuperLU-5.2.1-6.oe1.aarch64.rpm                                                                                                        11 kB/s | 139 kB     00:12    
(4/6): arpack-devel-3.5.0-7.oe1.aarch64.rpm                                                                                                  1.4 kB/s | 8.2 kB     00:06    
(5/6): openblas-devel-0.3.3-3.ky10.aarch64.rpm                                                                                               2.6 MB/s |  83 kB     00:00    
(6/6): openblas-0.3.3-3.ky10.aarch64.rpm                                                                                                     258 kB/s |  46 MB     03:03    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                        244 kB/s |  47 MB     03:15     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1 
  Installing       : openblas-devel-0.3.3-3.ky10.aarch64                                                                                                                 1/6 
  Installing       : openblas-0.3.3-3.ky10.aarch64                                                                                                                       2/6 
  Running scriptlet: openblas-0.3.3-3.ky10.aarch64                                                                                                                       2/6 
  Installing       : SuperLU-5.2.1-6.oe1.aarch64                                                                                                                         3/6 
  Running scriptlet: SuperLU-5.2.1-6.oe1.aarch64                                                                                                                         3/6 
  Installing       : arpack-3.5.0-7.oe1.aarch64                                                                                                                          4/6 
  Running scriptlet: arpack-3.5.0-7.oe1.aarch64                                                                                                                          4/6 
  Installing       : arpack-devel-3.5.0-7.oe1.aarch64                                                                                                                    5/6 
  Installing       : SuperLU-devel-5.2.1-6.oe1.aarch64                                                                                                                   6/6 
  Running scriptlet: SuperLU-devel-5.2.1-6.oe1.aarch64                                                                                                                   6/6 
  Verifying        : SuperLU-5.2.1-6.oe1.aarch64                                                                                                                         1/6 
  Verifying        : SuperLU-devel-5.2.1-6.oe1.aarch64                                                                                                                   2/6 
  Verifying        : arpack-3.5.0-7.oe1.aarch64                                                                                                                          3/6 
  Verifying        : arpack-devel-3.5.0-7.oe1.aarch64                                                                                                                    4/6 
  Verifying        : openblas-0.3.3-3.ky10.aarch64                                                                                                                       5/6 
  Verifying        : openblas-devel-0.3.3-3.ky10.aarch64                                                                                                                 6/6 

Installed:
  SuperLU-devel-5.2.1-6.oe1.aarch64      arpack-devel-3.5.0-7.oe1.aarch64    SuperLU-5.2.1-6.oe1.aarch64    arpack-3.5.0-7.oe1.aarch64    openblas-0.3.3-3.ky10.aarch64   
  openblas-devel-0.3.3-3.ky10.aarch64   

Complete!
[root@col ~]# 

[root@col ~]# yum install lapack-devel 
Last metadata expiration check: 0:59:07 ago on Sun 24 Jul 2022 07:56:56 AM CST.
Dependencies resolved.
=============================================================================================================================================================================
 Package                                   Architecture                         Version                                       Repository                                Size
=============================================================================================================================================================================
Installing:
 lapack-devel                              aarch64                              3.8.0-16.ky10                                 ks10-adv-os                              4.7 M
Installing dependencies:
 lapack                                    aarch64                              3.8.0-16.ky10                                 ks10-adv-os                              4.5 M

Transaction Summary
=============================================================================================================================================================================
Install  2 Packages

Total download size: 9.2 M
Installed size: 47 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): lapack-3.8.0-16.ky10.aarch64.rpm                                                                                                      176 kB/s | 4.5 MB     00:26    
(2/2): lapack-devel-3.8.0-16.ky10.aarch64.rpm                                                                                                184 kB/s | 4.7 MB     00:26    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                        360 kB/s | 9.2 MB     00:26     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1 
  Installing       : lapack-3.8.0-16.ky10.aarch64                                                                                                                        1/2 
  Running scriptlet: lapack-3.8.0-16.ky10.aarch64                                                                                                                        1/2 
  Installing       : lapack-devel-3.8.0-16.ky10.aarch64                                                                                                                  2/2 
  Running scriptlet: lapack-devel-3.8.0-16.ky10.aarch64                                                                                                                  2/2 
  Verifying        : lapack-3.8.0-16.ky10.aarch64                                                                                                                        1/2 
  Verifying        : lapack-devel-3.8.0-16.ky10.aarch64                                                                                                                  2/2 

Installed:
  lapack-devel-3.8.0-16.ky10.aarch64                                                       lapack-3.8.0-16.ky10.aarch64                                                      

Complete!
[root@col ~]# 

[root@col ~]# rpmbuild --rebuild armadillo-9.600.6-4.oe1.src.rpm 

[root@col ~]# yum install ~/rpmbuild/RPMS/aarch64/armadillo-9.600.6-4.ky10.aarch64.rpm 

安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
[root@col ~]# yum install postgresql96 postgresql96-server postgis24_96                                                                                                      
Last metadata expiration check: 1:00:42 ago on Sun 24 Jul 2022 07:56:56 AM CST.
Dependencies resolved.
=============================================================================================================================================================================
 Package                                         Architecture                      Version                                       Repository                             Size
=============================================================================================================================================================================
Installing:
 postgis24_96                                    aarch64                           2.4.9-3.rhel8                                 pgdg96                                3.2 M
 postgresql96                                    aarch64                           9.6.24-1PGDG.rhel8                            pgdg96                                1.5 M
 postgresql96-server                             aarch64                           9.6.24-1PGDG.rhel8                            pgdg96                                4.5 M
Upgrading:
 minizip                                         aarch64                           2.8.9-2.el8                                   epel                                  119 k
Installing dependencies:
 boost-atomic                                    aarch64                           1.66.0-18.ky10                                ks10-adv-os                            11 k
 boost-chrono                                    aarch64                           1.66.0-18.ky10                                ks10-adv-os                            20 k
 boost-date-time                                 aarch64                           1.66.0-18.ky10                                ks10-adv-os                            26 k
 boost-serialization                             aarch64                           1.66.0-18.ky10                                ks10-adv-os                           105 k
 boost-system                                    aarch64                           1.66.0-18.ky10                                ks10-adv-os                            15 k
 boost-thread                                    aarch64                           1.66.0-18.ky10                                ks10-adv-os                            53 k
 cfitsio                                         aarch64                           3.450-5.oe1                                   ks10-adv-os                           508 k
 jasper-libs                                     aarch64                           2.0.14-7.ky10                                 ks10-adv-os                           146 k
 libdap                                          aarch64                           3.19.1-3.oe1                                  ks10-adv-os                           562 k
 libusb                                          aarch64                           1:0.1.5-15.ky10                               ks10-adv-os                            32 k
 protobuf                                        aarch64                           3.9.0-7.ky10                                  ks10-adv-os                           1.5 M
 protobuf-c                                      aarch64                           1.3.2-2.ky10                                  ks10-adv-os                           103 k
 CGAL                                            aarch64                           4.14-1.rhel8                                  pgdg-common                           473 k
 SFCGAL                                          aarch64                           1.3.8-1.rhel8                                 pgdg-common                            20 k
 SFCGAL-libs                                     aarch64                           1.3.8-1.rhel8                                 pgdg-common                           1.6 M
 gdal32-libs                                     aarch64                           3.2.2-13.rhel8                                pgdg-common                           7.4 M
 geos39                                          aarch64                           3.9.2-1.rhel8                                 pgdg-common                           619 k
 libgeotiff16                                    aarch64                           1.6.0-6.rhel8                                 pgdg-common                            98 k
 libgeotiff16-devel                              aarch64                           1.6.0-6.rhel8                                 pgdg-common                            33 k
 librttopo                                       aarch64                           1.1.0-1.rhel8                                 pgdg-common                           161 k
 libspatialite50                                 aarch64                           5.0.1-2.rhel8                                 pgdg-common                           2.7 M
 libspatialite50-devel                           aarch64                           5.0.1-2.rhel8                                 pgdg-common                            99 k
 ogdi41                                          aarch64                           4.1.0-3.rhel8                                 pgdg-common                           220 k
 proj72                                          aarch64                           7.2.1-1.rhel8                                 pgdg-common                           2.4 M
 proj80                                          aarch64                           8.0.1-1.rhel8                                 pgdg-common                           2.4 M
 postgresql96-contrib                            aarch64                           9.6.24-1PGDG.rhel8                            pgdg96                                576 k
 postgresql96-libs                               aarch64                           9.6.24-1PGDG.rhel8                            pgdg96                                339 k
 freexl                                          aarch64                           1.0.6-4.el8                                   epel                                   33 k
 gpsbabel                                        aarch64                           1.6.0-3.el8                                   epel                                  892 k
 hdf                                             aarch64                           4.2.14-5.el8                                  epel                                  615 k
 libbsd                                          aarch64                           0.9.1-4.el8                                   epel                                  104 k
 libgta                                          aarch64                           1.2.1-1.el8                                   epel                                   33 k
 minizip1.2                                      aarch64                           1.2.11-24.el8                                 epel                                   32 k
 netcdf                                          aarch64                           4.7.0-2.el8                                   epel                                  617 k
 shapelib                                        aarch64                           1.5.0-1.el8                                   epel                                   78 k
 xerces-c                                        aarch64                           3.2.2-3.el8                                   epel                                  861 k

Transaction Summary
=============================================================================================================================================================================
Install  39 Packages
Upgrade   1 Package

Total download size: 35 M
Is this ok [y/N]: y
Downloading Packages:
(1/40): boost-atomic-1.66.0-18.ky10.aarch64.rpm                                                                                               51 kB/s |  11 kB     00:00    
(2/40): boost-chrono-1.66.0-18.ky10.aarch64.rpm                                                                                               85 kB/s |  20 kB     00:00    
(3/40): boost-date-time-1.66.0-18.ky10.aarch64.rpm                                                                                           108 kB/s |  26 kB     00:00    
(4/40): boost-system-1.66.0-18.ky10.aarch64.rpm                                                                                              996 kB/s |  15 kB     00:00    
(5/40): boost-thread-1.66.0-18.ky10.aarch64.rpm                                                                                              2.4 MB/s |  53 kB     00:00    
(6/40): boost-serialization-1.66.0-18.ky10.aarch64.rpm                                                                                       2.4 MB/s | 105 kB     00:00    
(7/40): jasper-libs-2.0.14-7.ky10.aarch64.rpm                                                                                                3.3 MB/s | 146 kB     00:00    
(8/40): libusb-0.1.5-15.ky10.aarch64.rpm                                                                                                     1.8 MB/s |  32 kB     00:00    
(9/40): cfitsio-3.450-5.oe1.aarch64.rpm                                                                                                      4.5 MB/s | 508 kB     00:00    
(10/40): protobuf-c-1.3.2-2.ky10.aarch64.rpm                                                                                                 3.1 MB/s | 103 kB     00:00    
(11/40): libdap-3.19.1-3.oe1.aarch64.rpm                                                                                                     3.9 MB/s | 562 kB     00:00    
(12/40): SFCGAL-1.3.8-1.rhel8.aarch64.rpm                                                                                                     16 kB/s |  20 kB     00:01    
(13/40): CGAL-4.14-1.rhel8.aarch64.rpm                                                                                                       220 kB/s | 473 kB     00:02    
(14/40): SFCGAL-libs-1.3.8-1.rhel8.aarch64.rpm                                                                                               1.2 MB/s | 1.6 MB     00:01    
(15/40): gdal32-libs-3.2.2-13.rhel8.aarch64.rpm                                                                                              4.4 MB/s | 7.4 MB     00:01    
(16/40): protobuf-3.9.0-7.ky10.aarch64.rpm                                                                                                   385 kB/s | 1.5 MB     00:04    
(17/40): geos39-3.9.2-1.rhel8.aarch64.rpm                                                                                                    452 kB/s | 619 kB     00:01    
(18/40): libgeotiff16-1.6.0-6.rhel8.aarch64.rpm                                                                                              438 kB/s |  98 kB     00:00    
(19/40): libgeotiff16-devel-1.6.0-6.rhel8.aarch64.rpm                                                                                        152 kB/s |  33 kB     00:00    
(20/40): librttopo-1.1.0-1.rhel8.aarch64.rpm                                                                                                 602 kB/s | 161 kB     00:00    
(21/40): libspatialite50-5.0.1-2.rhel8.aarch64.rpm                                                                                           4.2 MB/s | 2.7 MB     00:00    
(22/40): libspatialite50-devel-5.0.1-2.rhel8.aarch64.rpm                                                                                     202 kB/s |  99 kB     00:00    
(23/40): ogdi41-4.1.0-3.rhel8.aarch64.rpm                                                                                                    499 kB/s | 220 kB     00:00    
(24/40): proj72-7.2.1-1.rhel8.aarch64.rpm                                                                                                    5.1 MB/s | 2.4 MB     00:00    
(25/40): proj80-8.0.1-1.rhel8.aarch64.rpm                                                                                                    2.8 MB/s | 2.4 MB     00:00    
(26/40): postgis24_96-2.4.9-3.rhel8.aarch64.rpm                                                                                              2.2 MB/s | 3.2 MB     00:01    
(27/40): postgresql96-contrib-9.6.24-1PGDG.rhel8.aarch64.rpm                                                                                 961 kB/s | 576 kB     00:00    
(28/40): postgresql96-9.6.24-1PGDG.rhel8.aarch64.rpm                                                                                         1.2 MB/s | 1.5 MB     00:01    
(29/40): postgresql96-libs-9.6.24-1PGDG.rhel8.aarch64.rpm                                                                                    1.5 MB/s | 339 kB     00:00    
(30/40): postgresql96-server-9.6.24-1PGDG.rhel8.aarch64.rpm                                                                                  5.3 MB/s | 4.5 MB     00:00    
(31/40): freexl-1.0.6-4.el8.aarch64.rpm                                                                                                       17 kB/s |  33 kB     00:01    
(32/40): libbsd-0.9.1-4.el8.aarch64.rpm                                                                                                       43 kB/s | 104 kB     00:02    
(33/40): libgta-1.2.1-1.el8.aarch64.rpm                                                                                                       17 kB/s |  33 kB     00:01    
(34/40): minizip1.2-1.2.11-24.el8.aarch64.rpm                                                                                                 16 kB/s |  32 kB     00:02    
(35/40): hdf-4.2.14-5.el8.aarch64.rpm                                                                                                         18 kB/s | 615 kB     00:33    
(36/40): shapelib-1.5.0-1.el8.aarch64.rpm                                                                                                     21 kB/s |  78 kB     00:03    
(37/40): gpsbabel-1.6.0-3.el8.aarch64.rpm                                                                                                     21 kB/s | 892 kB     00:42    
(38/40): minizip-2.8.9-2.el8.aarch64.rpm                                                                                                      26 kB/s | 119 kB     00:04    
(39/40): netcdf-4.7.0-2.el8.aarch64.rpm                                                                                                       11 kB/s | 617 kB     00:55    
(40/40): xerces-c-3.2.2-3.el8.aarch64.rpm                                                                                                     12 kB/s | 861 kB     01:09    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                        310 kB/s |  35 MB     01:53     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                     1/1 
  Installing       : postgresql96-libs-9.6.24-1PGDG.rhel8.aarch64                                                                                                       1/41 
  Running scriptlet: postgresql96-libs-9.6.24-1PGDG.rhel8.aarch64                                                                                                       1/41 
  Installing       : geos39-3.9.2-1.rhel8.aarch64                                                                                                                       2/41 
  Running scriptlet: geos39-3.9.2-1.rhel8.aarch64                                                                                                                       2/41 
  Installing       : boost-system-1.66.0-18.ky10.aarch64                                                                                                                3/41 
  Installing       : postgresql96-9.6.24-1PGDG.rhel8.aarch64                                                                                                            4/41 
  Running scriptlet: postgresql96-9.6.24-1PGDG.rhel8.aarch64                                                                                                            4/41 
  Installing       : proj80-8.0.1-1.rhel8.aarch64                                                                                                                       5/41 
  Running scriptlet: proj80-8.0.1-1.rhel8.aarch64                                                                                                                       5/41 
  Installing       : libgeotiff16-1.6.0-6.rhel8.aarch64                                                                                                                 6/41 
  Running scriptlet: libgeotiff16-1.6.0-6.rhel8.aarch64                                                                                                                 6/41 
  Installing       : boost-chrono-1.66.0-18.ky10.aarch64                                                                                                                7/41 
  Installing       : boost-thread-1.66.0-18.ky10.aarch64                                                                                                                8/41 
  Installing       : xerces-c-3.2.2-3.el8.aarch64                                                                                                                       9/41 
  Installing       : hdf-4.2.14-5.el8.aarch64                                                                                                                          10/41 
  Installing       : freexl-1.0.6-4.el8.aarch64                                                                                                                        11/41 
  Installing       : boost-date-time-1.66.0-18.ky10.aarch64                                                                                                            12/41 
  Installing       : boost-atomic-1.66.0-18.ky10.aarch64                                                                                                               13/41 
  Installing       : CGAL-4.14-1.rhel8.aarch64                                                                                                                         14/41 
  Running scriptlet: CGAL-4.14-1.rhel8.aarch64                                                                                                                         14/41 
  Installing       : netcdf-4.7.0-2.el8.aarch64                                                                                                                        15/41 
  Installing       : libgeotiff16-devel-1.6.0-6.rhel8.aarch64                                                                                                          16/41 
  Running scriptlet: postgresql96-server-9.6.24-1PGDG.rhel8.aarch64                                                                                                    17/41 
  Installing       : postgresql96-server-9.6.24-1PGDG.rhel8.aarch64                                                                                                    17/41 
  Running scriptlet: postgresql96-server-9.6.24-1PGDG.rhel8.aarch64                                                                                                    17/41 
  Installing       : postgresql96-contrib-9.6.24-1PGDG.rhel8.aarch64                                                                                                   18/41 
  Installing       : librttopo-1.1.0-1.rhel8.aarch64                                                                                                                   19/41 
  Installing       : shapelib-1.5.0-1.el8.aarch64                                                                                                                      20/41 
  Installing       : libgta-1.2.1-1.el8.aarch64                                                                                                                        21/41 
  Installing       : libbsd-0.9.1-4.el8.aarch64                                                                                                                        22/41 
  Upgrading        : minizip-2.8.9-2.el8.aarch64                                                                                                                       23/41 
  Running scriptlet: minizip-2.8.9-2.el8.aarch64                                                                                                                       23/41 
  Installing       : libspatialite50-5.0.1-2.rhel8.aarch64                                                                                                             24/41 
  Running scriptlet: libspatialite50-5.0.1-2.rhel8.aarch64                                                                                                             24/41 
  Installing       : libspatialite50-devel-5.0.1-2.rhel8.aarch64                                                                                                       25/41 
  Running scriptlet: libspatialite50-devel-5.0.1-2.rhel8.aarch64                                                                                                       25/41 
  Installing       : proj72-7.2.1-1.rhel8.aarch64                                                                                                                      26/41 
  Running scriptlet: proj72-7.2.1-1.rhel8.aarch64                                                                                                                      26/41 
  Installing       : ogdi41-4.1.0-3.rhel8.aarch64                                                                                                                      27/41 
  Installing       : protobuf-3.9.0-7.ky10.aarch64                                                                                                                     28/41 
  Installing       : protobuf-c-1.3.2-2.ky10.aarch64                                                                                                                   29/41 
  Running scriptlet: protobuf-c-1.3.2-2.ky10.aarch64                                                                                                                   29/41 
  Installing       : libusb-1:0.1.5-15.ky10.aarch64                                                                                                                    30/41 
  Running scriptlet: libusb-1:0.1.5-15.ky10.aarch64                                                                                                                    30/41 
  Installing       : gpsbabel-1.6.0-3.el8.aarch64                                                                                                                      31/41 
  Installing       : libdap-3.19.1-3.oe1.aarch64                                                                                                                       32/41 
  Running scriptlet: libdap-3.19.1-3.oe1.aarch64                                                                                                                       32/41 
  Installing       : jasper-libs-2.0.14-7.ky10.aarch64                                                                                                                 33/41 
  Installing       : cfitsio-3.450-5.oe1.aarch64                                                                                                                       34/41 
  Running scriptlet: cfitsio-3.450-5.oe1.aarch64                                                                                                                       34/41 
  Installing       : boost-serialization-1.66.0-18.ky10.aarch64                                                                                                        35/41 
  Installing       : SFCGAL-libs-1.3.8-1.rhel8.aarch64                                                                                                                 36/41 
  Running scriptlet: SFCGAL-libs-1.3.8-1.rhel8.aarch64                                                                                                                 36/41 
  Installing       : SFCGAL-1.3.8-1.rhel8.aarch64                                                                                                                      37/41 
  Running scriptlet: SFCGAL-1.3.8-1.rhel8.aarch64                                                                                                                      37/41 
  Installing       : gdal32-libs-3.2.2-13.rhel8.aarch64                                                                                                                38/41 
  Running scriptlet: gdal32-libs-3.2.2-13.rhel8.aarch64                                                                                                                38/41 
  Installing       : postgis24_96-2.4.9-3.rhel8.aarch64                                                                                                                39/41 
  Running scriptlet: postgis24_96-2.4.9-3.rhel8.aarch64                                                                                                                39/41 
  Installing       : minizip1.2-1.2.11-24.el8.aarch64                                                                                                                  40/41 
  Cleanup          : minizip-1.2.11-17.1.ky10.aarch64                                                                                                                  41/41 
  Running scriptlet: minizip-1.2.11-17.1.ky10.aarch64                                                                                                                  41/41 
  Verifying        : boost-atomic-1.66.0-18.ky10.aarch64                                                                                                                1/41 
  Verifying        : boost-chrono-1.66.0-18.ky10.aarch64                                                                                                                2/41 
  Verifying        : boost-date-time-1.66.0-18.ky10.aarch64                                                                                                             3/41 
  Verifying        : boost-serialization-1.66.0-18.ky10.aarch64                                                                                                         4/41 
  Verifying        : boost-system-1.66.0-18.ky10.aarch64                                                                                                                5/41 
  Verifying        : boost-thread-1.66.0-18.ky10.aarch64                                                                                                                6/41 
  Verifying        : cfitsio-3.450-5.oe1.aarch64                                                                                                                        7/41 
  Verifying        : jasper-libs-2.0.14-7.ky10.aarch64                                                                                                                  8/41 
  Verifying        : libdap-3.19.1-3.oe1.aarch64                                                                                                                        9/41 
  Verifying        : libusb-1:0.1.5-15.ky10.aarch64                                                                                                                    10/41 
  Verifying        : protobuf-3.9.0-7.ky10.aarch64                                                                                                                     11/41 
  Verifying        : protobuf-c-1.3.2-2.ky10.aarch64                                                                                                                   12/41 
  Verifying        : CGAL-4.14-1.rhel8.aarch64                                                                                                                         13/41 
  Verifying        : SFCGAL-1.3.8-1.rhel8.aarch64                                                                                                                      14/41 
  Verifying        : SFCGAL-libs-1.3.8-1.rhel8.aarch64                                                                                                                 15/41 
  Verifying        : gdal32-libs-3.2.2-13.rhel8.aarch64                                                                                                                16/41 
  Verifying        : geos39-3.9.2-1.rhel8.aarch64                                                                                                                      17/41 
  Verifying        : libgeotiff16-1.6.0-6.rhel8.aarch64                                                                                                                18/41 
  Verifying        : libgeotiff16-devel-1.6.0-6.rhel8.aarch64                                                                                                          19/41 
  Verifying        : librttopo-1.1.0-1.rhel8.aarch64                                                                                                                   20/41 
  Verifying        : libspatialite50-5.0.1-2.rhel8.aarch64                                                                                                             21/41 
  Verifying        : libspatialite50-devel-5.0.1-2.rhel8.aarch64                                                                                                       22/41 
  Verifying        : ogdi41-4.1.0-3.rhel8.aarch64                                                                                                                      23/41 
  Verifying        : proj72-7.2.1-1.rhel8.aarch64                                                                                                                      24/41 
  Verifying        : proj80-8.0.1-1.rhel8.aarch64                                                                                                                      25/41 
  Verifying        : postgis24_96-2.4.9-3.rhel8.aarch64                                                                                                                26/41 
  Verifying        : postgresql96-9.6.24-1PGDG.rhel8.aarch64                                                                                                           27/41 
  Verifying        : postgresql96-contrib-9.6.24-1PGDG.rhel8.aarch64                                                                                                   28/41 
  Verifying        : postgresql96-libs-9.6.24-1PGDG.rhel8.aarch64                                                                                                      29/41 
  Verifying        : postgresql96-server-9.6.24-1PGDG.rhel8.aarch64                                                                                                    30/41 
  Verifying        : freexl-1.0.6-4.el8.aarch64                                                                                                                        31/41 
  Verifying        : gpsbabel-1.6.0-3.el8.aarch64                                                                                                                      32/41 
  Verifying        : hdf-4.2.14-5.el8.aarch64                                                                                                                          33/41 
  Verifying        : libbsd-0.9.1-4.el8.aarch64                                                                                                                        34/41 
  Verifying        : libgta-1.2.1-1.el8.aarch64                                                                                                                        35/41 
  Verifying        : minizip1.2-1.2.11-24.el8.aarch64                                                                                                                  36/41 
  Verifying        : netcdf-4.7.0-2.el8.aarch64                                                                                                                        37/41 
  Verifying        : shapelib-1.5.0-1.el8.aarch64                                                                                                                      38/41 
  Verifying        : xerces-c-3.2.2-3.el8.aarch64                                                                                                                      39/41 
  Verifying        : minizip-2.8.9-2.el8.aarch64                                                                                                                       40/41 
  Verifying        : minizip-1.2.11-17.1.ky10.aarch64                                                                                                                  41/41 

Upgraded:
  minizip-2.8.9-2.el8.aarch64                                                                                                                                                

Installed:
  postgis24_96-2.4.9-3.rhel8.aarch64                     postgresql96-9.6.24-1PGDG.rhel8.aarch64                    postgresql96-server-9.6.24-1PGDG.rhel8.aarch64           
  boost-atomic-1.66.0-18.ky10.aarch64                    boost-chrono-1.66.0-18.ky10.aarch64                        boost-date-time-1.66.0-18.ky10.aarch64                   
  boost-serialization-1.66.0-18.ky10.aarch64             boost-system-1.66.0-18.ky10.aarch64                        boost-thread-1.66.0-18.ky10.aarch64                      
  cfitsio-3.450-5.oe1.aarch64                            jasper-libs-2.0.14-7.ky10.aarch64                          libdap-3.19.1-3.oe1.aarch64                              
  libusb-1:0.1.5-15.ky10.aarch64                         protobuf-3.9.0-7.ky10.aarch64                              protobuf-c-1.3.2-2.ky10.aarch64                          
  CGAL-4.14-1.rhel8.aarch64                              SFCGAL-1.3.8-1.rhel8.aarch64                               SFCGAL-libs-1.3.8-1.rhel8.aarch64                        
  gdal32-libs-3.2.2-13.rhel8.aarch64                     geos39-3.9.2-1.rhel8.aarch64                               libgeotiff16-1.6.0-6.rhel8.aarch64                       
  libgeotiff16-devel-1.6.0-6.rhel8.aarch64               librttopo-1.1.0-1.rhel8.aarch64                            libspatialite50-5.0.1-2.rhel8.aarch64                    
  libspatialite50-devel-5.0.1-2.rhel8.aarch64            ogdi41-4.1.0-3.rhel8.aarch64                               proj72-7.2.1-1.rhel8.aarch64                             
  proj80-8.0.1-1.rhel8.aarch64                           postgresql96-contrib-9.6.24-1PGDG.rhel8.aarch64            postgresql96-libs-9.6.24-1PGDG.rhel8.aarch64             
  freexl-1.0.6-4.el8.aarch64                             gpsbabel-1.6.0-3.el8.aarch64                               hdf-4.2.14-5.el8.aarch64                                 
  libbsd-0.9.1-4.el8.aarch64                             libgta-1.2.1-1.el8.aarch64                                 minizip1.2-1.2.11-24.el8.aarch64                         
  netcdf-4.7.0-2.el8.aarch64                             shapelib-1.5.0-1.el8.aarch64                               xerces-c-3.2.2-3.el8.aarch64                             

Complete!
[root@col ~]# 

打包备份:

1
[root@col ~]# tar zcf kylin-postgres96.tgz *.rpm rpmbuild /etc/yum.repos.d/

–END