Background :
I'm trying to integrate Cuda in an existing C library. This C library uses GNU Autotools for building.
The flow is
- compile all C source files using gcc
- compile all Cuda source files using nvcc
- link all the object files using gcc
I've tried this on a small test library by manually running compiling and linking commands and the library was created successfully.
Questions :
- How do I configure libtool to compile cuda source files using a different compiler (nvcc)? I've tried writing a rule to compile Cuda source files separately, however during linking, libtool ignores all the cuda object files because they don't have corresponding libtool object files with them. I've tried the following libtool commands to compile a .cu file(cuda source code)
The correct command to compile this using just nvcc is : nvcc -Xcompiler -fPIC -c test.cu - If libtool cannot compile cuda source files, How do I use libtool without generating libtool objects?(I only want to build a shared object file). Basically libtool should generate only .o files for each .c file during compilation. And it should link all the .o files (including the ones generated by nvcc) during linking. How do I achieve this?
ThankYou.