Linking errors compiling clMAGMA

Open discussion for MAGMA

Linking errors compiling clMAGMA

Postby solenskiner » Mon Oct 22, 2012 2:40 pm

Hello

I am having some problems getting clMAGMA to compile, which I hope I can have some help with. When compiling clMAGMA I get the error:

Code: Select all
g++ -O0 -DADD_ -g -Wall -DHAVE_clAmdBlas -DHAVE_CBLAS -fPIC -Xlinker -zmuldefs  testing_zpotrf_gpu.o  -o testing_zpotrf_gpu lin/liblapacktest.a \
        -L../lib -lclmagma -lclmagmablas -L/usr/local/bin/acml/gfortran64/lib -L/usr/local/bin/acml/gfortran64_mp/lib -L/usr/local/bin/clAmdBlas/lib64 -lacml_mp -lacml_mv -lclAmdBlas -lOpenCL
../lib/libclmagma.a(magmablas_z.o): In function `magma_zher2k':
/home/floyd/Downloads/amd/clmagma-0.3.0/interface_opencl/magmablas_z.cpp:378: undefined reference to `cblas_zher2k'
collect2: error: ld returned 1 exit status
make[1]: *** [testing_zpotrf_gpu] Error 1
make[1]: Leaving directory `/home/floyd/Downloads/amd/clmagma-0.3.0/testing'
make: *** [test] Error 2


It seems clMAGMA is not compatible with the ACML version 5.2 or clAmdBlas 1.8 or that I have made a mistake somewhere. I attached my make.ink just in case.

Thank you kindly,
Attachments
make.inc.txt
(1.37 KiB) Downloaded 164 times
solenskiner
 
Posts: 2
Joined: Mon Oct 22, 2012 2:22 pm

Re: Linking errors compiling clMAGMA

Postby mb_infn_it » Thu Oct 25, 2012 5:14 am

solenskiner wrote:g++ -O0 -DADD_ -g -Wall -DHAVE_clAmdBlas -DHAVE_CBLAS -fPIC -Xlinker -zmuldefs testing_zpotrf_gpu.o -o testing_zpotrf_gpu lin/liblapacktest.a \
-L../lib -lclmagma -lclmagmablas -L/usr/local/bin/acml/gfortran64/lib -L/usr/local/bin/acml/gfortran64_mp/lib -L/usr/local/bin/clAmdBlas/lib64 -lacml_mp -lacml_mv -lclAmdBlas -lOpenCL
../lib/libclmagma.a(magmablas_z.o): In function `magma_zher2k':
/home/floyd/Downloads/amd/clmagma-0.3.0/interface_opencl/magmablas_z.cpp:378: undefined reference to `cblas_zher2k'
collect2: error: ld returned 1 exit status
make[1]: *** [testing_zpotrf_gpu] Error 1
make[1]: Leaving directory `/home/floyd/Downloads/amd/clmagma-0.3.0/testing'
make: *** [test] Error 2

You're trying to compile source against cblas lib (-DHAVE_CBLAS) without linking it.
That function `cblas_zher2k' is referred to standard cblas lib, and not to clAmdBlas, so it can be provided in different ways.
If you're compiling under linux system, it will simply fix by installing gsl lib http://www.gnu.org/software/gsl/ on your machine and adding -lgsl when compiling that source. You can add -lgsl in make.inc here:

Code: Select all
...
LIB     += -lOpenCL -lgsl -lclAmdBlas
...
mb_infn_it
 
Posts: 7
Joined: Wed Oct 10, 2012 4:39 am

Re: Linking errors compiling clMAGMA

Postby mgates3 » Thu Oct 25, 2012 1:41 pm

Right, ACML doesn't provide CBLAS, which is a C-interface wrapper around the Fortran BLAS routines. You can obtain CBLAS from
http://www.netlib.org/blas/blast-forum/cblas.tgz
After installing CBLAS, add -lcblas to LIB in make.inc.
-mark
mgates3
 
Posts: 424
Joined: Fri Jan 06, 2012 2:13 pm

Re: Linking errors compiling clMAGMA

Postby solenskiner » Thu Dec 06, 2012 12:33 pm

Oh sorry, thought i would get an email on response. I'll try that out this weekend. Thanks!
solenskiner
 
Posts: 2
Joined: Mon Oct 22, 2012 2:22 pm


Return to User discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron