0

我想在我的服务器上编译和运行 HPC Challenge 基准测试。当我想使用 mpicc 编译器制作 hpcc-1.5.0 时,我收到此错误:

../../../../STREAM/stream.c:178:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘a’
 static double * restrict a, * restrict b, * restrict c;
                          ^
../../../../STREAM/stream.c: In function ‘checkSTREAMresults’:
../../../../STREAM/stream.c:263:16: error: ‘a’ undeclared (first use in this function)
       if (fabs(a[j]/aj-1.0) > epsilon) {
                ^
../../../../STREAM/stream.c:263:16: note: each undeclared identifier is reported only once for each function it appears in
../../../../STREAM/stream.c:280:16: error: ‘b’ undeclared (first use in this function)
       if (fabs(b[j]/bj-1.0) > epsilon) {
                ^
../../../../STREAM/stream.c:297:16: error: ‘c’ undeclared (first use in this function)
       if (fabs(c[j]/cj-1.0) > epsilon) {
                ^
../../../../STREAM/stream.c: In function ‘computeSTREAMerrors’:
../../../../STREAM/stream.c: In function ‘HPCC_Stream’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Copy’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Scale’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Add’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Triad’:

make[1]: *** [../../../../STREAM/stream.o] Error 1
make[1]: Leaving directory `/root/hpcc-1.5.0/hpl/lib/arch/build'
make: *** [all] Error 2

似乎 STREAM 使用了一些未声明的变量。

4

1 回答 1

3

这是因为对数组使用了限制关键字。要编译流,您必须使用-std=c99选项。

在您的文件中添加-std=c99标志部分。像这样:Make.$(arch)CCFLAGS

CCFLAGS      = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -std=c99

资料来源:https ://anilmaurya.wordpress.com/2016/04/26/hpc-1-5-0-compile-time-error/

于 2021-02-14T07:48:24.857 回答