前言
本板性能強勁,運行Debian桌面系統(tǒng),所以我們完全可以直接板上開發(fā),避免交叉編譯開發(fā)帶來的繁瑣,本篇就以Sqlite3的編譯測試為例來進行,體驗直接板上進行C開發(fā)。
安裝gcc工具鏈等可能需要比較大的空間,可參考如下文檔。
http://m.xsypw.cn/d/2185811.html
http://m.xsypw.cn/d/2184550.html
聯(lián)網(wǎng),配置源可參考文檔:
http://bbs.eeworld.com.cn/thread-1249527-1-1.html
http://bbs.eeworld.com.cn/thread-1249396-1-1.html
安裝工具
sudo apt update
sudo apt upgrade
sudo apt-get install lrzsz //rz sz文件傳輸使用
sudo apt install make
sudo apt install gcc
sudo apt install git
sudo apt install tcl
sudo apt-get install tcl-dev
sudo apt install zlib1g-dev
下載源碼
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
或
git clone https://github.com/sqlite/sqlite.git
構建
cd sqlite/
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../configure ;# Run the configure script
make sqlite3.c ;# Build the "amalgamation" source file
make ;# Run the makefile.
構建大概花了不到20min,也還是可以接受的,
運行 ./sqlite3
root@starfive:~/sqlite/bld# ./sqlite3
SQLite version 3.43.0 2023-07-18 13:55:19
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite >
測試
make test ;# Run some tests (requires Tcl)
make test ;# Run some tests (requires Tcl)
如果報如下錯誤
/usr/bin/ld: /tmp/cccaPGbP.o: in function `fillInCell':
/root/sqlite/bld/./sqlite3.c:75921: undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
make: *** [Makefile:714: sessionfuzz] Error 1
則
nano Makefile 添加-lz
報錯tcl.h找不到,則查找
/usr/include/tcl8.6/tcl-private/generic/tcl.h
/usr/include/tcl8.6/tcl.h
添加頭文件包含路徑
如果提示tcl相關函數(shù)未定義
添加-ltcl
測試結果如下
總結
得益于開發(fā)板強勁的性能,直接在板上進行C開發(fā)非常方便,構建一般規(guī)模的項目時間還是可以接受的,省去了交叉編譯的麻煩。
審核編輯:湯梓紅
-
usb
+關注
關注
60文章
8182瀏覽量
272830 -
計算機
+關注
關注
19文章
7662瀏覽量
90765 -
GCC
+關注
關注
0文章
111瀏覽量
25394 -
開發(fā)板
+關注
關注
25文章
5679瀏覽量
104632 -
交叉編譯
+關注
關注
0文章
34瀏覽量
12858 -
單板計算機
+關注
關注
0文章
86瀏覽量
15978 -
編譯
+關注
關注
0文章
679瀏覽量
33981 -
RISC-V
+關注
關注
46文章
2563瀏覽量
48797
發(fā)布評論請先 登錄
昉·星光單板計算機正式發(fā)售,加速RISC-V生態(tài)發(fā)展

評論