Any guidance you can give me will be valuable.
I want to complile examples with CHOLESKY and LU with NVCC (include MAGMA + CUBLAS)
The data of the machine and CUDA in my project are the following.
----------------------------------
Code: Select all
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
VGA compatible controller [0300]: NVIDIA Corporation GF108M [GeForce GT 635M]
NVIDIA CUDA 6.5
----------------------------------
My configuration is:
0) First of all i install these required packages:
sudo apt-get install libatlas-base-dev liblapack-dev libf2c2-dev gfortran
1) Modify the make.inc.atlas to make.inc
2) Change the paths but i have some questions about shared and static library.
----------
FIRST CASE
----------
First Case: If FPIC = FPIC i build a static library.
At this case i have problem when i try to compile an example
( fatal error: magma.h: No such file or directory ) but the magma.h there is at directory ~.bashrc EXPORT=/usr/local/magma/include:$EXPORT).
=================================================================================================================
Code: Select all
#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.6.1) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# @date January 2015
#//////////////////////////////////////////////////////////////////////////////
# GPU_TARGET contains one or more of Tesla, Fermi, or Kepler,
# to specify for which GPUs you want to compile MAGMA:
# Tesla - NVIDIA compute capability 1.x cards (no longer supported in CUDA 6.5)
# Fermi - NVIDIA compute capability 2.x cards
# Kepler - NVIDIA compute capability 3.x cards
# The default is "Fermi Kepler".
# See http://developer.nvidia.com/cuda-gpus
#
GPU_TARGET = Fermi Kepler
CC = gcc
CXX = g++
NVCC = /usr/local/cuda-6.5/bin/nvcc
FORT = gfortran -DCUBLAS_GFORTRAN
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
# Use -fPIC to make shared (.so) and static (.a) library;
# can be commented out if making only static library.
##
## Our ATLAS installation has only static libraries, and one can't
## build a shared library against a static library, so disable FPIC.
#FPIC = -fPIC
CFLAGS = -O3 $(FPIC) -DADD_ -Wall -fopenmp -DMAGMA_SETAFFINITY
FFLAGS = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
F90FLAGS = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
NVCCFLAGS = -O3 -DADD_ -Xcompiler "-fno-strict-aliasing $(FPIC)"
LDFLAGS = $(FPIC) -fopenmp
# Depending on how ATLAS and LAPACK were compiled, you may need one or more of:
# -lifcore -ldl -lf2c -lgfortran
LIB = -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran
# define library directories preferably in your environment, or here.
LAPACKDIR = /usr/lib/lapack
ATLASDIR = /usr/lib/atlas-base
CUDADIR = /usr/local/cuda-6.5
-include make.check-atlas
-include make.check-cuda
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(ATLASDIR)/lib
INC = -I$(CUDADIR)/include
2.1) I make the Library with : sudo make lib
And these are the results:
Code: Select all
=============================================
compile for CUDA arch 2.x (Fermi)
compile for CUDA arch 3.0 (Kepler)
compile for CUDA arch 3.5 (Kepler)
======================================== magmablas
( cd magmablas && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
======================================== src
( cd src && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/src'
======================================== control
( cd control && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/control'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/control'
======================================== interface
( cd interface_cuda && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
=========================================================================================================
Code: Select all
=========================================================================================================
compile for CUDA arch 2.x (Fermi)
compile for CUDA arch 3.0 (Kepler)
compile for CUDA arch 3.5 (Kepler)
======================================== magmablas
( cd magmablas && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
======================================== src
( cd src && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/src'
======================================== control
( cd control && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/control'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/control'
======================================== interface
( cd interface_cuda && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
======================================== testing
( cd testing && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/testing'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/testing'
=========================================================================================================
2.3) I install the Library with: sudo make install prefix=/usr/local/magma
Code: Select all
=========================================================================================================
compile for CUDA arch 2.x (Fermi)
compile for CUDA arch 3.0 (Kepler)
compile for CUDA arch 3.5 (Kepler)
======================================== magmablas
( cd magmablas && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/magmablas'
======================================== src
( cd src && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/src'
======================================== control
( cd control && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/control'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/control'
======================================== interface
( cd interface_cuda && make )
make[1]: Entering directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2/interface_cuda'
mkdir -p /usr/local/magma
mkdir -p /usr/local/magma/include
mkdir -p /usr/local/magma/lib
mkdir -p /usr/local/magma/lib/pkgconfig
# MAGMA
cp ./include/*.h /usr/local/magma/include
cp ./lib/libmagma.a /usr/local/magma/lib
cp ./lib/libmagma.so /usr/local/magma/lib
cp: cannot stat `./lib/libmagma.so': No such file or directory
make: [install] Error 1 (ignored)
cp /usr/local/magma/lib
cp: missing destination file operand after `/usr/local/magma/lib'
Try `cp --help' for more information.
make: [install] Error 1 (ignored)
# QUARK
# cp /include/quark.h /usr/local/magma/include
# cp /include/quark_unpack_args.h /usr/local/magma/include
# cp /include/icl_hash.h /usr/local/magma/include
# cp /include/icl_list.h /usr/local/magma/include
# cp /lib/libquark.a /usr/local/magma/lib
# pkgconfig
cat ./lib/pkgconfig/magma.pc.in | \
sed -e s:@INSTALL_PREFIX@:"/usr/local/magma": | \
sed -e s:@CFLAGS@:"-DADD_ -fopenmp -DHAVE_CUBLAS -I/usr/local/cuda-6.5/include": | \
sed -e s:@LIBS@:"-fopenmp -L/usr/local/cuda-6.5/lib64 -L/usr/lib/lapack -L/usr/lib/atlas-base/lib -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran ": | \
sed -e s:@MAGMA_REQUIRED@:: \
> /usr/local/magma/lib/pkgconfig/magma.pc
=========================================================================================================
SECOND CASE
-----------
Second Case: If FPIC = -fPIC then build a shared library. At this case i have errors from the begin.
Code: Select all
==========================================================================================================
#//////////////////////////////////////////////////////////////////////////////
# -- MAGMA (version 1.6.1) --
# Univ. of Tennessee, Knoxville
# Univ. of California, Berkeley
# Univ. of Colorado, Denver
# @date January 2015
#//////////////////////////////////////////////////////////////////////////////
# GPU_TARGET contains one or more of Tesla, Fermi, or Kepler,
# to specify for which GPUs you want to compile MAGMA:
# Tesla - NVIDIA compute capability 1.x cards (no longer supported in CUDA 6.5)
# Fermi - NVIDIA compute capability 2.x cards
# Kepler - NVIDIA compute capability 3.x cards
# The default is "Fermi Kepler".
# See http://developer.nvidia.com/cuda-gpus
#
GPU_TARGET = Fermi Kepler
CC = gcc
CXX = g++
NVCC = /usr/local/cuda-6.5/bin/nvcc
FORT = gfortran -DCUBLAS_GFORTRAN
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
# Use -fPIC to make shared (.so) and static (.a) library;
# can be commented out if making only static library.
##
## Our ATLAS installation has only static libraries, and one can't
## build a shared library against a static library, so disable FPIC.
FPIC = -fPIC
CFLAGS = -O3 $(FPIC) -DADD_ -Wall -fopenmp -DMAGMA_SETAFFINITY
FFLAGS = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
F90FLAGS = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
NVCCFLAGS = -O3 -DADD_ -Xcompiler "-fno-strict-aliasing $(FPIC)"
LDFLAGS = $(FPIC) -fopenmp
# Depending on how ATLAS and LAPACK were compiled, you may need one or more of:
# -lifcore -ldl -lf2c -lgfortran
LIB = -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran
# define library directories preferably in your environment, or here.
LAPACKDIR = /usr/lib/lapack
ATLASDIR = /usr/lib/atlas-base
CUDADIR = /usr/local/cuda-6.5
-include make.check-atlas
-include make.check-cuda
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(ATLASDIR)/lib
INC = -I$(CUDADIR)/include
=======================================================================
And these are the results:
Code: Select all
=============================================
.o magmablas/zsymv.o magmablas/zsymv_upper.o magmablas/ztranspose_inplace.o magmablas/ztranspose.o magmablas/ztrsm_batched.o magmablas/ztrsm.o magmablas/ztrtri_diag_batched.o magmablas/ztrtri_diag.o magmablas/ztrtri_lower.o magmablas/ztrtri_upper.o \
-L/usr/local/cuda-6.5/lib64 -L/usr/lib/lapack -L/usr/lib/atlas-base/lib \
-llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran
/usr/bin/ld: src/cbulge_applyQ.o: relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
src/cbulge_applyQ.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [lib/libmagma.so] Error 1
make[1]: Leaving directory `/home/kostas/Desktop/magma-1.6.2'
make: *** [shared] Error 2
==========================================================================================================
I would greatly appreciate it if you provide me with any information on the above.