username_4567
username_4567

Reputation: 4923

not able to compile with nvcc

I've installed CUDA on debian,i've successfully ran make file in C folder withing cuda folder.but whn i'm trying to run individual file like matMult.cu with nvcc i'm getting following error error:matrixMult.cu:no such file or directory error:cutil_inline:no such file or directory

n also it is complaining about other header files...please help me out

Upvotes: 0

Views: 1793

Answers (1)

pQB
pQB

Reputation: 3127

The CUDA SDK examples use a custom makefile based on rules defined in a common.mk file. In order to compile individually the examples you can make use of that Makefiles which can be tuning to add more dependencies or extra info.

To compile the matrixMul example by hand using the nvcc compiler, for an architecture of 64 bits and a Fermi device you can use:

g++ -Wall -m64 -fno-strict-aliasing -I. -I/usr/local/cuda/include -I../../common/inc -I../../../shared//inc -DUNIX -O2 -o obj/x86_64/release/matrixMul_gold.cpp.o -c matrixMul_gold.cpp /usr/local/cuda/bin/nvcc -gencode=arch=compute_20,code=\"sm_20,compute_20\" -m64 --compiler-options -fno-strict-aliasing -I. -I/usr/local/cuda/include -I../../common/inc -I../../../shared//inc -DUNIX -O2 -o obj/x86_64/release/matrixMul.cu.o -c matrixMul.cu

g++ -m64 -o ../../bin/linux/release/matrixMul obj/x86_64/release/matrixMul_gold.cpp.o obj/x86_64/release/matrixMul.cu.o -L/usr/local/cuda/lib64 -L../../lib -L../../common/lib/linux -L../../../shared//lib -lcudart -L/usr/local/cuda/lib64 -L../../lib -L../../common/lib/linux -L../../../shared//lib -lcudart -lcutil_x86_64 -lshrutil_x86_64

Compile the CUDA SDK examples by hand it's a little weary. I recommend you use the makefile of each example or start a new project from the scratch.

Upvotes: 1

Related Questions