From 7572874f2e98662961138651c6469f2931a27c15 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Fri, 11 Nov 2022 11:31:24 +0100 Subject: [PATCH] Update Makefile regarding systems without nvcc --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5eebe24..4bdd0f6 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SRCDIR := ./src CACHE_DIR := ./cache NVCC := nvcc -NVCC_INSTALLED := $(shell command -v nvcc 2> /dev/null) +NVCC_INSTALLED := $(shell command -v $(NVCC) 2> /dev/null) MNIST_SRCDIR := $(SRCDIR)/mnist CNN_SRCDIR := $(SRCDIR)/cnn @@ -76,7 +76,7 @@ $(BUILDDIR)/cnn_%.o: $(CNN_SRCDIR)/%.c $(CNN_SRCDIR)/include/%.h $(BUILDDIR)/cnn_cuda_%.o: $(CNN_SRCDIR)/%.cu $(CNN_SRCDIR)/include/%.h ifndef NVCC_INSTALLED - @echo "nvcc not found, skipping" + @echo "$(NVCC) not found, skipping" else $(NVCC) $(NVCCFLAGS) -c $< -o $@ endif @@ -87,7 +87,11 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.c $(SRCDIR)/include/%.h $(CC) -c $< -o $@ $(CFLAGS) $(BUILDDIR)/cuda_%.o: $(SRCDIR)/%.cu $(SRCDIR)/include/%.h +ifndef NVCC_INSTALLED + @echo "$(NVCC) not found, skipping" +else $(NVCC) $(NVCCFLAGS) -c $< -o $@ +endif # # Tests @@ -112,7 +116,7 @@ build/test-mnist_%: test/mnist_%.c $(MNIST_OBJ) $(BUILDDIR)/colors.o $(BUILDDIR)/test-cnn_%: test/cnn_%.cu $(BUILDDIR)/cnn_cuda_%.o $(BUILDDIR)/cuda_utils.o $(BUILDDIR)/colors.o $(BUILDDIR)/mnist.o ifndef NVCC_INSTALLED - @echo "nvcc not found, skipping" + @echo "$(NVCC) not found, skipping" else $(NVCC) $(NVCCFLAGS) $^ -o $@ endif