Page 1 of 1

Install trouble on Ubuntu 14.04.4 LTS

Posted: Wed May 11, 2016 2:18 pm
by troyrock
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.

Re: Install trouble on Ubuntu 14.04.4 LTS

Posted: Wed May 11, 2016 4:53 pm
by mgates3
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

Re: Install trouble on Ubuntu 14.04.4 LTS

Posted: Wed May 11, 2016 6:18 pm
by troyrock
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.

Re: Install trouble on Ubuntu 14.04.4 LTS

Posted: Fri May 13, 2016 4:22 pm
by mgates3
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

Re: Install trouble on Ubuntu 14.04.4 LTS

Posted: Mon May 16, 2016 12:45 pm
by troyrock
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.