gotoblas2 安装编译方法

来源:互联网 发布:淘宝卖家app官方下载 编辑:程序博客网 时间:2024/04/30 18:07

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



1、下载地址:http://cms.tacc.utexas.edu/tacc-projects/gotoblas2/downloads/

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 andWPREFETCHSIZEusing #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 modifycpuid.c (which I presume is what'sbeing used to generate config.h, or at least this partof it. Maybe another day...
原创粉丝点击