Install trouble on Ubuntu 14.04.4 LTS

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

Install trouble on Ubuntu 14.04.4 LTS

Postby troyrock » Wed May 11, 2016 2:18 pm

I'm running Ubuntu 14.04.4 LTS but having difficulty getting make test to work.

I get errors that look like Magma can't find the LAPACK. I have installed OpenBLAS as well as LAPACK3. It looks like openblas libraries are installed in /usr/lib and /usr/lib/openblas-base. $OPENBLASDIR is set to /usr and the command line looks like:
Code: Select all
g++ -fPIC              -fopenmp -Wl,-rpath,../lib \
   -o testing/testing_sgemm testing/testing_sgemm.o \
   -L./lib -lmagma \
   -L./testing -ltest \
   -L./testing/lin -llapacktest \
   -L/usr/local/cuda/lib64 -L/usr/lib -lopenblas -lcublas -lcusparse -lcudart

I get errors like the following:
testing/testing_sgemm.o: In function `main':
testing_sgemm.cpp:(.text.startup+0x208): undefined reference to `slange_'
testing_sgemm.cpp:(.text.startup+0x256): undefined reference to `slange_'
testing_sgemm.cpp:(.text.startup+0x60c): undefined reference to `slarnv_'
testing_sgemm.cpp:(.text.startup+0x629): undefined reference to `slarnv_'
testing_sgemm.cpp:(.text.startup+0x64b): undefined reference to `slarnv_'
testing_sgemm.cpp:(.text.startup+0xbcd): undefined reference to `slange_'
testing_sgemm.cpp:(.text.startup+0xc16): undefined reference to `slange_'
testing_sgemm.cpp:(.text.startup+0xc6b): undefined reference to `slange_'
./lib/libmagma.so: undefined reference to `dorgql_'
./lib/libmagma.so: undefined reference to `ssteqr_'
./lib/libmagma.so: undefined reference to `dlaqp2_'
...

I'm probably missing something obvious. Any assistance is appreciated.
Last edited by troyrock on Wed May 11, 2016 6:08 pm, edited 1 time in total.
troyrock
 
Posts: 3
Joined: Wed May 11, 2016 2:05 pm

Re: Install trouble on Ubuntu 14.04.4 LTS

Postby mgates3 » Wed May 11, 2016 4:53 pm

Try adding -llapack, most likely before -lopenblas.
I typically download OpenBLAS with LAPACK compiled into it, so there's just one library, but Ubuntu may package OpenBLAS as just the BLAS routines, requiring LAPACK separately.

http://packages.ubuntu.com/trusty/i386/ ... 3/filelist

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

Re: Install trouble on Ubuntu 14.04.4 LTS

Postby troyrock » Wed May 11, 2016 6:18 pm

This did indeed help. I am getting different problems now.

Code: Select all
g++ -fPIC              -fopenmp -Wl,-rpath,../lib \
   -o testing/testing_sgemm testing/testing_sgemm.o \
   -L./lib -lmagma \
   -L./testing -ltest \
   -L./testing/lin -llapacktest \
   -L/usr/local/cuda/lib64 -L/usr/lib -llapack -lopenblas -lcublas -lcusparse -lcudart
/usr/lib/liblapack.so: undefined reference to `ATL_scopy'
/usr/lib/liblapack.so: undefined reference to `ATL_stpsv'
/usr/lib/liblapack.so: undefined reference to `ATL_saxpy'
/usr/lib/liblapack.so: undefined reference to `ATL_srotg'
/usr/lib/liblapack.so: undefined reference to `ATL_cher2k'
/usr/lib/liblapack.so: undefined reference to `ATL_ztrsv'
/usr/lib/liblapack.so: undefined reference to `ATL_zherk'
/usr/lib/liblapack.so: undefined reference to `ATL_zhpr'
/usr/lib/liblapack.so: undefined reference to `ATL_cswap'
...


This looks like it may be related to ATLAS so I included -latlas (blindly guessing) but that doesn't seem to make any difference. Again, I'm thankful for any help.
troyrock
 
Posts: 3
Joined: Wed May 11, 2016 2:05 pm

Re: Install trouble on Ubuntu 14.04.4 LTS

Postby mgates3 » Fri May 13, 2016 4:22 pm

I would also guess that ATL is from ATLAS. That implies the LAPACK library is linked with ATLAS, not OpenBLAS. You can check whether liblapack.a (or .so) requires those routines ("U" below), and whether libatlas.a (or .so) provides those routines ("T" below) using nm:

Code: Select all
bunsen atlas-gcc/lib> nm liblapack.a | grep ATL_sscal
                 U ATL_sscal

bunsen atlas-gcc/lib> nm libatlas.a | grep ATL_sscal
                 U ATL_sscal
                 U ATL_sscal
                 U ATL_sscal
ATL_sscal.o:
0000000000000000 T ATL_sscal


Ultimately, this depends on what libraries, and how, the Ubuntu maintainers decided to link together. Check whether the Ubuntu docs have any help. Once you figure out how to link with LAPACK and BLAS, then linking in MAGMA should follow immediately.

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

Re: Install trouble on Ubuntu 14.04.4 LTS

Postby troyrock » Mon May 16, 2016 12:45 pm

I did get this working and wanted to close the loop to post what the trouble was in case someone ends up with something similar. I apparently had conflicting packages installed. I removed all LAPACK/BLAS/ATLAS packages and installed libopenblas-dev and liblapack-dev only and now everything compiles properly.
troyrock
 
Posts: 3
Joined: Wed May 11, 2016 2:05 pm


Return to User discussion

Who is online

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

cron