MAGMA 1.0 RC5 - testing

Open discussion for MAGMA

MAGMA 1.0 RC5 - testing

Postby mknap » Thu Aug 04, 2011 2:40 am

I have spent the last couple of evenings discovering MAGMA, compiling dependencies, editing make.inc, having lots of fun. I have some C background, but have mostly been using matlab for research purposes for the last couple of years. My interest is in harnessing the MAGMA library for some algorithms which I have developed in my studies.

I seem to have compiled and linked magma without any errors, but I cannot link the tests. I have tried different routes and end up with the same error for both routes. I have cuda 4.0 and no other installations of cuda (suggested to check in other threads). Using 64 bit linux ubuntu with latest nvidia drivers. cuda compiles and tests fine. Geforce GTX260Ti .

For my first attempt, I went with an atlas install; make.inc looks like this :
Code: Select all
GPU_TARGET = 1

CC        = gcc
NVCC      = nvcc
FORT      = gfortran

ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib

OPTS      = -O3 -DADD_
FOPTS     = -O3 -DADD_ -x f95-cpp-input
NVOPTS    = --compiler-options -fno-strict-aliasing -DUNIX -O3 -DADD_
LDOPTS    = -fPIC -Xlinker -zmuldefs

#LIB       = /home/tomov/LIB/lapack-lite-3.1.1/lapack_LINUX64.a \
#            -lf77blas -latlas -lcblas -lf2c -lcublas -lm

LIB        = -latlas -lcublas -lm

CUDADIR   = /usr/local/cuda

LIBDIR        = -L/home/mknap/Downloads/ATLAS/mybuild/lib \
          -L$(CUDADIR)/lib64

#LIBDIR    = -L/home/tomov/LIB/ATLAS/lib/Linux_UNKNOWNSSE2 \
#            -L/home/tomov/LIB/CLAPACK-3.1.1/F2CLIBS/ \
#            -L$(CUDADIR)/lib64

INC       = -I$(CUDADIR)/include

LIBMAGMA     = ../lib/libmagma.a
LIBMAGMABLAS = ../lib/libmagmablas.a


and I have some undefined references:
Code: Select all
testing_zgemm.o: In function `main':
testing_zgemm.cpp:(.text+0x4f1): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x516): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x53b): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x939): undefined reference to `zaxpy_'
testing_zgemm.cpp:(.text+0x96b): undefined reference to `zlange_'
../lib/libmagma.a(auxiliary.o): In function `swp2pswp':
auxiliary.cpp:(.text+0x1093): undefined reference to `lsame_'
collect2: ld returned 1 exit status


My second attempt, I followed the beginner route with plasma. Plasma installed and tested fine. I did a make clean and a make cleanall for magma, and used the following make.inc file:
Code: Select all
GPU_TARGET = 1

   CC        = gcc
   NVCC      = nvcc
   FORT      = gfortran

   ARCH      = ar
   ARCHFLAGS = cr
   RANLIB    = ranlib

   OPTS      = -DADD_ -O3
   FOPTS     = -DADD_ -O3  -x f95-cpp-input
   NVOPTS    =   --compiler-options -DUNIX -O3 -DADD_
   LDOPTS    = -fPIC -Xlinker -zmuldefs

   #LIB       = -lmkl_em64t -lguide -lpthread -lcublas -lm
   
   LIB   = -lrefblas -lcublas -lm
   
   CUDADIR   = /usr/local/cuda

   #LIBDIR    = -L/home/tomov/intel/mkl/10.0.1.014/lib/em64t \
        #            -L$(CUDADIR)/lib64
   
   LIBDIR    = -L/home/mknap/Downloads/plasma-installer_2.4.1/lasma/lib \
          -L$(CUDADIR)/lib64

   INC       = -I../include -I$(CUDADIR)/include
         

   LIBMAGMA     = ../lib/libmagma.so
   LIBMAGMABLAS = ../lib/libmagmablas.so


Again, here is the link error for the magma testing code:
Code: Select all
gcc  -DADD_ -O3  -DGPUSHMEM=200 -fPIC -Xlinker -zmuldefs -DGPUSHMEM=200  testing_zgemm.o  -o testing_zgemm lin/liblapacktest.a -L../lib \
          -lcuda -lmagma -lmagmablas -lmagma -L/home/mknap/Downloads/plasma-installer_2.4.1/lasma/lib -L/usr/local/cuda/lib64  -lrefblas -lcublas -lm
testing_zgemm.o: In function `main':
testing_zgemm.cpp:(.text+0x4f1): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x516): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x53b): undefined reference to `zlarnv_'
testing_zgemm.cpp:(.text+0x96b): undefined reference to `zlange_'
collect2: ld returned 1 exit status


I have also just compiled gotoblas, but I haven't attempted to compile and link MAGMA with it yet. I'll post any new results tomorrow. Until then, can anyone tell me what I am missing? I am certain that I need to learn a lot of basic linux development things here - probably not specific to MAGMA. For one, I couldn't find in the man page what the -Xlinker arg is for ld. Also, I need to learn the specifics of the -l<name> flag. It seems that if ld.so.conf (or ld.so.conf.d/*.conf) is configured properly, then one shouldn't have to also supply the -L/path/to/lib<name> argument. Is that correct ? If so, how does one go about properly setting up the shared libraries?

I look forward to more learning and using MAGMA.
mknap
 
Posts: 1
Joined: Thu Aug 04, 2011 12:28 am

Re: MAGMA 1.0 RC5 - testing

Postby Stan Tomov » Thu Aug 11, 2011 5:24 pm

Hi,
Glad to hear you have fun with MAGMA! The undefined functions are part of LAPACK which is dependence and has to be installed and added to LIB in make.inc. You can see and make.inc.... example files (e.g., make.inc.atlas).
Stan
Stan Tomov
 
Posts: 251
Joined: Fri Aug 21, 2009 10:39 pm


Return to User discussion

Who is online

Users browsing this forum: Google [Bot] and 3 guests