Error compiling with PGI

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

Error compiling with PGI

Postby Caterina » Thu Jan 11, 2018 11:36 pm

I'm getting the following error when compiling with PGI compiler:

/usr/bin/ld: control/magma_f77.o: Relocations in generic ELF (EM: 21)
control/magma_f77.o: error adding symbols: File in wrong format
Makefile:605: recipe for target 'lib/libmagma.so' failed
make: *** [lib/libmagma.so] Error 2

My make.inc file looks like this:

CC = /opt/pgi/linux86-64/17.4/bin/pgcc
CXX = /opt/pgi/linux86-64/17.4/bin/pgc++
NVCC = /usr/local/cuda-9.0/bin/nvcc
FORT = /opt/pgi/linux86-64/2017/bin/pgfortran
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib

Do you have any ideas what the error might be?
Caterina
 
Posts: 2
Joined: Thu Jan 11, 2018 11:26 pm

Re: Error compiling with PGI

Postby mgates3 » Fri Jan 12, 2018 6:01 pm

Did you compile some of MAGMA with a different compiler before PGI? That would make incompatible .o files. You would need to "make clean" in-between switching compilers or compiler flags (like adding -fPIC to CFLAGS or FFLAGS).

Do you set CFLAGS, FFLAGS, etc. in your make.inc? Knowing those flags (i.e., the whole make.inc file) would be helpful.

It would be helpful to have the command that generated that error. E.g., if you get the error, run make again and give that input and output. For instance, here's a failure linking the shared library; I condensed the huge list of .o files with ... ellipsis. Basically, I'm looking for what flags are given to the compiler.

Code: Select all
mint ~/Documents/magma> make -j1 lib
===== shared library lib/libmagma.so
g++ -fopenmp -m64     -fPIC -install_name @rpath/libmagma.so -shared -o lib/libmagma.so \
      control/magma_f77.o control/magma_param.o control/magma.o control/abs.o control/affinity.o control/auxiliary.o control/connection_mgpu.o control/constants.o control/get_batched_crossover.o ... magmablas/cpotf2_kernels_var.o \
      -L./lib -L/usr/local/cuda-8.0/lib -lblas_fix -framework Accelerate -lstdc++ -lm -lcublas -lcusparse -lcudart -lcudadevrt
ld: file too small (length=0) file 'src/dgetrf.o' for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [lib/libmagma.so] Error 1
mgates3
 
Posts: 815
Joined: Fri Jan 06, 2012 2:13 pm

Re: Error compiling with PGI

Postby Caterina » Fri Jan 12, 2018 6:32 pm

make clean solved the problem. Thanks!
Caterina
 
Posts: 2
Joined: Thu Jan 11, 2018 11:26 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron