creating libmagma.a in 'lib'.

Open discussion for MAGMA

creating libmagma.a in 'lib'.

Postby K_Synnott » Fri Jun 27, 2014 10:59 am

Hi,

I'm trying to set up magam 1.4.1 and following the instructions in the given README file. Everything works fine except when I go to run ' make shared '.

I get the following error:

Code: Select all
gcc -fPIC -Xlinker -zmuldefs -shared -o ./lib/libmagma.so \
   src/*.o control/*.o \
   interface_cuda/*.o magmablas/*.cu_o magmablas/*.o \
   -L/bummer/OpenBlas -L/usr/local/cuda-6.0/lib64 -L/usr/lib64 \
   -lblas  -lpthread -lcublas -lcudart -llapack -lm
/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 `/usr/local/magma/magma-1.4.1'
make: *** [shared] Error 2


Has anyone else come across this before. Please understand that I am completely new to magma.

Regards,
Kevin Synnott
K_Synnott
 
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: creating libmagma.a in 'lib'.

Postby hsahasra » Fri Jun 27, 2014 1:14 pm

You need to add -fPIC in all the compiler flags in make.inc file. For example:
Code: Select all
OPTS      = -fPIC -O3 -DADD_ -Wall -openmp -DMAGMA_WITH_MKL -DMAGMA_SETAFFINITY
F77OPTS   = -fPIC -O3 -DADD_ -warn all
FOPTS     = -fPIC -O3 -DADD_ -warn all
NVOPTS    = -O3 -DADD_ -Xcompiler "-fno-strict-aliasing -fPIC"
hsahasra
 
Posts: 27
Joined: Mon Jun 24, 2013 3:40 pm

Re: creating libmagma.a in 'lib'.

Postby K_Synnott » Mon Jun 30, 2014 3:55 am

Thanks for the reply.

I have changed my make.inc file to be like what you posted however I am still getting the same error.

My make file looks as follows:

Code: Select all
//////////////////////////////////////////////////////////////////////////////
#   -- MAGMA (version 1.4.1) --
#      Univ. of Tennessee, Knoxville
#      Univ. of California, Berkeley
#      Univ. of Colorado, Denver
#      December 2013
#
#      Contributed by: Allan Menezes (Ontario, Canada)
#//////////////////////////////////////////////////////////////////////////////

# 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
#     Fermi  - NVIDIA compute capability 2.x cards
#     Kepler - NVIDIA compute capability 3.x cards
# The default is all, "Tesla Fermi Kepler".
# See http://developer.nvidia.com/cuda-gpus
#
#GPU_TARGET ?= Tesla Fermi Kepler

CC        = gcc
NVCC      = nvcc
FORT      = gfortran

ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib

OPTS      = -fPIC -O3 -DADD_ -Wall -openmp -DMAGMA_WITH_MKL -DMAGMA_SETAFFINITY
F77OPTS   = -fPIC -O3 -DADD_ -warn all
FOPTS     = -fPIC -O3 -DADD_ -warn all
NVOPTS    = -O3 -DADD_ --compiler-options -fno-strict-aliasing -DUNIX
LDOPTS    = -fPIC -Xlinker -zmuldefs

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

CUDADIR   = /usr/local/cuda-6.0

LIBDIR    = -L/bummer/OpenBlas -L/usr/local/cuda-6.0/lib64 -L/usr/lib64
INC       = -I$(CUDADIR)/include



I could easily have to file set up completely wrong. I am very new to this.
K_Synnott
 
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: creating libmagma.a in 'lib'.

Postby hsahasra » Mon Jun 30, 2014 2:16 pm

Did you "make clean" first before compiling with -fPIC?
Also, please add -fPIC to the options, don't copy the options I showed above. I'm using MKL for BLAS/LAPACK and it looks like you are using OpenBLAS so you shouldn't have -DMAGMA_WITH_MKL
hsahasra
 
Posts: 27
Joined: Mon Jun 24, 2013 3:40 pm

Re: creating libmagma.a in 'lib'.

Postby K_Synnott » Tue Jul 01, 2014 6:12 am

I did not 'make clean'. Did it and made the change and now the 'make', 'make shared' and 'make testing' work perfectly. Thanks for all the help. I have one more question maybe you can help. I have made a change to one of the testing files and I cant build it with the change. I am on Ubuntu.

Thanks for the help again,
Kev
K_Synnott
 
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am

Re: creating libmagma.a in 'lib'.

Postby K_Synnott » Tue Jul 01, 2014 6:48 am

I got it never mind :)
K_Synnott
 
Posts: 15
Joined: Fri Jun 27, 2014 10:45 am


Return to User discussion

Who is online

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