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.
