I want to compile a very basic hello world level Cuda program under Linux. I have three files:
My version, verbose but transparent:
myapp: myapp.o g++ -fPIC -o $@ $< -L /usr/local/cuda/lib -lcudart myapp.o: myapp.cu /usr/local/cuda/bin/nvcc --compiler-options -fno-strict-aliasing \ -I/usr/local/cuda/include \ -DUNIX -O2 -o $@ -c $< matrixMul: matrixMul.o g++ -fPIC -o $@ $< -L /usr/local/cuda/lib -lcudart # It MUST be named .cu or nvcc compiles as regular C !!! (no __global__) matrixMul.o: matrixMul.cu /usr/local/cuda/bin/nvcc --compiler-options -fno-strict-aliasing \ -I/usr/local/cuda/include \ -DUNIX -O2 -o $@ -c $<