Hi, I am a newbie for both linux and cuda, yet I have to write cuda code in linux. The question I want to ask is how to compile cuda coda in linux. Do I need to generate a Makefile? And how to link those library functions?
Thanks a lot! oh, BTW, is this same as ordinary compilation (not cuda) in linux?
you need to install nvcc for your distro (I assume you are able to do this). Then you have to export path containing bin and library. To do this in a Debian-based OS (like Ubuntu for example), if you give a standard installation, I suggest you to open a shell and type:
Anyway you can find the right code lines at the end of your nvcc installation. These cause to export to the OS information about where are both bins and libraries.
Compiling a CUDA file is the same of compile, for example, a C/C++ file. But you use nvcc instead of, for example, gcc or g++.
Anyway, to compile a file open a shell, move to the right directory (using cd) and type: