Diary/2011-10-25
MAGMA 1.0
MAGMA 1.0をコンパイルして試してみよう...と
したのだけど,一筋縄では上手くいかなかった.
試した環境は,CUDA SDK 3.2と GotoBLAS2 な環境.
../lib/libmagma.a(zlatrd.o): In function `magma_zlatrd': zlatrd.cpp:(.text+0x3ce): undefined reference to `zdotc' zlatrd.cpp:(.text+0xd16): undefined reference to `zdotc'
というエラー.で,検索してみるとフォーラムに↓な書き込みが.
http://icl.cs.utk.edu/magma/forum/viewtopic.php?f=2&t=278
で,
--- magma_1.0.0.orig/src/zlatrd.cpp 2011-08-25 07:16:34.000000000 +0900 +++ magma_1.0.0/src/zlatrd.cpp 2011-10-25 20:09:49.000000000 +0900 @@ -254,7 +254,8 @@ blasf77_zscal(&i, &tau[i - 1], W(0, iw), &ione); #if defined(PRECISION_z) || defined(PRECISION_c) - blasf77_zdotc(&value, &i, W(0, iw), &ione, A(0, i), &ione); + cblas_zdotc_sub(i, W(0, iw), ione, A(0, i), ione, &value); + //blasf77_zdotc(&value, &i, W(0, iw), &ione, A(0, i), &ione); alpha = tau[i - 1] * -.5f * value; #else alpha = tau[i - 1] * -.5f * blasf77_zdotc(&i, W(0, iw), &ione, A(0, i), &ione); @@ -333,11 +334,9 @@ out version works with MKL but is not a standard interface for other BLAS zdoc implementations */ - /* cblas_zdotc_sub(i_n, W(i +1, i), ione, A(i +1, i), ione, &value); - */ - blasf77_zdotc(&value, &i_n, W(i+1,i), &ione, A(i+1, i), &ione); + //blasf77_zdotc(&value, &i_n, W(i+1,i), &ione, A(i+1, i), &ione); alpha = tau[i]* -.5f * value; #else alpha = tau[i]* -.5f* blasf77_zdotc(&i_n, W(i+1,i), &ione, A(i+1, i), &ione);
と修正.clatrd.cppでも同様のエラーが発生したので,修正
--- magma_1.0.0.orig/src/clatrd.cpp 2011-08-29 12:25:59.000000000 +0900 +++ magma_1.0.0/src/clatrd.cpp 2011-10-25 20:11:37.000000000 +0900 @@ -254,7 +254,8 @@ blasf77_cscal(&i, &tau[i - 1], W(0, iw), &ione); #if defined(PRECISION_z) || defined(PRECISION_c) - blasf77_cdotc(&value, &i, W(0, iw), &ione, A(0, i), &ione); + cblas_cdotc_sub(i, W(0, iw), ione, A(0, i), ione, &value); + //blasf77_cdotc(&value, &i, W(0, iw), &ione, A(0, i), &ione); alpha = tau[i - 1] * -.5f * value; #else alpha = tau[i - 1] * -.5f * blasf77_cdotc(&i, W(0, iw), &ione, A(0, i), &ione); @@ -333,11 +334,9 @@ out version works with MKL but is not a standard interface for other BLAS zdoc implementations */ - /* cblas_cdotc_sub(i_n, W(i +1, i), ione, A(i +1, i), ione, &value); - */ - blasf77_cdotc(&value, &i_n, W(i+1,i), &ione, A(i+1, i), &ione); + //blasf77_cdotc(&value, &i_n, W(i+1,i), &ione, A(i+1, i), &ione); alpha = tau[i]* -.5f * value; #else alpha = tau[i]* -.5f* blasf77_cdotc(&i_n, W(i+1,i), &ione, A(i+1, i), &ione);
ちなみに,make.inc.gotoは,↓のように変更した.
--- magma_1.0.0.orig/make.inc.goto 2011-04-06 13:12:19.000000000 +0900 +++ magma_1.0.0/make.inc.goto 2011-10-25 20:21:52.000000000 +0900 @@ -16,7 +16,7 @@ GPU_TARGET = 0 CC = gcc -NVCC = nvcc +NVCC = /usr/local/cuda3/bin/nvcc FORT = gfortran ARCH = ar @@ -28,11 +28,11 @@ NVOPTS = --compiler-options -fno-strict-aliasing -DUNIX -O3 -DADD_ LDOPTS = -fPIC -Xlinker -zmuldefs -LIB = -lgoto -lpthread -lcublas -lcudart -llapack -lm +LIB = -lgoto2 -lpthread -lcublas -lcudart -llapack -lm -CUDADIR = /usr/local/cuda +CUDADIR = /usr/local/cuda3 -LIBDIR = -L/bummer/GotoBLAS -L/usr/local/cuda/lib64 -L/usr/lib64 +LIBDIR = -L/opt/GotoBLAS2 -L/usr/local/cuda3/lib64 -L/usr/lib64 INC = -I$(CUDADIR)/include LIBMAGMA = ../lib/libmagma.a
zlatrd.cpp.patch(214)
clatrd.cpp.patch(213)
make.inc.goto.patch(201)
モノ書きモード
工作モードからシフトチェンジせねば.