Compile success, but tests failing [clmagma-1.3.0]

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

Compile success, but tests failing [clmagma-1.3.0]

Postby renold » Fri Oct 20, 2017 1:37 am

Hi, this is the first time I've tried to use MAGMA/OpenCL. I'm on Linux Mint 18.2, and I've installed lapack and blas from the ubuntu repositories, and clBLAS from the github repository. My make.inc file is as follows:

------------------------------------------------------------------------------------
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

# define library directories preferably in your environment, or here.
clBLAS = /opt/clBLAS
AMDAPP = /opt/AMDAPPSDK-3.0
LAPACKDIR = /usr/lib/lapack
BLASDIR = /usr/lib/openblas-base
-include make.check-clblas

#LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -fopenmp
LIB = -lclBLAS -lOpenCL -llapack -lopenblas

LIBDIR = -L$(clBLAS)/lib64 \
-L$(BLASDIR) \
-L$(LAPACKDIR)

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

I've compiled the library with "make shared" and/or "make lib" (I've "make clean"-ed multiple times trying different things) and it completes with no complaints. However, when I run "make test", I get the following errors:

--------------------------------------------------------------------------------------------------------
make[1]: Entering directory '/opt/clmagma-1.3.0/testing'
g++ -fPIC testing_zgemm.o -o testing_zgemm \
libtest.a lin/liblapacktest.a -L../lib -lclmagma \
-L/opt/clBLAS/lib64 -L/usr/lib/openblas-base -L/usr/lib/lapack \
-lclBLAS -lOpenCL -llapack -lopenblas
../lib/libclmagma.so: undefined reference to `magmablas_dznrm2_adjust'
../lib/libclmagma.so: undefined reference to `magmablas_zlascl_2x2'
../lib/libclmagma.so: undefined reference to `magmablas_cswap'
../lib/libclmagma.so: undefined reference to `magmablas_dtranspose_inplace'
../lib/libclmagma.so: undefined reference to `magmablas_dlat2s'
../lib/libclmagma.so: undefined reference to `magmablas_slaset'
../lib/libclmagma.so: undefined reference to `magmablas_zlanhe'
../lib/libclmagma.so: undefined reference to `magma_zlarfgtx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_stranspose'
../lib/libclmagma.so: undefined reference to `magmablas_ztranspose_inplace'
../lib/libclmagma.so: undefined reference to `magmablas_dlaset'
../lib/libclmagma.so: undefined reference to `magmablas_zlaswp'
../lib/libclmagma.so: undefined reference to `magmablas_slascl_2x2'
../lib/libclmagma.so: undefined reference to `magmablas_dznrm2'
../lib/libclmagma.so: undefined reference to `magmablas_zlacpy'
../lib/libclmagma.so: undefined reference to `magmablas_claswp'
../lib/libclmagma.so: undefined reference to `magmablas_zcaxpycp'
../lib/libclmagma.so: undefined reference to `magmablas_dnrm2'
../lib/libclmagma.so: undefined reference to `magma_clarfbx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_dtranspose'
../lib/libclmagma.so: undefined reference to `magmablas_scnrm2_adjust'
../lib/libclmagma.so: undefined reference to `magmablas_clag2z'
../lib/libclmagma.so: undefined reference to `magmablas_stranspose_inplace'
../lib/libclmagma.so: undefined reference to `magmablas_zlag2c'
../lib/libclmagma.so: undefined reference to `magmablas_zswap'
../lib/libclmagma.so: undefined reference to `magmablas_ztranspose'
../lib/libclmagma.so: undefined reference to `magmablas_zlacpy_cnjg'
../lib/libclmagma.so: undefined reference to `magmablas_claset'
../lib/libclmagma.so: undefined reference to `magmablas_scnrm2'
../lib/libclmagma.so: undefined reference to `magmablas_slaswp'
../lib/libclmagma.so: undefined reference to `magmablas_dlag2s'
../lib/libclmagma.so: undefined reference to `magmablas_slag2d'
../lib/libclmagma.so: undefined reference to `magmablas_dnrm2_adjust'
../lib/libclmagma.so: undefined reference to `magma_clarfgtx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_zlaset'
../lib/libclmagma.so: undefined reference to `magmablas_slacpy'
../lib/libclmagma.so: undefined reference to `magmablas_dlaswp'
../lib/libclmagma.so: undefined reference to `magmablas_clacpy_cnjg'
../lib/libclmagma.so: undefined reference to `magmablas_snrm2'
../lib/libclmagma.so: undefined reference to `magmablas_clascl_2x2'
../lib/libclmagma.so: undefined reference to `magmablas_dlacpy'
../lib/libclmagma.so: undefined reference to `magma_slarfgtx_gpu'
../lib/libclmagma.so: undefined reference to `magma_slarfbx_gpu'
../lib/libclmagma.so: undefined reference to `magma_dlarfgtx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_dlansy'
../lib/libclmagma.so: undefined reference to `magmablas_dsaxpycp'
../lib/libclmagma.so: undefined reference to `magma_dlarfbx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_clacpy'
../lib/libclmagma.so: undefined reference to `magmablas_zlat2c'
../lib/libclmagma.so: undefined reference to `magmablas_ctranspose'
../lib/libclmagma.so: undefined reference to `magmablas_snrm2_adjust'
../lib/libclmagma.so: undefined reference to `magmablas_dlascl_2x2'
../lib/libclmagma.so: undefined reference to `magma_zlarfbx_gpu'
../lib/libclmagma.so: undefined reference to `magmablas_sswap'
../lib/libclmagma.so: undefined reference to `magmablas_ctranspose_inplace'
../lib/libclmagma.so: undefined reference to `magmablas_dswap'
collect2: error: ld returned 1 exit status
Makefile:169: recipe for target 'testing_zgemm' failed
-------------------------------------------------------------------------------------------------------------------------------------

Any help on what I could be doing wrong?
renold
 
Posts: 2
Joined: Fri Oct 20, 2017 12:49 am

Re: Compile success, but tests failing [clmagma-1.3.0]

Postby mgates3 » Fri Oct 20, 2017 10:11 pm

Oddly, I had to add clmagmablas/*.o in two places below to make the shared library. In clmagma-1.3.0/Makefile:

Code: Select all
$(LIBMAGMA_SO): src/*.o control/*.o interface_opencl/*.o clmagmablas/*.o
   @echo ======================================== $(LIBMAGMA_SO)
   rm control/sizeptr.o interface_opencl/clcompile.o
   $(CC) $(LDOPTS) -shared -o $(LIBMAGMA_SO) \
   src/*.o control/*.o \
   interface_opencl/*.o \
   clmagmablas/*.o \
   $(LIBDIR) \
   $(LIB)


After that change, making tests worked. I don't remember having that problem before, but maybe we always compiled it as a static library, not a shared library.

(This old recursive Makefile structure really doesn't work well.)

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

Re: Compile success, but tests failing [clmagma-1.3.0]

Postby renold » Tue Oct 24, 2017 12:27 pm

Wow, that fixed it! Thanks!
renold
 
Posts: 2
Joined: Fri Oct 20, 2017 12:49 am


Return to User discussion

Who is online

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