Problem with -lifcore
Problem with -lifcore
Hi,
I hope someone can help me. I've got the following problem, when I try to compile Magma:
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]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/magmablas« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/magmablas« wird verlassen
======================================== src
( cd src && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/src« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/src« wird verlassen
======================================== control
( cd control && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/control« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/control« wird verlassen
======================================== interface
( cd interface_cuda && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/interface_cuda« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/interface_cuda« wird verlassen
======================================== testing
( cd testing && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/testing« wird betreten
gcc -fopenmp -Wl,-rpath,../lib testing_zgeqp3.o -o testing_zgeqp3 \
libtest.a lin/liblapacktest.a -L../lib -lmagma \
-L/usr/local/cuda/lib64 -L/home/tobi/Programme/lib -L/usr/local/atlas/lib \
-llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -lifcore
/usr/bin/ld: cannot find -lifcore
collect2: error: ld returned 1 exit status
make[1]: *** [testing_zgeqp3] Fehler 1
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/testing« wird verlassen
make: *** [test] Fehler 2
Here is my make.inc-file:
#//////////////////////////////////////////////////////////////////////////////
# -- 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 = nvcc
FORT = 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 -lifcore
# define library directories preferably in your environment, or here.
LAPACKDIR = /home/tobi/Programme/lib
ATLASDIR = /usr/local/atlas
CUDADIR = /usr/local/cuda
-include make.check-atlas
-include make.check-cuda
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(ATLASDIR)/lib
INC = -I$(CUDADIR)/include
I hope someone can help me. I've got the following problem, when I try to compile Magma:
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]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/magmablas« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/magmablas« wird verlassen
======================================== src
( cd src && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/src« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/src« wird verlassen
======================================== control
( cd control && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/control« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/control« wird verlassen
======================================== interface
( cd interface_cuda && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/interface_cuda« wird betreten
make[1]: Für das Ziel »all« ist nichts zu tun.
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/interface_cuda« wird verlassen
======================================== testing
( cd testing && make )
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/testing« wird betreten
gcc -fopenmp -Wl,-rpath,../lib testing_zgeqp3.o -o testing_zgeqp3 \
libtest.a lin/liblapacktest.a -L../lib -lmagma \
-L/usr/local/cuda/lib64 -L/home/tobi/Programme/lib -L/usr/local/atlas/lib \
-llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -lifcore
/usr/bin/ld: cannot find -lifcore
collect2: error: ld returned 1 exit status
make[1]: *** [testing_zgeqp3] Fehler 1
make[1]: Verzeichnis »/home/tobi/Programme/magma-1.6.2/testing« wird verlassen
make: *** [test] Fehler 2
Here is my make.inc-file:
#//////////////////////////////////////////////////////////////////////////////
# -- 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 = nvcc
FORT = 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 -lifcore
# define library directories preferably in your environment, or here.
LAPACKDIR = /home/tobi/Programme/lib
ATLASDIR = /usr/local/atlas
CUDADIR = /usr/local/cuda
-include make.check-atlas
-include make.check-cuda
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(ATLASDIR)/lib
INC = -I$(CUDADIR)/include
Re: Problem with -lifcore
Per the note in the make.inc file, try removing -lifcore. Whether you need it depends on how ATLAS was compiled.
# Depending on how ATLAS and LAPACK were compiled, you may need one or more of:
# -lifcore -ldl -lf2c -lgfortran
Are you able to compile & link a program that uses LAPACK & BLAS, without MAGMA? The same libraries will be needed for linking with MAGMA (plus -lcublas -lcudart).
-mark
# Depending on how ATLAS and LAPACK were compiled, you may need one or more of:
# -lifcore -ldl -lf2c -lgfortran
Are you able to compile & link a program that uses LAPACK & BLAS, without MAGMA? The same libraries will be needed for linking with MAGMA (plus -lcublas -lcudart).
-mark
Re: Problem with -lifcore
Hi,
thanks for the fast reply. After removing -lifcore it worked. I already linked a program with LAPACK.
Now I wanted to compile the example and I get a lot of errors. Most of them concern cuda.
my Makefile:
I've used cublas for an easy test. That worked.
The File:
That's the way I compiled it:
Best regards
Tobias
thanks for the fast reply. After removing -lifcore it worked. I already linked a program with LAPACK.
Now I wanted to compile the example and I get a lot of errors. Most of them concern cuda.
Code: Select all
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `magmablas_ztranspose_inplace_q':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x19a): Nicht definierter Verweis auf `cudaConfigureCall'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x20c): Nicht definierter Verweis auf `cudaConfigureCall'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x22b): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x247): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x263): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x280): Nicht definierter Verweis auf `cudaLaunch'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x2aa): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x2c6): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x2e2): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x2ff): Nicht definierter Verweis auf `cudaLaunch'
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `magmablas_ztranspose_inplace':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x38e): Nicht definierter Verweis auf `cudaConfigureCall'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x3fc): Nicht definierter Verweis auf `cudaConfigureCall'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x41b): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x437): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x453): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x470): Nicht definierter Verweis auf `cudaLaunch'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x49a): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x4b6): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x4d2): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x4ef): Nicht definierter Verweis auf `cudaLaunch'
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `__device_stub__Z22ztranspose_inplace_oddiP7double2i(int, double2*, int)':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x51d): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x53e): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x556): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x56f): Nicht definierter Verweis auf `cudaLaunch'
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `__device_stub__Z23ztranspose_inplace_eveniP7double2i(int, double2*, int)':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x59d): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x5be): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x5d6): Nicht definierter Verweis auf `cudaSetupArgument'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x5ef): Nicht definierter Verweis auf `cudaLaunch'
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `__cudaUnregisterBinaryUtil()':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text+0x13): Nicht definierter Verweis auf `__cudaUnregisterFatBinary'
../lib/libmagma.a(ztranspose_inplace.o): In Funktion `__sti____cudaRegisterAll_65_tmpxft_000010bc_00000000_13_ztranspose_inplace_compute_35_cpp1_ii_275877f3()':
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text.startup+0xb): Nicht definierter Verweis auf `__cudaRegisterFatBinary'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text.startup+0x64): Nicht definierter Verweis auf `__cudaRegisterFunction'
tmpxft_000010bc_00000000-10_ztranspose_inplace.compute_20.cudafe1.cpp:(.text.startup+0xa5): Nicht definierter Verweis auf `__cudaRegisterFunction'
../lib/libmagma.a(zgetmatrix_transpose_mgpu.o): In Funktion `__cudaUnregisterBinaryUtil()':
tmpxft_000017df_00000000-10_zgetmatrix_transpose_mgpu.compute_20.cudafe1.cpp:(.text+0x13): Nicht definierter Verweis auf `__cudaUnregisterFatBinary'
../lib/libmagma.a(zgetmatrix_transpose_mgpu.o): In Funktion `__sti____cudaRegisterAll_72_tmpxft_000017df_00000000_13_zgetmatrix_transpose_mgpu_compute_35_cpp1_ii_da7d5dd3()':
tmpxft_000017df_00000000-10_zgetmatrix_transpose_mgpu.compute_20.cudafe1.cpp:(.text.startup+0xa): Nicht definierter Verweis auf `__cudaRegisterFatBinary'
../lib/libmagma.a(zsetmatrix_transpose_mgpu.o): In Funktion `__cudaUnregisterBinaryUtil()':
tmpxft_00001832_00000000-10_zsetmatrix_transpose_mgpu.compute_20.cudafe1.cpp:(.text+0x13): Nicht definierter Verweis auf `__cudaUnregisterFatBinary'
../lib/libmagma.a(zsetmatrix_transpose_mgpu.o): In Funktion `__sti____cudaRegisterAll_72_tmpxft_00001832_00000000_13_zsetmatrix_transpose_mgpu_compute_35_cpp1_ii_cc10bcb1()':
tmpxft_00001832_00000000-10_zsetmatrix_transpose_mgpu.compute_20.cudafe1.cpp:(.text.startup+0xa): Nicht definierter Verweis auf `__cudaRegisterFatBinary'
../lib/libmagma.a(zgetrf_gpu.o): In Funktion `magma_zgetrf_gpu':
zgetrf_gpu.cpp:(.text+0x19b): Nicht definierter Verweis auf `zgetrf_'
zgetrf_gpu.cpp:(.text+0xa49): Nicht definierter Verweis auf `zgetrf_'
zgetrf_gpu.cpp:(.text+0xd9d): Nicht definierter Verweis auf `zgetrf_'
../lib/libmagma.a(zgetrs_gpu.o): In Funktion `magma_zgetrs_gpu':
zgetrs_gpu.cpp:(.text+0x265): Nicht definierter Verweis auf `zlaswp_'
zgetrs_gpu.cpp:(.text+0x321): Nicht definierter Verweis auf `zlaswp_'
../lib/libmagma.a(zgesv.o): In Funktion `magma_zgesv':
zgesv.cpp:(.text+0x117): Nicht definierter Verweis auf `zgetrs_'
../lib/libmagma.a(zgetrf.o): In Funktion `magma_zgetrf':
zgetrf.cpp:(.text+0x18a): Nicht definierter Verweis auf `zgetrf_'
zgetrf.cpp:(.text+0x1c4): Nicht definierter Verweis auf `cudaMemGetInfo'
zgetrf.cpp:(.text+0x289): Nicht definierter Verweis auf `ceil'
zgetrf.cpp:(.text+0x41a): Nicht definierter Verweis auf `zgetrf_'
zgetrf.cpp:(.text+0xa1c): Nicht definierter Verweis auf `zgetrf_'
zgetrf.cpp:(.text+0xe2a): Nicht definierter Verweis auf `zgetrf_'
../lib/libmagma.a(zgetrf_m.o): In Funktion `magma_zgetrf_m':
zgetrf_m.cpp:(.text+0x161): Nicht definierter Verweis auf `cudaMemGetInfo'
zgetrf_m.cpp:(.text+0x222): Nicht definierter Verweis auf `ceil'
zgetrf_m.cpp:(.text+0x464): Nicht definierter Verweis auf `zgetrf_'
zgetrf_m.cpp:(.text+0x627): Nicht definierter Verweis auf `ceil'
zgetrf_m.cpp:(.text+0x15b8): Nicht definierter Verweis auf `zlaswp_'
../lib/libmagma.a(zgetrf_m.o): In Funktion `magma_zgetrf_piv':
zgetrf_m.cpp:(.text+0x17d1): Nicht definierter Verweis auf `zlaswp_'
../lib/libmagma.a(zgetrf_m.o): In Funktion `magma_zgetrf2_piv':
zgetrf_m.cpp:(.text+0x1961): Nicht definierter Verweis auf `zlaswp_'
../lib/libmagma.a(auxiliary.o): In Funktion `magma_is_devptr':
auxiliary.cpp:(.text+0x52): Nicht definierter Verweis auf `cudaGetDevice'
auxiliary.cpp:(.text+0x63): Nicht definierter Verweis auf `cudaGetDeviceProperties'
auxiliary.cpp:(.text+0x7f): Nicht definierter Verweis auf `cudaPointerGetAttributes'
auxiliary.cpp:(.text+0x91): Nicht definierter Verweis auf `cudaGetLastError'
auxiliary.cpp:(.text+0xb9): Nicht definierter Verweis auf `cudaGetLastError'
../lib/libmagma.a(auxiliary.o): In Funktion `magma_num_gpus':
auxiliary.cpp:(.text+0x11b): Nicht definierter Verweis auf `cudaGetDeviceCount'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zdotc':
blas_z.cpp:(.text+0x55): Nicht definierter Verweis auf `cublasZdotc'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zdotu':
blas_z.cpp:(.text+0x65): Nicht definierter Verweis auf `cublasZdotu'
../lib/libmagma.a(blas_z.o): In Funktion `magma_izamax':
blas_z.cpp:(.text+0x1): Nicht definierter Verweis auf `cublasIzamax'
../lib/libmagma.a(blas_z.o): In Funktion `magma_izamin':
blas_z.cpp:(.text+0x11): Nicht definierter Verweis auf `cublasIzamin'
../lib/libmagma.a(blas_z.o): In Funktion `magma_dzasum':
blas_z.cpp:(.text+0x21): Nicht definierter Verweis auf `cublasDzasum'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zaxpy':
blas_z.cpp:(.text+0x31): Nicht definierter Verweis auf `cublasZaxpy'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zcopy':
blas_z.cpp:(.text+0x41): Nicht definierter Verweis auf `cublasZcopy'
../lib/libmagma.a(blas_z.o): In Funktion `magma_dznrm2':
blas_z.cpp:(.text+0x71): Nicht definierter Verweis auf `cublasDznrm2'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zrot':
blas_z.cpp:(.text+0x81): Nicht definierter Verweis auf `cublasZrot'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zdrot':
blas_z.cpp:(.text+0x91): Nicht definierter Verweis auf `cublasZdrot'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zscal':
blas_z.cpp:(.text+0xa1): Nicht definierter Verweis auf `cublasZscal'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zdscal':
blas_z.cpp:(.text+0xb1): Nicht definierter Verweis auf `cublasZdscal'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zswap':
blas_z.cpp:(.text+0xc1): Nicht definierter Verweis auf `cublasZswap'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zgemv':
blas_z.cpp:(.text+0x169): Nicht definierter Verweis auf `cublasZgemv'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zgerc':
blas_z.cpp:(.text+0x171): Nicht definierter Verweis auf `cublasZgerc'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zgeru':
blas_z.cpp:(.text+0x181): Nicht definierter Verweis auf `cublasZgeru'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zhemv':
blas_z.cpp:(.text+0x217): Nicht definierter Verweis auf `cublasZhemv'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zher':
blas_z.cpp:(.text+0x269): Nicht definierter Verweis auf `cublasZher'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zher2':
blas_z.cpp:(.text+0x2e1): Nicht definierter Verweis auf `cublasZher2'
../lib/libmagma.a(blas_z.o): In Funktion `magma_ztrmv':
blas_z.cpp:(.text+0x363): Nicht definierter Verweis auf `cublasZtrmv'
../lib/libmagma.a(blas_z.o): In Funktion `magma_ztrsv':
blas_z.cpp:(.text+0x3e3): Nicht definierter Verweis auf `cublasZtrsv'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zgemm':
blas_z.cpp:(.text+0x4cf): Nicht definierter Verweis auf `cublasZgemm'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zsymm':
blas_z.cpp:(.text+0x5ad): Nicht definierter Verweis auf `cublasZsymm'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zsyrk':
blas_z.cpp:(.text+0x657): Nicht definierter Verweis auf `cublasZsyrk'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zsyr2k':
blas_z.cpp:(.text+0x72d): Nicht definierter Verweis auf `cublasZsyr2k'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zhemm':
blas_z.cpp:(.text+0x80d): Nicht definierter Verweis auf `cublasZhemm'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zherk':
blas_z.cpp:(.text+0x89f): Nicht definierter Verweis auf `cublasZherk'
../lib/libmagma.a(blas_z.o): In Funktion `magma_zher2k':
blas_z.cpp:(.text+0x965): Nicht definierter Verweis auf `cublasZher2k'
../lib/libmagma.a(blas_z.o): In Funktion `magma_ztrmm':
blas_z.cpp:(.text+0xa21): Nicht definierter Verweis auf `cublasZtrmm'
../lib/libmagma.a(blas_z.o): In Funktion `magma_ztrsm':
blas_z.cpp:(.text+0xae1): Nicht definierter Verweis auf `cublasZtrsm'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zsetvector_internal':
zset_get.cpp:(.text+0x22): Nicht definierter Verweis auf `cublasSetVector'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zsetvector_async_internal':
zset_get.cpp:(.text+0x6c): Nicht definierter Verweis auf `cublasSetVectorAsync'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zgetvector_internal':
zset_get.cpp:(.text+0xb2): Nicht definierter Verweis auf `cublasGetVector'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zgetvector_async_internal':
zset_get.cpp:(.text+0xfc): Nicht definierter Verweis auf `cublasGetVectorAsync'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zcopyvector_internal':
zset_get.cpp:(.text+0x165): Nicht definierter Verweis auf `cudaMemcpy2D'
zset_get.cpp:(.text+0x19e): Nicht definierter Verweis auf `cudaMemcpy'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zcopyvector_async_internal':
zset_get.cpp:(.text+0x1fc): Nicht definierter Verweis auf `cudaMemcpy2DAsync'
zset_get.cpp:(.text+0x239): Nicht definierter Verweis auf `cudaMemcpyAsync'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zsetmatrix_internal':
zset_get.cpp:(.text+0x26a): Nicht definierter Verweis auf `cublasSetMatrix'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zsetmatrix_async_internal':
zset_get.cpp:(.text+0x2c4): Nicht definierter Verweis auf `cublasSetMatrixAsync'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zgetmatrix_internal':
zset_get.cpp:(.text+0x30a): Nicht definierter Verweis auf `cublasGetMatrix'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zgetmatrix_async_internal':
zset_get.cpp:(.text+0x364): Nicht definierter Verweis auf `cublasGetMatrixAsync'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zcopymatrix_internal':
zset_get.cpp:(.text+0x3c0): Nicht definierter Verweis auf `cudaMemcpy2D'
../lib/libmagma.a(zset_get.o): In Funktion `magma_zcopymatrix_async_internal':
zset_get.cpp:(.text+0x42a): Nicht definierter Verweis auf `cudaMemcpy2DAsync'
../lib/libmagma.a(alloc.o): In Funktion `magma_malloc':
alloc.cpp:(.text+0x11): Nicht definierter Verweis auf `cudaMalloc'
../lib/libmagma.a(alloc.o): In Funktion `magma_free_internal':
alloc.cpp:(.text+0x44): Nicht definierter Verweis auf `cudaFree'
../lib/libmagma.a(alloc.o): In Funktion `magma_malloc_pinned':
alloc.cpp:(.text+0xd1): Nicht definierter Verweis auf `cudaMallocHost'
../lib/libmagma.a(alloc.o): In Funktion `magma_free_pinned_internal':
alloc.cpp:(.text+0x104): Nicht definierter Verweis auf `cudaFreeHost'
../lib/libmagma.a(error.o): In Funktion `magma_xerror(cudaError, char const*, char const*, int)':
error.cpp:(.text+0x1a): Nicht definierter Verweis auf `cudaGetErrorString'
../lib/libmagma.a(interface.o): In Funktion `magma_print_environment._omp_fn.0':
interface.cpp:(.text+0x5): Nicht definierter Verweis auf `omp_get_num_threads'
../lib/libmagma.a(interface.o): In Funktion `magma_init':
interface.cpp:(.text+0x66): Nicht definierter Verweis auf `cudaGetDeviceCount'
interface.cpp:(.text+0xb1): Nicht definierter Verweis auf `cudaGetDeviceProperties'
../lib/libmagma.a(interface.o): In Funktion `magma_print_environment':
interface.cpp:(.text+0x1b1): Nicht definierter Verweis auf `cudaDriverGetVersion'
interface.cpp:(.text+0x1d1): Nicht definierter Verweis auf `cudaRuntimeGetVersion'
interface.cpp:(.text+0x219): Nicht definierter Verweis auf `GOMP_parallel_start'
interface.cpp:(.text+0x228): Nicht definierter Verweis auf `GOMP_parallel_end'
interface.cpp:(.text+0x259): Nicht definierter Verweis auf `cudaGetDeviceCount'
interface.cpp:(.text+0x2b5): Nicht definierter Verweis auf `cudaGetDeviceProperties'
../lib/libmagma.a(interface.o): In Funktion `magma_getdevice_arch':
interface.cpp:(.text+0x3d8): Nicht definierter Verweis auf `cudaGetDevice'
../lib/libmagma.a(interface.o): In Funktion `magma_getdevices':
interface.cpp:(.text+0x466): Nicht definierter Verweis auf `cudaGetDeviceCount'
../lib/libmagma.a(interface.o): In Funktion `magma_getdevice':
interface.cpp:(.text+0x665): Nicht definierter Verweis auf `cudaGetDevice'
../lib/libmagma.a(interface.o): In Funktion `magma_setdevice':
interface.cpp:(.text+0x695): Nicht definierter Verweis auf `cudaSetDevice'
../lib/libmagma.a(interface.o): In Funktion `magma_device_sync':
interface.cpp:(.text+0x6c5): Nicht definierter Verweis auf `cudaDeviceSynchronize'
../lib/libmagma.a(interface.o): In Funktion `magma_queue_create_internal':
interface.cpp:(.text+0x6fe): Nicht definierter Verweis auf `cudaStreamCreate'
../lib/libmagma.a(interface.o): In Funktion `magma_queue_destroy_internal':
interface.cpp:(.text+0x733): Nicht definierter Verweis auf `cudaStreamDestroy'
../lib/libmagma.a(interface.o): In Funktion `magma_queue_sync_internal':
interface.cpp:(.text+0x76e): Nicht definierter Verweis auf `cudaStreamSynchronize'
../lib/libmagma.a(interface.o): In Funktion `magma_event_create':
interface.cpp:(.text+0x795): Nicht definierter Verweis auf `cudaEventCreate'
../lib/libmagma.a(interface.o): In Funktion `magma_event_destroy':
interface.cpp:(.text+0x7ca): Nicht definierter Verweis auf `cudaEventDestroy'
../lib/libmagma.a(interface.o): In Funktion `magma_event_record':
interface.cpp:(.text+0x805): Nicht definierter Verweis auf `cudaEventRecord'
../lib/libmagma.a(interface.o): In Funktion `magma_event_sync':
interface.cpp:(.text+0x835): Nicht definierter Verweis auf `cudaEventSynchronize'
../lib/libmagma.a(interface.o): In Funktion `magma_queue_wait_event':
interface.cpp:(.text+0x867): Nicht definierter Verweis auf `cudaStreamWaitEvent'
../lib/libmagma.a(zgetrf2_mgpu.o): In Funktion `magma_zgetrf2_mgpu':
zgetrf2_mgpu.cpp:(.text+0x149): Nicht definierter Verweis auf `ceil'
zgetrf2_mgpu.cpp:(.text+0x466): Nicht definierter Verweis auf `zgetrf_'
zgetrf2_mgpu.cpp:(.text+0xede): Nicht definierter Verweis auf `zgetrf_'
collect2: error: ld returned 1 exit status
make: *** [example] Fehler 1
Code: Select all
LAPACKDIR = /usr/lib
MAGMADIR = ..
CUDADIR = /usr/local/cuda
ATLASDIR = /usr/local/atlas
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(MAGMADIR)/lib \
-L$(ATLASDIR)/lib
CC = gcc
LD = gcc
CFLAGS = -Wall
LDFLAGS = -Wall
MAGMA_CFLAGS := -DADD_ -I$(MAGMADIR)/include -I$(CUDADIR)/include
MAGMA_LIBS := $(LIBDIR) \
-llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -lmagma
# Alternatively, using pkg-config (see README.txt):
# MAGMA_CFLAGS := $(shell pkg-config --cflags magma)
# MAGMA_LIBS := $(shell pkg-config --libs magma)
all: example
%.o: %.c
$(CC) $(CFLAGS) $(MAGMA_CFLAGS) -c -o $@ $<
example: example.o zfill.o
$(LD) $(LDFLAGS) -o $@ $^ $(MAGMA_LIBS)
clean:
-rm -f example *.o
The File:
Code: Select all
program cublas_fortran_example
implicit none
integer i, j
c helper functions
integer cublas_init
integer cublas_shutdown
integer cublas_alloc
integer cublas_free
integer cublas_set_vector
integer cublas_get_vector
c selected blas functions
double precision cublas_ddot
external cublas_daxpy
external cublas_dscal
external cublas_dcopy
double precision cublas_dnrm2
integer :: lenght_i = 30
c cublas variables
integer cublas_status
real*8 x(30), y(30)
double precision alpha, beta
double precision nrm
integer*8 d_x, d_y, d_alpha, d_beta, d_nrm
integer*8 dsize1, dlength1, dlength2
double precision dresult
double precision :: time1,time2
write(*,*) "testing cublas fortran example"
c initialize cublas library
c CUBLAS_STATUS_SUCCESS=0
cublas_status = cublas_init()
if (cublas_status /= 0) then
write(*,*) "CUBLAS Library initialization failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
c initialize data
do j=1,lenght_i
x(j) = 1.0
y(j) = 2.0
enddo
dsize1 = lenght_i
dlength1 = lenght_i
dlength2 = 1
alpha = 2.0
beta = 3.0
c allocate device storage
cublas_status = cublas_alloc(dlength1, dsize1, d_x)
if (cublas_status /= 0) then
write(*,*) "CUBLAS device malloc failed"
stop
endif
cublas_status = cublas_alloc(dlength1, dsize1, d_y)
if (cublas_status /= 0) then
write(*,*) "CUBLAS device malloc failed"
stop
endif
cublas_status = cublas_alloc(dlength2, dsize1, d_alpha)
if (cublas_status /= 0) then
write(*,*) "CUBLAS device malloc failed"
stop
endif
cublas_status = cublas_alloc(dlength2, dsize1, d_beta)
if (cublas_status /= 0) then
write(*,*) "CUBLAS device malloc failed"
stop
endif
cublas_status = cublas_alloc(dlength2, dsize1, d_nrm)
if (cublas_status /= 0) then
write(*,*) "CUBLAS device malloc failed"
stop
endif
c copy data from host to device
cublas_status = cublas_set_vector(dlength1, dsize1, x, dlength2,
> d_x, dlength2)
if (cublas_status /= 0) then
write(*,*) "CUBLAS copy to device failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
cublas_status = cublas_set_vector(dlength1, dsize1, y, dlength2,
> d_y, dlength2)
if (cublas_status /= 0) then
write(*,*) "CUBLAS copy to device failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
call cpu_time(time1)
dresult = cublas_ddot(dlength1, d_x, dlength2, d_y, dlength2)
write(*,*) "dot product result=",dresult
call cpu_time(time2)
write(*,*) 'time:',time2-time1
call cpu_time(time1)
!dresult = sdot(dlength1, x, 1, y, 1)
call cpu_time(time2)
write(*,*) 'time:',time2-time1
dresult = cublas_dnrm2(dlength1, d_x, dlength2)
write(*,*) "nrm2 of x result=",dresult
dresult = cublas_dnrm2(dlength1, d_y, dlength2)
write(*,*) "nrm2 of y result=",dresult
call cublas_daxpy(dlength1, alpha, d_x, dlength2, d_y, dlength2)
cublas_status = cublas_get_vector(dlength1, dsize1, d_y, dlength2,
> y, dlength2)
if (cublas_status /= 0) then
write(*,*) "CUBLAS copy to host failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
write(*,*) "daxpy y(1) =", y(1)
write(*,*) "daxpy y(30) =", y(30)
call cublas_dscal(dlength1, beta, d_x, dlength2)
cublas_status = cublas_get_vector(dlength1, dsize1, d_x, dlength2,
> x, dlength2)
if (cublas_status /= 0) then
write(*,*) "CUBLAS copy to host failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
write(*,*) "dscal x(1) =", x(1)
write(*,*) "dscal x(30) =", x(30)
call cublas_dcopy(dlength1, d_x, dlength2, d_y, dlength2)
cublas_status = cublas_get_vector(dlength1, dsize1, d_y, dlength2,
> y, dlength2)
if (cublas_status /= 0) then
write(*,*) "CUBLAS copy to host failed"
write(*,*) "cublas_status=",cublas_status
stop
endif
write(*,*) "dcopy y(1) =", y(1)
write(*,*) "dcopy y(30) =", y(30)
c deallocate GPU memory and exit
cublas_status = cublas_free(d_x)
cublas_status = cublas_free(d_y)
cublas_status = cublas_free(d_alpha)
cublas_status = cublas_free(d_beta)
cublas_status = cublas_free(d_nrm)
cublas_status = cublas_shutdown()
stop
end
Code: Select all
gfortran-4.7 -c -o cublas1.o cublas1.f /usr/lib/liblapack.so
nvcc -c -DCUBLAS_GFORTRAN -I/usr/local/cuda/include -I/usr/local/cuda/src -o fortran.o /usr/local/cuda/src/fortran.c
gfortran-4.7 -o cublas1 cublas1.o fortran.o -L/usr/local/cuda/lib64 -lcublas
Tobias
Re: Problem with -lifcore
The order of libraries matters. -lmagma must be before -llapack -lcublas etc.
-mark
-mark
Re: Problem with -lifcore
Thanks a lot, Now it works. Thanks for great support. I hope now I'm able to implement magma in my programm.
Tobi
Tobi
Re: Problem with -lifcore
Hi,
unfortunately I'm not able to implement Magma in Fortran.
Here is my simple Code:
My Makefile:
I get the following error (sorry that it is in German):
Thanks
Tobi
unfortunately I'm not able to implement Magma in Fortran.
Here is my simple Code:
Code: Select all
program example
!-------- include PGI MAGMA module
use magma
!-------- declarations
double precision, allocatable, dimension(:,:) :: h_A, h_B
integer :: d_A, d_B
integer :: M = 4
integer :: N = 6
!--------- initialize CUBLAS
call cublas_init()
!---------- allocate CPU memory
allocate(h_A(M,N))
allocate(h_B(M,N))
!---------- allocate GPU memory
call cublas_alloc(M*N, sizeof_double, d_A)
call cublas_alloc(M*N, sizeof_double, d_A)
!---------- Initializa the matrix
do i=1,M
do j=1,N
h_A(i,j) = i+j
h_B(i,j) = i+j
end do
end do
!----------- d_A = h_A
call cublas_set_matrix (M, N, sizeof_double, h_A, M, d_A,lda)
call cublas_set_matrix (M, N, sizeof_double, h_B, M, d_B,lda)
!----------- call MAGMA GPU interface
!magma_dgemm(MagmaNoTrans, MagmaNoTrans,n,n,n,scale1,d_a,n,d_b,n,scale2,d_c,n);
!call magma_dgemm_gpu('N','N', M, N, M, 1, d_A,M,dB , ipiv, info)
!------------ Free GPU memory and exit
call cublas_free(d_A)
call cublas_free(d_B)
call cublas_shutdown()
end
Code: Select all
LAPACKDIR = /usr/lib
MAGMADIR = /home/tobi/Programme/magma-1.6.2
CUDADIR = /usr/local/cuda
ATLASDIR = /usr/local/atlas
LIBDIR = -L$(CUDADIR)/lib64 \
-L$(LAPACKDIR) \
-L$(MAGMADIR)/lib \
-L$(ATLASDIR)/lib
CC = gfortran-4.8
LD = gfortran-4.8
CFLAGS = -fno-underscoring -O2
LDFLAGS = -fno-underscoring -O2
MAGMA_CFLAGS := -DADD_ -I$(MAGMADIR)/include -I$(CUDADIR)/include
MAGMA_LIBS := $(LIBDIR) \
-lmagma -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -fopenmp
# Alternatively, using pkg-config (see README.txt):
# MAGMA_CFLAGS := $(shell pkg-config --cflags magma)
# MAGMA_LIBS := $(shell pkg-config --libs magma)
all: example
%.o: %.f90
$(CC) $(CFLAGS) $(MAGMA_CFLAGS) -c -o $@ $<
example: example.o
$(LD) $(LDFLAGS) -o $@ $^ $(MAGMA_LIBS)
clean:
-rm -f example *.o
Code: Select all
example.o: In Funktion `main':
example.f90:(.text.startup+0x28): Nicht definierter Verweis auf `cublas_init'
example.f90:(.text.startup+0x1bc): Nicht definierter Verweis auf `cublas_alloc'
example.f90:(.text.startup+0x1e1): Nicht definierter Verweis auf `cublas_alloc'
example.f90:(.text.startup+0x28a): Nicht definierter Verweis auf `cublas_set_matrix'
example.f90:(.text.startup+0x2b0): Nicht definierter Verweis auf `cublas_set_matrix'
example.f90:(.text.startup+0x2bc): Nicht definierter Verweis auf `cublas_free'
example.f90:(.text.startup+0x2c8): Nicht definierter Verweis auf `cublas_free'
example.f90:(.text.startup+0x2cf): Nicht definierter Verweis auf `cublas_shutdown'
collect2: error: ld returned 1 exit status
make: *** [example] Fehler 1
Tobi
Re: Problem with -lifcore
You need the fortran.c file that comes with cuBLAS. Attached is an updated example which has both C and Fortran versions. See comments in the example's README and Makefile about fortran.c.
Obviously, you will need to replace openblas references with whatever BLAS & LAPACK library you are using.
-mark
Obviously, you will need to replace openblas references with whatever BLAS & LAPACK library you are using.
-mark
- Attachments
-
- example.tar.gz
- (4.54 KiB) Downloaded 176 times
-
ritikajoshi
- Posts: 1
- Joined: Fri Jun 05, 2015 6:32 am
Re: Problem with -lifcore
I am also facing same problem.
Re: Problem with -lifcore
Thanks a lot. Because of that I'm able to compile my simple code.
But now I'd like to implement it into a subroutine in a module.
Here is my makefile in the Modulefolder:
In this Module there is a subroutine I want to call by a program:
I can complle the whole Module. But if I want to call this routine in another folder I got this error:
Here is my makefile in this folder:
I hope you can help me one more time. I hope it's the last time. ;)
Tobi
But now I'd like to implement it into a subroutine in a module.
Here is my makefile in the Modulefolder:
Code: Select all
#
# makefile for library generation
#
#==========#
# Compiler
#==========#
#
FC = gfortran-4.8
CC = gcc
# Paths where MAGMA and CUDA are installed
LAPACKDIR = /usr/lib
MAGMADIR = /home/tobi/Programme/magma-1.6.2
CUDADIR = /usr/local/cuda
ATLASDIR = /usr/local/atlas
LIBDIR = -L$(CUDADIR)/lib64 -lcublas\
-L$(LAPACKDIR) \
-L$(MAGMADIR)/lib \
-L$(ATLASDIR)/lib
CC = gcc
FORT = gfortran-4.8
LD = gcc
CFLAGS = -Wall
LDFLAGS = -Wall
F90FLAGS = -shared -fPIC -frecord-marker=4 -O2
F90FLAGS2 = -frecord-marker=4 -O2
MAGMA_CFLAGS := -DADD_ -I$(MAGMADIR)/include -I$(CUDADIR)/include
MAGMA_F90FLAGS := -I$(MAGMADIR)/include -Dmagma_devptr_t="integer(kind=8)"
MAGMA_LIBS := $(LIBDIR) \
-lmagma -lcublas -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -fopenmp
#
#=======================================#
# Path to Fortran-Modules (HeaderFiles)
#=======================================#
#
MODPATH= -J ../01_Modules/
#
#===========================#
# Flags for Shared library
#===========================#
#
LDFLAG1 = ~/Programme/LibSparseMatrix/00_Source/libSparseMatrix.so
LDFLAG1 += /home/tobi/Programme/Function/FunctionsDevel/libFuncs.so
LDFLAG1 += /usr/lib/liblapack.so
CFLAG1 = -shared -fPIC $(CFLAG)
#
#===========================#
# Flags for Static library
#===========================#
#
LDFLAG2 = ~/Programme/LibSparseMatrix/00_Source/libSparseMatrix.a
CFLAG2 = $(CFLAG)
#
#all: libMiBliV.so libMiBliV.a
all: libMiBliV.so
Mod_MiBliV.o: Mod_MiBliV.f90
$(FC) $(F90FLAGS2) $(MAGMA_F90FLAGS) -c -o $@ $^ $(MODPATH)
fortran.o: $(CUDADIR)/src/fortran.c
$(CC) $(CFLAGS) $(MAGMA_CFLAGS) -DCUBLAS_GFORTRAN -c -o $@ $<
libMiBliV.so:
$(FORT) $(F90FLAGS) $(MAGMA_F90FLAGS) -o $@ Mod_MiBliV.f90 $(LDFLAG1) $(MODPATH)
#libMiBliV.so:
# $(FC) $(CFLAG1) $(MAGMA_F90FLAGS) -o $@ Mod_MiBliV.f90 $(LDFLAG1) $(MODPATH)
#libMiBliV: Mod_MiBliV.o fortran.o
# $(FC) $(LDFLAGS) -o $@ $^ $(MAGMA_LIBS) $(LDFLAG1) $(MODPATH)
clean:
rm libMiBliV.so libMiBliV.a Mod_MiBliV.o
Code: Select all
subroutine SolveSSEigenFastGraka(this)
!
use magma
implicit none
!-------- declarations
integer :: i,j
complex*16, allocatable, dimension(:,:) :: h_A, h_B
integer*8 :: d_A, d_B
integer :: M = 1000
integer :: N = 1000
integer :: lda,info
integer, dimension(:),allocatable :: ipiv
integer*8 :: d_ipiv
real(kind=8) :: flops, t, tstart, tend
class(SNM) :: this !< object handler
lda = N
!--------- initialize MAGMA
!call cublas_init()
call magmaf_init();
!---------- allocate CPU memory
allocate(h_A(N,N))
allocate(h_B(M,N))
allocate(ipiv(n))
!---------- allocate GPU memory
call cublas_alloc(N*N, sizeof_complex, d_A)
!call cublas_alloc(M*N, sizeof_double, d_A)
!call magmaf_zmalloc( dA, M*N );
!magma_zmalloc( &dX, lddx*nrhs );
!---------- Initializa the matrix
do i=1,M
do j=1,N
h_A(i,j) = i+j
h_B(i,j) = i+j
end do
end do
call cublas_set_matrix (N, N, sizeof_complex, h_A, M, d_A,lda)
!call magma_zset_matrix( lda, n, A, lda, dA, lda );
call magma_wtime_f(tstart)
call magmaf_zgetrf(n, n, h_A, lda, ipiv, info)
call magma_wtime_f(tend)
write(*,*) tend - tstart
call magma_wtime_f(tstart)
!call zgetrf(n, n, h_A, lda, ipiv, info)
call magmaf_cgetrf_gpu(n, n, d_A, lda, ipiv, info)
call magma_wtime_f(tend)
!
write(*,*) tend - tstart
!-!---------- d_A = h_A
!!call cublas_set_matrix (M, N, sizeof_double, h_A, M, d_A,lda)
!!call cublas_set_matrix (M, N, sizeof_double, h_B, M, d_B,lda)
!-!---------- call MAGMA GPU interface
!!magma_dgemm(MagmaNoTrans, MagmaNoTrans,n,n,n,scale1,d_a,n,d_b,n,scale2,d_c,n);
!!call magma_dgemm_gpu('N','N', M, N, M, 1, d_A,M,dB , ipiv, info)
!-!----------- Free GPU memory and exit
call cublas_free(d_A)
!call cublas_free(d_B)
!call magmaf_free(d_A)
!call cublas_shutdown()
call magmaf_finalize()
end subroutine solveSSEigenFastGraka
Code: Select all
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magma_wtime_f_'
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_init_'
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_finalize_'
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_cgetrf_gpu_'
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_zgetrf_'
Code: Select all
#
# Makefile for MiBliV
# ===================
#
# To compile:
# Enter: make
#
# Don't forget to update the documentation
# Enter: make docu
#
# To clean up old compilations
# Enter: make clean
#
#===============
# Setup Compiler
#===============
# DEBUG -compiling
FC = gfortran-4.8
CC = gcc
#
#
# Paths where MAGMA and CUDA are installed
LAPACKDIR = /usr/lib
MAGMADIR = /home/tobi/Programme/magma-1.6.2
CUDADIR = /usr/local/cuda
ATLASDIR = /usr/local/atlas
LIBDIR = -L$(CUDADIR)/lib64 -lcublas\
-L$(LAPACKDIR) \
-L$(MAGMADIR)/lib \
-L$(ATLASDIR)/lib
#CFLAGS = -frecord-marker=4 -fbounds-check -O0 -g
#CFLAGS = -frecord-marker=4 -O2 -static
# normal (faster)
CC = gcc
FORT = gfortran-4.8
LD = gcc
CFLAGS = -Wall
LDFLAGS = -Wall
F90FLAGS = -frecord-marker=4 -O2
MAGMA_CFLAGS := -DADD_ -I$(MAGMADIR)/include -I$(CUDADIR)/include
MAGMA_F90FLAGS := -I$(MAGMADIR)/include -Dmagma_devptr_t="integer(kind=8)"
MAGMA_LIBS := $(LIBDIR) \
-lmagma -lcublas -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -fopenmp
#================================
# Required third party libraries:
# (a) LAPACK, vers.> 3.0
#================================
#
#=================
# shared library
#=================
LDFLAG = /home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so
#LDFLAG += /home/tobi/Programme/Function/Functions_Module/libFuncs.so
LDFLAG += /home/tobi/Programme/Function/FunctionsDevel/libFuncs.so
LDFLAG += /usr/lib/liblapack.so
#LDFLAG += -L/usr/local/cuda/lib64
#LDFLAG += -L/home/tobi/Programme/magma-1.6.2
#LDFLAG += -lmagma -lcublas -llapack -lf77blas -lcblas -latlas -lcublas -lcudart -lstdc++ -lm -lgfortran -fopenmp
MODPATH= -J ../01_Modules/
#===================
# static libraries
#===================
#LDFLAG = ../00_Library/libMiBliV.a
#LDFLAG += /home/tobi/Programme/LibSparseMatrix/00_Source/libSparseMatrix.a
#LDFLAG += /home/tobi/Programme/Function/FunctionsDevel/libFuncs.a
#LDFLAG += /home/giersch/Programme/Functions/08_V_1.1.1_Thomas/libFuncs.a
#LDFLAG += /usr/lib/liblapack.a
#LDFLAG += liblapack.a
#LDFLAG += /usr/lib/libblas.a
#MODPATH= -J ../01_Modules/
#OptimFourrier.f90
#nvcc -c -DCUBLAS_GFORTRAN -I/usr/local/cuda/include -I/usr/local/cuda/src -o fortran.o /usr/local/cuda/src/fortran.c
all: MiBliV MiBliV2
%.o: %.f90
$(FC) $(F90FLAGS) $(MAGMA_F90FLAGS) -c -o $@ $^ $(MODPATH)
fortran.o: $(CUDADIR)/src/fortran.c
$(CC) $(CFLAGS) $(MAGMA_CFLAGS) -DCUBLAS_GFORTRAN -c -o $@ $<
MiBliV: MiBliV.o\
Menu.o\
Menu_Alternative.o\
Menu_Alternative_Paral.o\
Menu2.o\
Optim.o\
OptimGlob.o\
Menu_Modify.o\
Init.o\
fortran.o
$(FC) $(LDFLAGS) -o $@ $^ $(MAGMA_LIBS) $(LDFLAG)
MiBliV2: MiBliV2.o\
Menu.o\
Menu_Alternative.o\
Menu_Alternative_Paral.o\
Menu2.o\
Optim.o\
OptimGlob.o\
Menu_Modify.o\
Init.o\
fortran.o
$(FC) $(LDFLAGS) -o $@ $^ $(MAGMA_LIBS) $(LDFLAG)
clean:
rm *.o
rm MiBliV
rm -r "doc/
Tobi
Re: Problem with -lifcore
Can you include the input that is generating this error? I.e., what program & arguments is run, such as the compiler command. It's easier to see that than to figure out what your makefile does.
-mark
-mark
I can complle the whole Module. But if I want to call this routine in another folder I got this error:
Code: Select all
/home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magma_wtime_f_' /home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_init_' /home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_finalize_' /home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_cgetrf_gpu_' /home/tobi/Programme/04_MiBliV_OBJ/00_Library/libMiBliV.so: Nicht definierter Verweis auf `magmaf_zgetrf_'