ARM64平台编译stream、netperf出错解决办法 解决办法:指定编译平台为alpha [root@localhost netperf-2.6.0]# ./configure –build=alpha

ARM64平台编译stream、netperf出错解决办法

http://ilinuxkernel.com/?p=1738

stream编译出错信息:

[root@localhost stream]# make

gcc -O2 -DSTREAM_ARRAY_SIZE=1000000000 stream.c -o stream

/tmp/ccCGEF5F.o: In function `checkSTREAMresults’:

stream.c:(.text+0x144): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.bss’

stream.c:(.text+0x148): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.bss’

/tmp/ccCGEF5F.o: In function `main’:

stream.c:(.text.startup+0x20): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.bss’

stream.c:(.text.startup+0x3c): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.bss’

stream.c:(.text.startup+0x3ec): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.bss’

collect2: error: ld returned 1 exit status

Makefile:5: recipe for target ‘stream’ failed

make: *** [stream] Error 1

[root@localhost stream]#

解决办法:加上-mcmodel=large编译选项

[root@localhost stream]# ls

Makefile stream.c

[root@localhost stream]# cat Makefile

CC = gcc

CFLAGS= -O2 -mcmodel=large

all: stream stream_omp

stream: stream.c

$(CC) $(CFLAGS) -DSTREAM_ARRAY_SIZE=1000000000 stream.c -o stream

stream_omp: stream.c

$(CC) $(CFLAGS) -fopenmp -DSTREAM_ARRAY_SIZE=1000000000 stream.c -o stream_omp

clean:

rm -f stream *.o .depend *.*~ stream_omp

[root@localhost stream]#

Netperf编译出错信息:

[root@localhost netperf-2.6.0]# ./configure

checking build system type… ./config.guess: unable to guess system type

This script, last modified 2005-08-03, has failed to recognize

the operating system you are using. It is advised that you

download the most up to date version of the config scripts from

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess

and

http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run (./config.guess) is already up to date, please

send the following data and any information you think might be

pertinent to <config-patches@gnu.org> in order to provide the needed

information to handle your system.

config.guess timestamp = 2005-08-03

uname -m = aarch64

uname -r = 3.19.8chen

uname -s = Linux

uname -v = #7 SMP Thu Sep 10 15:58:50 UTC 2015

/usr/bin/uname -p = aarch64

/bin/uname -X =

hostinfo =

/bin/universe =

/usr/bin/arch -k =

/bin/arch = aarch64

/usr/bin/oslevel =

/usr/convex/getsysinfo =

UNAME_MACHINE = aarch64

UNAME_RELEASE = 3.19.8chen

UNAME_SYSTEM = Linux

UNAME_VERSION = #7 SMP Thu Sep 10 15:58:50 UTC 2015

configure: error: cannot guess build type; you must specify one

[root@localhost netperf-2.6.0]#

解决办法:指定编译平台为alpha

[root@localhost netperf-2.6.0]# ./configure –build=alpha

上一篇:Java Collections的排序之二


下一篇:理解RxJava线程模型