Testing clMAGMA sample programs

Open discussion for MAGMA

Testing clMAGMA sample programs

Postby Gopal_HC » Sat Nov 30, 2013 7:58 am

Hi,

I am new user of clMAGMA, I want to use clMAGMA for one of my project.

System details:
Ubuntu 12.04 with AMD Tahiti GPU
OpenCL SDK version: OpenCL 1.2 AMD-APP
clMAGMA version: clmagma-1.1.0-beta2
clAMDBlas : clAmdBlas-1.10.321
acml : acml-4.4.0 (acml-4-4-0-gfortran-64bit-int641.tgz)

The modified make.inc file is ::

#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.1.0-beta2) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# @date November 2013
#//////////////////////////////////////////////////////////////////////////////
# setenv AMD_CLBLAS_STORAGE_PATH /home/tomov/cl_magma
# GPU_TARGET specifies for which GPU you want to compile MAGMA:
# "Tesla" (NVIDIA compute capability 1.x cards)
# "Fermi" (NVIDIA compute capability 2.x cards)
# "AMD" (clMAGMA with AMD cards)
# See http://developer.nvidia.com/cuda-gpus
GPU_TARGET = AMD

CC = g++
FORT = gfortran
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib

OPTS = -fPIC -O3 -DADD_ -Wall
FOPTS = -fPIC -O3 -DADD_ -Wall -x f95-cpp-input
F77OPTS = -fPIC -O3 -DADD_ -Wall
LDOPTS = -fPIC

#setting the clMAGMA dependency path
ACMLDIR = /home/gopal/setup/clMAGMA/myopt/acml-4.4.0
clBLAS = /home/gopal/setup/clMAGMA/myopt/clAmdBlas-1.10.321
AMDAPP = /opt/AMDAPP

#-include make.check-acml
-include make.check-clblas

#LIB = -lacml -lacml_mv
#LIB = -lacml_mp -lacml_mv -lcblas
LIB = -lacml_mp -lacml_mv
LIB += -lclAmdBlas -lOpenCL

LIBDIR = -L$(ACMLDIR)/gfortran64_int64/lib \
-L$(ACMLDIR)/gfortran64_mp_int64/lib \
-L$(clBLAS)/lib64 \
-L$(AMDAPP)/lib/x86_64

INC = -I$(clBLAS)/include \
-I$(AMDAPP)/include

I have set the path for required library in above make.inc file. And while testing clMAGMA's samples program available in (clmagma-1.1.0-beta2/testing) directory, i am getting following error:
[gopal@Dev clmagma-1.1.0-beta2]$ make
---------
---------
---------
g++ -fPIC -O3 -DADD_ -Wall -DHAVE_clAmdBlas -DHAVE_CBLAS -I/home/gopal/setup/clMAGMA/myopt/clAmdBlas-1.10.321/include -I/opt/AMDAPP/include -I../include -I../control -c clcompile.cpp -o clcompile.o
g++ -fPIC -o clcompile clcompile.o CL_MAGMA_RT.o \
-L/home/gopal/setup/clMAGMA/myopt/acml-4.4.0/gfortran64_int64/lib -L/home/gopal/setup/clMAGMA/myopt/acml-4.4.0/gfortran64_mp_int64/lib -L/home/gopal/setup/clMAGMA/myopt/clAmdBlas-1.10.321/lib64 -L/opt/AMDAPP/lib/x86_64 -lacml_mp -lacml_mv -lclAmdBlas -lOpenCL
./clcompile sinplace_transpose.cl
./clcompile: error while loading shared libraries: libacml_mp.so: cannot open shared object file: No such file or directory
make[1]: *** [sinplace_transpose.co] Error 127
make[1]: Leaving directory `/home/gopal/setup/clMAGMA/clMAGMA_1.1_27Nov_2013/clmagma-1.1.0-beta2/interface_opencl'
make: *** [libmagma] Error 2

The path of libacml_mp.so file is /home/gopal/setup/clMAGMA/myopt/acml-4.4.0/gfortran64_mp_int64/lib, which I have set in above make.inc file using bold line for LIBDIR. I think it is included, the what could be reason for getting this error.

Thanks in advance!
Gopal_HC
 
Posts: 6
Joined: Sat Nov 30, 2013 2:23 am

Re: Testing clMAGMA sample programs

Postby mgates3 » Sun Dec 01, 2013 2:43 am

The path probably needs to be added to your LD_LIBRARY_PATH in your environment, as well. E.g., for csh/tcsh, add in your .cshrc file:

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${ACMLDIR}/gfortran64_int64/lib:${ACMLDIR}/gfortran64_mp_int64/lib

assuming LD_LIBRARY_PATH already exists. Else just:

setenv LD_LIBRARY_PATH ${ACMLDIR}/gfortran64_int64/lib:${ACMLDIR}/gfortran64_mp_int64/lib

This is one reason to recommend setting ACMLDIR in your environment instead of in the make.inc file.

-mark
mgates3
 
Posts: 399
Joined: Fri Jan 06, 2012 2:13 pm

Re: Testing clMAGMA sample programs

Postby Gopal_HC » Sun Dec 01, 2013 6:55 am

Hi mark,

Thanks for the quick reply.
I fixed my error after setting LD_LIBRARY_PATH for acml and clamdblas library.

Now again when uncommented the following line in make.inc file:
LIB = -lacml_mp -lacml_mv -lcblas

and set the LD_LIBRARY_PATH for libcblas.so.3 shared library as "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/atlas"
I am getting the following error while installing clMAGMA using make command:
/usr/bin/ld: cannot find -lcblas

I think this is the linker error and hence first I installed cblas library and added CBLASDIR directory path to above make.inc file as below:

ACMLDIR = /home/gopal/setup/clMAGMA/myopt/acml-4.4.0
clBLAS = /home/gopal/setup/clMAGMA/myopt/clAmdBlas-1.10.321
CBLASDIR = /home/gopal/setup/clMAGMA/cblas/CBLAS/lib
AMDAPP = /opt/AMDAPP

LIBDIR = -L$(ACMLDIR)/gfortran64_int64/lib \
-L$(ACMLDIR)/gfortran64_mp_int64/lib \
-L$(clBLAS)/lib64 \
-L$(AMDAPP)/lib/x86_64 \
-L/usr/lib64/atlas

Still I am getting the same error: /usr/bin/ld: cannot find -lcblas
Can you please tell me, what I missed?
Gopal_HC
 
Posts: 6
Joined: Sat Nov 30, 2013 2:23 am

Re: Testing clMAGMA sample programs

Postby Gopal_HC » Sun Dec 01, 2013 6:57 am

Hi mark,
Thanx for the quick reply. after setting the LD_LIBRAY_PATH, I fixed the error !!

mgates3 wrote:The path probably needs to be added to your LD_LIBRARY_PATH in your environment, as well. E.g., for csh/tcsh, add in your .cshrc file:

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${ACMLDIR}/gfortran64_int64/lib:${ACMLDIR}/gfortran64_mp_int64/lib

assuming LD_LIBRARY_PATH already exists. Else just:

setenv LD_LIBRARY_PATH ${ACMLDIR}/gfortran64_int64/lib:${ACMLDIR}/gfortran64_mp_int64/lib

This is one reason to recommend setting ACMLDIR in your environment instead of in the make.inc file.

-mark
Gopal_HC
 
Posts: 6
Joined: Sat Nov 30, 2013 2:23 am


Return to User discussion

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests