Magma 2.0.2 installation help

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

Magma 2.0.2 installation help

Postby ah2012 » Thu Jul 21, 2016 6:15 pm

Hi all,

I'm having trouble installing Magma 2.0.2 on Ubuntu Server 16.04. I've edited the MKL-GCC makefile with the directories of my Cuda and MKL libraries. When I initiate the makefile,

The process begins, but it exits with with the first call to nvcc Error 1:

Code: Select all
Makefile:570: recipe for target 'magmablas/saxpycp.o' failed


The -I option for this line nvcc lists the correct directly for both the Cuda and MKL include directories.

Any help would be tremendously appreciated!
ah2012
 
Posts: 4
Joined: Thu Jul 21, 2016 5:40 pm

Re: Magma 2.0.2 installation help

Postby mgates3 » Fri Jul 22, 2016 12:09 pm

Can you include your make.inc file, and the nvcc command that fails? It's hard to tell what's going on from just the error message.

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

Re: Magma 2.0.2 installation help

Postby ah2012 » Fri Jul 22, 2016 12:25 pm

Hi Mark,

Thanks for the fast reply. Here is the make.inc file:
Code: Select all
#//////////////////////////////////////////////////////////////////////////////
#   -- MAGMA (version 2.0.2) --
#      Univ. of Tennessee, Knoxville
#      Univ. of California, Berkeley
#      Univ. of Colorado, Denver
#      @date May 2016
#//////////////////////////////////////////////////////////////////////////////

# GPU_TARGET contains one or more of Fermi, Kepler, or Maxwell,
# to specify for which GPUs you want to compile MAGMA:
#     Fermi   - NVIDIA compute capability 2.x cards
#     Kepler  - NVIDIA compute capability 3.x cards
#     Maxwell - NVIDIA compute capability 5.x cards
# The default is "Fermi Kepler".
# Note that NVIDIA no longer supports 1.x cards, as of CUDA 6.5.
# See http://developer.nvidia.com/cuda-gpus
#
#GPU_TARGET ?= Fermi Kepler

# --------------------
# programs

CC        = gcc
CXX       = g++
NVCC      = nvcc
FORT      = gfortran

ARCH      = ar
ARCHFLAGS = cr
RANLIB    = ranlib


# --------------------
# flags

# Use -fPIC to make shared (.so) and static (.a) library;
# can be commented out if making only static library.
FPIC      = -fPIC

CFLAGS    = -O3 $(FPIC) -DADD_ -Wall -Wshadow -fopenmp -DMAGMA_WITH_MKL
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 "$(FPIC) -Wall -Wno-unused-function"
LDFLAGS   =     $(FPIC)              -fopenmp

# C++11 (gcc >= 4.7) is not required, but has benefits like atomic operations
CXXFLAGS := $(CFLAGS) -std=c++11
CFLAGS   += -std=c99


# --------------------
# libraries
# gcc with MKL 11.3.3, GNU threads
LIB       = -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lstdc++ -lm -ldl -lgfortran
LIB      += -lcublas -lcusparse -lcudart


# --------------------
# directories

# define library directories preferably in your environment, or here.
# for MKL run, e.g.: source /opt/intel/composerxe/mkl/bin/mklvars.sh intel64
MKLROOT ?= /opt/intel/compilers_and_libraries_2016.3.210/linux/mkl
CUDADIR ?= /usr/local/cuda-7.5
-include make.check-mkl
-include make.check-cuda

LIBDIR    = -L$(CUDADIR)/lib64 \
            -L$(MKLROOT)/lib/intel64

INC       = -I$(CUDADIR)/include \
            -I$(MKLROOT)/include


And the line that fails with the error is here.
Code: Select all
nvcc -O3         -DADD_       -Xcompiler "-fPIC -Wall -Wno-unused-function"  -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -I/usr/local/cuda-7.5/include -I/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/include -I./include -I./control -c -o magmablas/saxpycp.o magmablas/saxpycp.cu
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
   return (char *) memcpy (__dest, __src, __n) + __n;
                                          ^
Makefile:570: recipe for target 'magmablas/saxpycp.o' failed
make: *** [magmablas/saxpycp.o] Error 1


Thank you again!
Alex
ah2012
 
Posts: 4
Joined: Thu Jul 21, 2016 5:40 pm

Re: Magma 2.0.2 installation help

Postby ah2012 » Fri Jul 22, 2016 12:27 pm

I should also mention I've edited the LIB definition in the make.inc for MKL to reflect the Link Advisor for my version of the Library. I've tried the make.inc file without these alterations, and I receive the same error.

Alex
ah2012
 
Posts: 4
Joined: Thu Jul 21, 2016 5:40 pm

Re: Magma 2.0.2 installation help

Postby mgates3 » Fri Jul 22, 2016 1:29 pm

Searching for the error message "/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope",
I found these suggestions, among others. It seems an issue in the system compiler's headers and their interaction with nvcc.

https://groups.google.com/forum/#!msg/c ... GRKNdmBAAJ
https://github.com/BVLC/caffe/issues/4046

Probably you can modify the NVCCFLAGS in make.inc to accommodate the suggestions.

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


Return to User discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron