在幸狐RV1106開發板上用gcc14.2本地編譯安裝postgresql 17.5數據庫

在幸狐RV1106開發板上用gcc14.2本地編譯安裝postgresql 17.5數據庫

編譯環境:
RV1106G3
Linux luckfox-rv1106 5.10.160 #3 Fri Jun 27 14:16:20 AWST 2025 armv7l GNU/Linux
BusyBox v1.36.1
gcc version 14.2.0 (GCC)
GNU ld (GNU Binutils) 2.44
GNU Make 4.4
ncurses 6.5.20240427(libncursesw.so.6.5)
OpenSSL 1.1.1w ?11 Sep 2023

瑞芯微RV1106從SD卡啟動自己的busybox1.36.1根文件系統:https://zh.purasbar.com/post.php?t=32786
在fedora42上用arm-gnu-toolchain-14.2交叉編譯器編譯gcc14.2、gdb14.2和make4.4:https://zh.purasbar.com/post.php?t=32816
在瑞芯微RV1106板子上用gcc14.2本地編譯安裝apache2.4.63,開啟http2和tls1.3,并且https支持XP系統的IE6-8瀏覽器:https://zh.purasbar.com/post.php?t=32825

工作目錄:
mkdir ~/software/postgresql
cd ~/software/postgresql

【編譯安裝icu4c-77_1】
[方法1: 在板子上本地編譯]
wget https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz --no-check-certificate
tar xf icu4c-77_1-src.tgz
cd icu/source
./configure --with-data-packaging=files
make

批量創建文件夾:
mkdir -p $(find data/out/build -type d | sed "s/data\/out\/build/\/usr\/local\/share\/icu\/77.1/")
注意文件夾名字中的版本號。如果不知道的話,可以先執行make install看看報錯信息。

make install
cd ../..

[方法2: 在電腦上交叉編譯]
export PATH=$PATH:/home/oct1158/Downloads/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-linux-gnueabihf/bin
wget https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz
tar xf icu4c-77_1-src.tgz
cd icu
mkdir _build
cd _build
../source/configure
make

mkdir ../_build2
cd ../_build2
../source/configure --host=arm-none-linux-gnueabihf --with-cross-build=$(pwd)/../_build --with-data-packaging=files
make

修改data/Makefile文件:第172-181行,把每一行的$(ICUPKGDATA_DIR)都改成$(DESTDIR)$(ICUPKGDATA_DIR)。
批量創建文件夾:
mkdir -p $(find data/out/build -type d | sed "s/data\/out\/build/_install\/usr\/local\/share\/icu\/77.1/")
注意文件夾名字中的版本號。如果不知道的話,可以先執行make install DESTDIR=$(pwd)/_install看看報錯信息。

make install DESTDIR=$(pwd)/_install
cd _install
sudo chown -R root:root usr
tar czf icu4c-77_1-binary.tar.gz usr
mv icu4c-77_1-binary.tar.gz /var/www/html/oct1158

[測試icu庫是否能正常工作(非常重要)]
先運行一下ldconfig。

執行:/usr/local/bin/icuinfo
提示:ICU Initialization returned: U_FILE_ACCESS_ERROR

執行:ICU_DATA=/usr/local/share/icu/77.1 /usr/local/bin/icuinfo(注意這是一行命令,不是兩行)
提示:ICU Initialization returned: U_ZERO_ERROR
看到U_ZERO_ERROR就說明正常了,zero error零錯誤,就是沒有錯誤的意思,在icu庫里面用于UErrorCode類型變量的初始值。

修改/etc/profile文件:添加export ICU_DATA=/usr/local/share/icu/77.1。
改完后用exit命令退出命令行,再按回車鍵重新進入命令行。

【編譯安裝bison-3.8.2】
wget https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.gz --no-check-certificate
tar xf bison-3.8.2.tar.gz
cd bison-3.8.2
./configure
make
make install
cd ..

【編譯安裝flex-2.6.4】
wget https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz --no-check-certificate
tar xf flex-2.6.4.tar.gz
cd flex-2.6.4
./configure
make
make install
cd ..

【編譯安裝readline-8.2.13】
wget https://ftp.gnu.org/gnu/readline/readline-8.2.13.tar.gz --no-check-certificate
tar xf readline-8.2.13.tar.gz
cd readline-8.2.13
./configure
make
make install
ldconfig
cd ..

【編譯安裝postgresql-17.5】
wget https://ftp.postgresql.org/pub/source/v17.5/postgresql-17.5.tar.gz --no-check-certificate
tar xf postgresql-17.5.tar.gz
cd postgresql-17.5
./configure LDFLAGS="-lncursesw"
(如果報Could not execute a simple test program.的錯誤,說明之前忘記了執行ldconfig。請檢查gcc helloworld.c -o helloworld -lreadline -lncursesw編譯出來的程序是否能成功執行,helloworld.c里面是空白main函數。)
make
make install
ldconfig
cd ..

【使用postgresql-17.5數據庫】
給/dev/urandom添加權限:chmod o+rw /dev/urandom(不添加權限的話會報running bootstrap script ... 2025-06-30 08:31:57.060 UTC [415] PANIC: ?could not generate secret authorization token的錯誤)
給/dev/null添加權限:chmod o+rw /dev/null
添加postgres用戶和組:adduser postgres
登錄postgres用戶:su postgres
初始化數據庫:/usr/local/pgsql/bin/initdb -D /home/postgres/data

[root@luckfox-rv1106 /]# ls /home/postgres/
[root@luckfox-rv1106 /]# su postgres
[postgres@luckfox-rv1106 /]$ /usr/local/pgsql/bin/initdb -D /home/postgres/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory /home/postgres/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... sysv
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... 2025-06-30 11:32:18.303 UTC [368] WARNING: ?no usable system locales were found
ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

? ? /usr/local/pgsql/bin/pg_ctl -D /home/postgres/data -l logfile start

[postgres@luckfox-rv1106 /]$ ls ~
data
[postgres@luckfox-rv1106 /]$

如果報下面的錯誤:
performing post-bootstrap initialization ... 2025-06-30 11:28:10.430 UTC [341] FATAL: ?could not open collator for locale "und": U_FILE_ACCESS_ERROR
2025-06-30 11:28:10.430 UTC [341] STATEMENT: ?UPDATE pg_collation SET collversion = pg_collation_actual_version(oid) WHERE collname = 'unicode';
要么是編譯icu庫的時候沒帶--with-data-packaging=files選項,要么是沒有在/etc/profile文件中添加export ICU_DATA=/usr/local/share/icu/77.1環境變量,要么是改了/etc/profile文件但沒用exit命令退出命令行再按回車鍵重新進入命令行。

(postgres用戶)啟動數據庫服務器:/usr/local/pgsql/bin/pg_ctl -D ~/data -l ~/logfile start
(postgres用戶)創建mydb數據庫:/usr/local/pgsql/bin/createdb mydb
(postgres用戶)進入數據庫:/usr/local/pgsql/bin/psql
查看數據庫列表:\l
選擇數據庫:\c mydb
創建表:create table test (id serial, title character varying(500), time timestamp default now(), primary key(id));
查看表結構:\d test
插入記錄:
insert into test (title) values ('安裝黑翼貓擴展內核能使win2000 sp4的ie6瀏覽器支持sha256簽名的https證書'),
('安裝微軟官方的KB968730補丁能使64位winxp sp2的ie6-8瀏覽器支持sha256簽名的https證書'),
('32位winxp sp3的ie6-8瀏覽器原生支持sha256簽名的https證書'),
('只要采用sha1簽名的https證書,2025年的apache2.4.63的https不僅支持xp系統的ie6-8瀏覽器,還支持原版win2000 sp4系統的ie5-6瀏覽器'),
('xp系統安裝one core api 4.0.1補丁后,可以安裝和運行vscode1.70.2,VSCodeUserSetup安裝包文件的屬性里面的兼容性下拉框要記得選擇win7sp1');
查看表數據:select * from test;
退出數據庫:\q
(postgres用戶)關閉數據庫服務器:/usr/local/pgsql/bin/pg_ctl -D ~/data stop

執行/usr/local/pgsql/bin/psql時如果報錯:
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: server closed the connection unexpectedly
? ? ? ? This probably means the server terminated abnormally
? ? ? ? before or while processing the request.
解決辦法:在root用戶下chmod o+rw /dev/urandom。
建議將chmod o+rw /dev/urandom和chmod o+rw /dev/null添加到開機腳本/etc/init.d/rcS里面。

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/912463.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/912463.shtml
英文地址,請注明出處:http://en.pswp.cn/news/912463.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Go語言中map[string]interface{} 和 map[string]string的區別

在 Go 語言中,map[string]interface{} 和 map[string]string 是兩種不同類型的 map,它們的主要區別在于值的類型以及這種差異帶來的使用場景和靈活性的不同。 1. 值的類型 map[string]interface{}:這里的 interface{} 表示 Go 中的空接口類型…

AdGuard Home 安裝及使用

AdGuard Home 是 AdGuard 開源的一個私人 DNS 服務端,只需在網關部署,即可實現全局域網的廣告攔截與隱私反追蹤。在 DNS 解析的過程中,匹配規則庫內的 URL 進行攔截,同時在客戶端中,還可以通過自定義過濾規則實現網頁 DOM 的攔截。 基于 Golang 編寫的 AdGuard Home,官方…

繞過 GraphQL 暴力破解保護

題目要求: 本實驗的用戶登錄機制由 GraphQL API 提供支持。API 終端節點有一個速率限制器,如果它在短時間內收到來自同一源的太多請求,則會返回錯誤。 要解決實驗問題,請暴力破解登錄機制以 .使用身份驗證實驗室密碼列表作為密碼…

C/C++ 使用rapidjson庫 操作Json格式文件(創建、插入、解析、修改、刪除)

目錄 一、前言 1.簡介 2.兼容性 3.下載 4.安裝 5.官方文檔 6.自述 二、封裝Json 1. 創建一個 Document 對象 2. "key":"value" 3. { } 4. [ ] 5. [ { }, { } ] 6. [ [ ], [ ] ] 7. { [ ], [ ] } 8. { { }, { } } 9. 將Document轉換為字符串…

免安裝一鍵修復網絡診斷 + 權限修復!打印機共享錯誤工具適配 Win7/10/11

各位打印小能手們!你們有沒有遇到過共享打印機出問題,搞得自己焦頭爛額的情況?比如系統一更新,打印機就連不上,打印任務失敗,真的是讓人崩潰啊!別慌,今天就給大家全面介紹一款打印機…

電腦分屏快捷鍵5

按window右箭頭: 按window左箭頭:

nt!CcFlushCache函數分析之nt!CcFindBcb

nt!CcFindBcb函數分析 第一部分: 1: kd> p nt!CcAcquireByteRangeForWrite0x377: 80a13c49 e866e4ffff call nt!CcFindBcb (80a120b4) 1: kd> t nt!CcFindBcb: 80a120b4 55 push ebp 1: kd> kc # 00 nt!CcFindBcb 01 nt!CcAcqu…

矩陣及矩陣快速冪

一.矩陣與模板 【模板】矩陣求和 時間限制:1秒 內存限制:128M 題目描述 給出兩個𝑛行𝑚列的矩陣,求兩個矩陣的和 輸入描述 第一行輸入兩個以空格分隔的整數𝑛,𝑚,表示矩…

rk3588獲取探維雷達數據

可以在上期部署完 FASTLIO 的工作空間內,繼續部署探維雷達的驅動程序。不要問為什么不用 mid360,因為我手上只有探維雷達。 探維雷達的驅動鏈接:https://github.com/TanwayLab/tanwaylidar_view/blob/main/README.md 下載驅動并編譯 因為沿…

HTML簡介,初步了解HTML

<html> <body> <h1>我的第一個標題</h1> <p1>我的第一個段落</p1> </body> </html> 什么是HTML HTML是用來描述網頁的一種語言。 HTML指的是超文本標記語言。 HTML不是一種編程語言&#xff0c;而是一種標記語言。 標記語…

ARM集群服務器 定義

ARM集群服務器的核心定義可歸納為以下要點&#xff1a; 一、核心定義 ARM集群服務器是將?多個基于ARM架構的處理器節點?集成在單一物理機箱內&#xff0c;通過高速網絡互聯形成的分布式計算系統。每個節點均具備獨立的計算單元&#xff08;如CPU、GPU/NPU&#xff09;、內存…

進程和線程的區別?

進程&#xff08;Process&#xff09;和線程&#xff08;Thread&#xff09;是操作系統資源分配和調度的核心概念&#xff0c;它們的區別主要體現在以下幾個方面&#xff1a; 1. ??定義與資源分配?? ??進程?? 是程序的??一次執行實例??&#xff0c;擁有獨立的地址空…

AR 學習:開啟未來學習新視界?

AR 學習&#xff0c;即增強現實學習&#xff0c;是一種創新的學習方式&#xff0c;它巧妙地將增強現實技術融入到教育領域。簡單來說&#xff0c;就是利用 AR 技術把虛擬的信息和現實場景完美融合&#xff0c;為學習者打造出一個沉浸式的學習環境。AR 學習打破了傳統學習的邊界…

C++并發編程-4.unique_lock,共享鎖和遞歸鎖

本文介紹C 并發中使用的其他類型的鎖&#xff0c;包括unique_lock&#xff0c;shared_lock, 以及recursive_lock等。shared_lock和unique_lock比較常用&#xff0c;而recursive_lock用的不多&#xff0c;或盡可能規避用這種鎖。 unique_lock unique_lock和lock_guard基本用法…

stm32 freertos下基于 hal庫的模擬I2C驅動實現

一 前言 最近搞了兩個項目&#xff0c;調了一版freertos下基于hal庫得模擬I2C驅動&#xff0c;非常實用&#xff0c;直接拷貝就能用&#xff0c;這里做下記錄&#xff0c;主要用到如下四個文件&#xff1a; delay.cdelay.hi2cc.ci2cc.h 二 代碼實現 delay.c #include "…

文心大模型 4.5 系列開源首發:技術深度解析與應用指南

文心大模型 4.5 系列開源首發&#xff1a;技術深度解析與應用指南 2025 年 6 月 30 日&#xff0c;百度正式在國內領先的開源平臺 GitCode 發布文心大模型 4.5 系列開源模型。此次開源不僅覆蓋了從數億到數百億參數的多種規模&#xff0c;還在多模態理解、指令遵循、世界知識記…

智能制造——58頁智慧工廠解決方案【附全文閱讀】

適應人群為制造業企業管理者、技術人員及規劃改造團隊。主要內容是以 JetLinks IoT 平臺為基礎&#xff0c;構建涵蓋設備層、網絡層、平臺層和應用層的智慧工廠體系&#xff0c;通過多種通信協議實現設備互聯&#xff0c;利用大數據、AI 等技術實現數據采集與處理、設備全生命周…

DeepSeek16-open-webui Pipelines開發填坑

一、虛擬環境安裝 mkdir open_webui_pipelines cd open_webui_pipelines python -m venv py3119_env call py3119_env\Scripts\activate 二、下載服務以及安裝依賴 git clone https://github.com/open-webui/pipelines.git cd pipelines pip install -r requirements.txt三、…

蘭亭妙微APP 界面設計與軟件開發綜合服務商

蘭亭妙微作為 APP 界面設計公司與軟件開發公司&#xff0c;自 2011 年成立以來&#xff0c;由清華團隊主導&#xff0c;在軟件和互聯網 UI/UE 設計開發領域發展 16 年&#xff0c;積累了一定的行業經驗。 在 APP 界面設計方面&#xff0c;我們的團隊包含交互設計師、用戶體驗相…

【算法】動態規劃:1137. 第 N 個泰波那契數

1137. 第 N 個泰波那契數 簡單 相關標簽 premium lock icon 相關企業 提示 泰波那契序列 Tn 定義如下&#xff1a; T0 0, T1 1, T2 1, 且在 n > 0 的條件下 Tn3 Tn Tn1 Tn2 給你整數 n&#xff0c;請返回第 n 個泰波那契數 Tn 的值。 示例 1&#xff1a; 輸入&am…