I am trying to integrate the magma library into SUNDIALS suite specifically CVODEs. So far I have done the following.
1) I ran the examples (I am using MAGMA 2.2.0) on my universities cluster using the intel compiler, cuda 7.5.18 and intel math kernel library
2) Added the code necessary for MAGMA to run in CVODEs and compiled a static library that is dependent on the MAGMA library
a. I know that library linking order matters in the static library it is written the following way magma, cudart, cuda
3) Now I am attempting to access the static library, libsundials_cvode.a, from a C++ application and I get the following error:
/home/1704/SundialsMagmaInstall/lib/libsundials_cvode.a(cvode_gpu.o): In function `CVodeInitGPU':
cvode_gpu.c:(.text+0x1e5): undefined reference to `printout_devices'
I first thought it could have been a linking error and found that libcuda was not in the lib64 directory but in the stubs directory (Bold below). So I changed that to no avail. Below is the compiler input:
icpc -O3 -o DynamicModelBuilder.out -std=c++11 -I/home/1704/SundialsMagmaInstall/include -I/home/1704/MagmaInstall/include -I/home/software/cuda/7.5.18/include *.cpp -L/home/1704/SundialsMagmaInstall/lib -lsundials_cvode -lsundials_nvecserial -L/home/1704/MagmaInstall/lib -lmagma -L/home/software/cuda/7.5.18/lib64 -lcudart -lcublas -L/home/software/cuda/7.5.18/lib64/stubs -lcuda -w
Any help would be appreciated.
Code: Select all
src/magma-2.2.0> grep -r printout_devices . src/magma-2.2.0>
You shouldn't need to link with -lcuda. You may need to put -lcublas before -lcudart. The link line we usually use (see make.inc-examples) is:
Code: Select all
LIB += -lcublas -lcusparse -lcudart -lcudadevrt