廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

廣電鯤鵬服務器是廣電運通與華為合作,基於華為鯤鵬920處理的ARM架構的服務器,我這這裡測試的是GRGBanking 200 (Model RK2280)型號,2U高度,配置兩個64核的Kunpeng 920處理器。

區別於Intel和AMD的X86平臺,廣電鯤鵬服務器使用的操作系統和應用軟件都是ARM版本的。

CPU信息如下:

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

CPU架構顯示是aarch64。指令集於X86的也不相同。

安裝CentOS Linux release 7.7.1908 (AltArch)操作系統

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

在圖形化界面信息下識別不了CPU信息:

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

安裝好操作系統之後想跑一下Unixbench跑分。Unixbench是一個類unix系(Unix,BSD,Linux)統下的性能測試工具,一個開源工具,被廣泛用於測試linux系統主機的性能。

先看下GCC的版本:

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

在X86平臺下直接執行Run命令就可以進行Unixbench跑分。

但是在ARM平臺下進行Unixbench跑分出現報錯:


./Run

gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c

src/arith.c:1:0: error: unknown value 'native' for -march

^

src/arith.c:1:0: error: unknown value 'native' for -mtune

make: *** [pgms/arithoh] Error 1

make distr

make[1]: Entering directory `/opt/byte-unixbench-master/UnixBench'

Checking distribution of files

./pgms exists

./src exists

./testdir exists

./tmp exists

./results exists

make[1]: Leaving directory `/opt/byte-unixbench-master/UnixBench'

make programs

make[1]: Entering directory `/opt/byte-unixbench-master/UnixBench'

gcc -o pgms/arithoh -Wall -pedantic -O3 -ffast-math -march=native -mtune=native -I ./src -DTIME -Darithoh src/arith.c

src/arith.c:1:0: error: unknown value 'native' for -march

^

src/arith.c:1:0: error: unknown value 'native' for -mtune

make[1]: *** [pgms/arithoh] Error 1

make[1]: Leaving directory `/opt/byte-unixbench-master/UnixBench'

make: *** [all] Error 2


**********************************************

Run: "make all" failed; aborting

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

這是由於CPU的架構不同,-march和-mtune不支持native參數,需要進行修改。

修改MakeFile文件,將 -march=armv8-a -mtune=cortex-a53

廣電鯤鵬ARM服務器在Centos下使用遇到的第一個坑

再次運行Unixbench就可以正常進行編譯跑分了。


分享到:


相關文章: