CUDA CUDPP.so building

I want to use the CUDPP library in my project. I downloaded sources from the project page . Unfortunately, when I ran make, only the static library was created. I looked at the Makefiles and did not find the dynamic lib configuration. I do not want to store a static library with the project - this is a completely non-portable way.

My question is: how can I build a .so dynamic CUDPP library without writing my own Makefile / compiling it manually? Maybe someone has already done this?

EDIT . I replaced "g ++" with "g ++ -fPIC", "gcc" with "gcc -fpIC" and "nvcc" with "nvcc -Xcompiler -fpic". When I unpack the obj files from the archive and link them to the shared lib, I have no errors. However, my application crashes on startup when linked to this library.

+3
source share
2 answers

when compiling, pass the flag -Xcompiler -fpicto nvcc. If you link to any cuda libraries, make sure you link to the shared libraries, otherwise you will not be able to link them. Hope all you need.

+3
source

-shared ? - , .

ldd , , , , -fPIC .. . , .so LD_LIBRARY_PATH (, , ).

0

Source: https://habr.com/ru/post/1777513/


All Articles