Hi I’m compiling on Windows 10 and is just starting out.
I have been trying to just get something to compile for hours already and no success thus far.
The newest error is loads of undefined references with the flags -lcuda -lcudart
I am obviously missing some library but I don’t really know what.
Any help is appreciated, I’m dying here.
Code (filename=test1.cu)
__global__ void foo(){}
int main()
{
foo<<<1, 1>>>();
}
Makefile
CC = g++
ALLFLAGS = -L E:\cuda\development\lib\x64 -lcuda -lcudart
CUDAFLAGS = -arch=sm_20
EXEC = program
CUDASOURCES = $(wildcard *.cu)
CUDAOBJECTS = $(CUDASOURCES:.cu=.o)
all: $(CUDAOBJECTS)
$(CC) $(ALLFLAGS) $(CUDAOBJECTS) -o $(EXEC)
$(CUDAOBJECTS): %.o: %.cu
nvcc -c $(CUDAFLAGS) $< -o $@
Terminal output
nvcc -c -arch=sm_20 test1.cu -o test1.o
g++ -L E:\cuda\development\lib\x64 -lcuda -lcudart test1.o -o program
Warning: corrupt .drectve at end of def file
test1.o:(.text$mn+0xf6): undefined reference to `cudaConfigureCall'
test1.o:(.text$mn+0x158): undefined reference to `__cudaUnregisterFatBinary'
test1.o:(.text$mn+0x20f): undefined reference to `__cudaRegisterFunction'
test1.o:(.text$mn+0x22c): undefined reference to `__cudaRegisterFatBinary'
test1.o:(.text$mn+0x27f): undefined reference to `cudaLaunch'
collect2.exe: error: ld returned 1 exit status
makefile:19: recipe for target 'all' failed
mingw32-make: *** [all] Error 1