problem in installing magma 3.0 on ubuntu 12.10 64bit

Open discussion for MAGMA

problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby cz0397 » Wed Feb 27, 2013 3:12 am

Hello:

I have some problems about installing MAGMA3.0 on ubuntu12.10.
my OS is 64bit, and I have installed gotoblas2,lapack and cuda5.
I have test lapack and cuda5, and it's all OK. I do not know how to test gotoblas2 manually.This my first question.

Then I begin to install magma. I revise 3 points in the make.inc.
Code: Select all
NVCC      = /usr/local/cuda-5.0/bin/nvcc
LIB       = -lgoto2  -lpthread -lcublas -lcudart -llapack -lm
LIBDIR    = -L/bummer/GotoBLAS -L/usr/local/cuda/lib64 -L/usr/lib


My second question is that if ‘-L/bummer/GotoBLAS' is correct. I can not find such a file as bummer.

Next, I type sudo make install. I meet the third problem as following.
Code: Select all
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/magmablas'
mkdir -p ./install
mkdir -p ./install/include
mkdir -p ./install/lib
mkdir -p ./install/lib/pkgconfig
cp ./include/*.h  ./install/include
cp ./lib/libmagma.a               ./install/lib
cp ./lib/libmagmablas.a           ./install/lib
cat ./lib/pkgconfig/magma.pc | \
       sed -e s:\__PREFIX:"./install":     | \
       sed -e s:\__LIBEXT:"-L/bummer/GotoBLAS -L/usr/local/cuda/lib64 -L/usr/lib -lgoto2  -lpthread -lcublas -lcudart -llapack -lm ":       \
       > ./install/lib/pkgconfig/magma.pc
cat: ./lib/pkgconfig/magma.pc: No such file or directory


I am new to magma and want to use it. Thank you for helping me!
cz0397
 
Posts: 15
Joined: Tue Feb 26, 2013 10:22 pm

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby Stan Tomov » Thu Feb 28, 2013 2:51 pm

You have to set
-L/bummer/GotoBLAS
to show the path where libgoto.a is on your system. So your make.inc should look something like this:
Code: Select all
...
OPTS      = -O3 -DADD_ -DCUBLAS_GFORTRAN
...
LIB       = -lgoto  -lpthread -lcublas -lcudart -llapack -lm

CUDADIR   = /usr/local/cuda-5.0

LIBDIR    = -L/path-to-goto-blas  -L$(CUDADIR)/lib64  -L/usr/lib64
INC       = -I$(CUDADIR)/include

Post your make.inc if you have problems and what is the output when you type make. I would recommend to install it first in your local directory and if successful then move it to the system directories.
Stan
Stan Tomov
 
Posts: 251
Joined: Fri Aug 21, 2009 10:39 pm

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby cz0397 » Sat Mar 02, 2013 5:55 am

Thank you for your help. But I still have the question.

Code: Select all
happy@ubuntu:~/Downloads/magma-1.3.0$ sudo make install
( cd control        && make )
make[1]: Entering directory `/home/happy/Downloads/magma-1.3.0/control'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/control'
( cd interface_cuda && make )
make[1]: Entering directory `/home/happy/Downloads/magma-1.3.0/interface_cuda'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/interface_cuda'
( cd src            && make )
make[1]: Entering directory `/home/happy/Downloads/magma-1.3.0/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/src'
( cd magmablas      && make )
make[1]: Entering directory `/home/happy/Downloads/magma-1.3.0/magmablas'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/magmablas'
mkdir -p ./install
mkdir -p ./install/include
mkdir -p ./install/lib
mkdir -p ./install/lib/pkgconfig
cp ./include/*.h  ./install/include
cp ./lib/libmagma.a               ./install/lib
cp ./lib/libmagmablas.a           ./install/lib
cat ./lib/pkgconfig/magma.pc | \
       sed -e s:\__PREFIX:"./install":     | \
       sed -e s:\__LIBEXT:"-L/home/happy/Downloads/GotoBLAS2 -L/usr/local/cuda/lib64 -L/usr/lib -lgoto2  -lpthread -lcublas -lcudart -llapack -lm ":       \
       > ./install/lib/pkgconfig/magma.pc
cat: ./lib/pkgconfig/magma.pc: No such file or directory


and my make.inc is

Code: Select all
GPU_TARGET = Fermi

CC        = gcc
NVCC      = /usr/local/cuda-5.0/bin/nvcc
FORT      = gfortran

ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib

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

LIB       = -lgoto2  -lpthread -lcublas -lcudart -llapack -lm

CUDADIR   = /usr/local/cuda-5.0

LIBDIR    = -L/home/happy/Downloads/GotoBLAS2 -L/usr/local/cuda/lib64 -L/usr/lib
INC       = -I$(CUDADIR)/include


It is GOTOBLAS2 that I install, and its path is /home/happy/Downloads/GotoBLAS2. In addition, I copy the goto2.a to the /usr/lib as well as /usr/local/lib, the same to lapack and blas(installed with lapack at the same time).

For LIBDIR, my ubuntu does not have the file /usr/lib64, only lib and lib32, so I choose the lib.

Thank you for answering.
cz0397
 
Posts: 15
Joined: Tue Feb 26, 2013 10:22 pm

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby Stan Tomov » Sat Mar 02, 2013 3:05 pm

Good, so it looks like the libraries were created. You can ignore that last command for now. I'll double check with the other developers, but it looks like the last command in the Makefile for install should be
Code: Select all
cat $(MAGMA_DIR)/lib/pkgconfig/magma.pc.in | \
        ...

instead of
Code: Select all
cat $(MAGMA_DIR)/lib/pkgconfig/magma.pc | \
        ...

In any case, you have to try to make the examples and test. You can go in the testing directory and type make and if try some of the examples if you manage to link them.
One thing that I see you must change in your make.inc is to replace
Code: Select all
LIBDIR    = -L/home/happy/Downloads/GotoBLAS2 -L/usr/local/cuda/lib64 -L/usr/lib

by
Code: Select all
LIBDIR    = -L/home/happy/Downloads/GotoBLAS2 -L$(CUDADIR)/lib64 -L/usr/lib
Stan Tomov
 
Posts: 251
Joined: Fri Aug 21, 2009 10:39 pm

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby cz0397 » Mon Mar 04, 2013 4:53 am

Oh, I know.I will use $(CUDADIR) in future.And adding in does not solve the problem, and then I ignore it. But when I make in the testing, I meet another problem:

Code: Select all
happy@ubuntu:~/Downloads/magma-1.3.0/testing$ make
cd lin && make liblapacktest.a
make[1]: Entering directory `/home/happy/Downloads/magma-1.3.0/testing/lin'
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zbdt01.f -o zbdt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zget22.f -o zget22.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zhet21.f -o zhet21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zhst01.f -o zhst01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zunt01.f -o zunt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zqpt01.f -o zqpt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zqrt02.f -o zqrt02.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zlarfy.f -o zlarfy.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c zstt21.f -o zstt21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cbdt01.f -o cbdt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cget22.f -o cget22.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c chet21.f -o chet21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c chst01.f -o chst01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cunt01.f -o cunt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cqpt01.f -o cqpt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cqrt02.f -o cqrt02.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c clarfy.f -o clarfy.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c cstt21.f -o cstt21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dbdt01.f -o dbdt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dget22.f -o dget22.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dsyt21.f -o dsyt21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dhst01.f -o dhst01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dort01.f -o dort01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dqpt01.f -o dqpt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dqrt02.f -o dqrt02.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dlarfy.f -o dlarfy.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c dstt21.f -o dstt21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sbdt01.f -o sbdt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sget22.f -o sget22.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c ssyt21.f -o ssyt21.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c shst01.f -o shst01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sort01.f -o sort01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sqpt01.f -o sqpt01.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sqrt02.f -o sqrt02.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c slarfy.f -o slarfy.o
gfortran -O3 -DADD_ -I/usr/local/cuda-5.0/include -I../../include -c sstt21.f -o sstt21.o
ar cr liblapacktest.a zbdt01.o zget22.o zhet21.o zhst01.o zunt01.o zqpt01.o zqrt02.o zlarfy.o zstt21.o cbdt01.o cget22.o chet21.o chst01.o cunt01.o cqpt01.o cqrt02.o clarfy.o cstt21.o dbdt01.o dget22.o dsyt21.o dhst01.o dort01.o dqpt01.o dqrt02.o dlarfy.o dstt21.o sbdt01.o sget22.o ssyt21.o shst01.o sort01.o sqpt01.o sqrt02.o slarfy.o sstt21.o
ranlib liblapacktest.a
make[1]: Leaving directory `/home/happy/Downloads/magma-1.3.0/testing/lin'
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_util.cpp -o testing_util.o
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_zutil.cpp -o testing_zutil.o
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_cutil.cpp -o testing_cutil.o
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_dutil.cpp -o testing_dutil.o
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_sutil.cpp -o testing_sutil.o
ar cr libtest.a testing_zutil.o testing_cutil.o testing_dutil.o testing_sutil.o testing_util.o
ranlib libtest.a
gcc -O3 -DADD_ -DCUBLAS_GFORTRAN -DHAVE_CUBLAS -DGPUSHMEM=200 -I/usr/local/cuda-5.0/include -I../include -I../control -c testing_zgemm.cpp -o testing_zgemm.o
gcc -fPIC -Xlinker -zmuldefs -DGPUSHMEM=200  testing_zgemm.o  -o testing_zgemm \
   libtest.a lin/liblapacktest.a -L../lib -lmagma -lmagmablas -lmagma \
   -L/home/happy/Downloads/GotoBLAS2 -L/usr/local/cuda-5.0/lib64 -L/usr/lib \
   -lgoto2  -lpthread -lcublas -lcudart -llapack -lm 
/home/happy/Downloads/GotoBLAS2/libgoto2.so: undefined reference to `_gfortran_concat_string'
/home/happy/Downloads/GotoBLAS2/libgoto2.so: undefined reference to `_gfortran_pow_i4_i4'
/home/happy/Downloads/GotoBLAS2/libgoto2.so: undefined reference to `_gfortran_compare_string'
collect2: ld returned 1 exit status
make: *** [testing_zgemm] Error 1


I search this problem on the Internet, and find that I miss -lgfortran.
I install through
Code: Select all
sudo apt-get install gfortran

But in my computer, usr/lib and usr/local/lib don't have such a lib.
Then I type
Code: Select all
find /usr *gfortran*
, from which I get
Code: Select all
find: `*gfortran*': No such file or directory

What should I do next?
Thanks!
cz0397
 
Posts: 15
Joined: Tue Feb 26, 2013 10:22 pm

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby mgates3 » Wed Mar 13, 2013 3:40 pm

I think your find syntax is not quite right. This is the syntax I would use:

find /usr -name '*gfortran*'

Note the quotes around '*fortran*', else the shell tries to expand the * wildcards before passing it to find, and there are no matches in the current directory.

Also, if you search all of /usr, shouldn't it at least find the gfortran executable, if not libgfortran?

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

Re: problem in installing magma 3.0 on ubuntu 12.10 64bit

Postby cz0397 » Tue Mar 19, 2013 7:48 am

Thanks. Now I decide to use MKL to install magma.
cz0397
 
Posts: 15
Joined: Tue Feb 26, 2013 10:22 pm


Return to User discussion

Who is online

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