I have made a makefile in order to compile my files:
CFLAGS = -O3 -Wall -I /usr/local/cuda/include/
NVCCFLAGS = -O3 -arch sm_20
LDFLAGS = -O3 -L/usr/local/cuda/lib64 -lcudart
EXE = runAPP
app.o:app.cu
$(NVCC) $(NVCCFLAGS) -c $< -o $(CPPFLAGS) $(LIB_PATH) $(LDFLAGS) $@
$(EXE): app.o
$(NVCC) $(NVCCFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(CPPFLAGS) $(LIB_PATH) app.o \
-lANN_char -lz
cp $@ ../bin
But I got this problem:
app.cpp:26:26: error: cuda_runtime.h: No such file or directory app.cpp:27:18: error: cuda.h: No such file or directory
This is how I include them in the app.cpp:
#include <cuda.h>
#include <cuda_runtime.h>
Why is this problem?
I search something on google, they said that the app.cpp must be always app.cu, is it true?
Thanks in advance.
app.o
. How is it compiled to an object?runApp
by linkingapp.o
and some libraries. But you have not shown the build rule forapp.o
. I am asking you to show me it.