sourcedir/cg_cuda.cu.o: In function `CG_CUDA(SparseMatrix*, Vector*, Vector*)': sourcedir/cg_cuda.cu.o: In function `CGUpdateAddVector(Vector*, Vector*, Vector*, float)': home/vburca/CUDA_Research_2012/Recon2D/it/./sourcedir/it.c:280: undefined reference to `CG_CUDA' So now I am getting these errors: nvcc -lGL -lGLU -lglut -lpthread -lcuda -I./include -o it. Nvcc $(NVFLAGS) $(LDFLAGS) $(INCLUDES) -o $^ Nvcc -c $(INCLUDES) $(NVFLAGS) $< -o $(HOST_OBJ) $(DEVICE_OBJ) LDFLAGS := -lGL -lGLU -lglut -lpthread -lcuda I changed the Makefile some more, cleaned it a bit, and now I only get a few errors which are related to the fact that the. CC = gccĬFLAGS = -O3 -finline-functions -Winline -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -Wstrict-prototypes cu file to be compiled along with the others? Thanks again. Can you help me with what I need to add in order for the. Here is the original Makefile, the one that worked on the. cu file.Ĭan you please give me some hints on what might be wrong with my Makefile? I used as a reference the following Stackoverflow post: The problem with my Makefile is that when I do make in the it folder I get a bunch of errors that tell me that the file that has the main() function ( it.c in sourcedir folder) is not getting linked to any of the functions from other libraries. The structure of the project is as follows:
![cuda c makefile example cuda c makefile example](https://mcuoneclipse.files.wordpress.com/2017/07/creating-empty-makefile-project.png)
![cuda c makefile example cuda c makefile example](https://gpgpu.io/wp-content/uploads/2019/10/new_project.png)
#CFLAGS = -g -Wstrict-prototypes -Winline -Wall #-finline-functions -Winline -Wall -falign-loops=2 -falign-jumps=2 -falign-functions=2 -Wstrict-prototypes #CU_SOURCES = $(wildcard $(SOURCEDIR)/*.cu) #C_SOURCES = $(wildcard $(SOURCEDIR)/*.c) cu file to the project and now I want to modify the Makefile so that it compiles everything together.
![cuda c makefile example cuda c makefile example](https://spin.atomicobject.com/wp-content/uploads/20160801161626/vranish-featured-image-spin.jpg)
The original package was written entirely in C and had its own Makefile (it was perfectly working).