1. 程式人生 > >gotoblas2 安裝編譯方法

gotoblas2 安裝編譯方法

來源:http://blog.sina.com.cn/s/blog_5d964ffb0100vtak.html

2、執行解壓:tar xzvf GotoBLAS2-1.13_bsd.tar.gz 3、進入目錄執行:./quickbuild.64bit 4、若出現如下: ../kernel/x86_64/gemm_ncopy_4.S:192: Error: undefined symbol`RPREFETCHSIZE' in operation ../kernel/x86_64/gemm_ncopy_4.S:193:Error: undefined symbol `RPREFETCHSIZE' in operation../kernel/x86_64/gemm_ncopy_4.S:194: Error: undefined symbol`RPREFETCHSIZE' in operation ../kernel/x86_64/gemm_ncopy_4.S:195:Error: undefined symbol `RPREFETCHSIZE' in operation 則執行: gmake clean make BINARY=64 TARGET=NEHALEM 出現以上錯誤的原因為,cpu太新,配置檔案不識別,需要重新指定一下CPU型別。

把程式碼發給IBM去測試的時候,給除了上面類似的錯誤,在指定CPU型別之後可以正常安裝執行。看了下,原來他們的CPU是目前最高階的CPU,代號是X7560,售價為3692美元,必須得感嘆IBM真有錢。

I came across a problem compiling GotoBLAS2 at work today. Itwent well on a practice cluster, but on the new one I got thiserror:

gcc -c -O2 -Wall -m64 -DF_INTERFACE_G77 -fPIC  -DSMP_SERVER -DMAX_CPU_NUMBER=24 -DASMNAME=strmm_ounncopy -DASMFNAME=strmm_ounncopy_ -DNAME=strmm_ounncopy_ -DCNAME=strmm_ounncopy -DCHAR_NAME=\"strmm_ounncopy_\o
../kernel/x86_64/gemm_ncopy_4.S: Assembler messages:
../kernel/x86_64/gemm_ncopy_4.S:192: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:193: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:194: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:195: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:197: Error: undefined symbol `WPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:345: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:346: Error: undefined symbol `RPREFETCHSIZE' in operation
../kernel/x86_64/gemm_ncopy_4.S:348: Error: undefined symbol `WPREFETCHSIZE' in operation


The solution was simple:

gmake clean gmake TARGET=NEHALEM

The problem appears to be that newer CPUs (Intel X5650 in mycase) are not detected properly by the CPU ID routine in GotoBlas2.You can verify this by checking the contents ofconfig.h in the top-level directory. WithoutTARGET=NEHALEM, I saw this line:

#define INTEL_UNKNOWN

But with TARGET=NEHALEM, this becomes:

#define NEHALEM

The problem with gemm_ncopy_4.S arises because itdefines RPRETCHSIZE and WPREFETCHSIZEusing #ifdef statements depending on CPU type. Thereis an entry for #ifdef GENERIC, but that was not setfor me in config.h.

In addition, if you type "gmake TARGET=NEHALEM" without "gmakeclean" first, you get a little further before you run into asimilar error:

usr/bin/ld: ../libgoto2_nehalemp-r1.13.a(ssymv_U.o):relocation R_X86_64_32S against `PREFETCHSIZE' can not be used whenmaking a shared object; recompile with -fPIC../libgoto2_nehalemp-r1.13.a(ssymv_U.o): could not read symbols:Bad value

If I was a better person, I'd have a look at how thesizes are defined and figure out what the right value is for newerCPUs, then modify cpuid.c (which I presume is what'sbeing used to generate config.h, or at least this partof it. Maybe another day...