mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 23:26:25 +01:00
Update Makefile regarding systems without nvcc
This commit is contained in:
parent
c0381efa71
commit
7572874f2e
10
Makefile
10
Makefile
@ -3,7 +3,7 @@ SRCDIR := ./src
|
|||||||
CACHE_DIR := ./cache
|
CACHE_DIR := ./cache
|
||||||
NVCC := nvcc
|
NVCC := nvcc
|
||||||
|
|
||||||
NVCC_INSTALLED := $(shell command -v nvcc 2> /dev/null)
|
NVCC_INSTALLED := $(shell command -v $(NVCC) 2> /dev/null)
|
||||||
|
|
||||||
MNIST_SRCDIR := $(SRCDIR)/mnist
|
MNIST_SRCDIR := $(SRCDIR)/mnist
|
||||||
CNN_SRCDIR := $(SRCDIR)/cnn
|
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
|
$(BUILDDIR)/cnn_cuda_%.o: $(CNN_SRCDIR)/%.cu $(CNN_SRCDIR)/include/%.h
|
||||||
ifndef NVCC_INSTALLED
|
ifndef NVCC_INSTALLED
|
||||||
@echo "nvcc not found, skipping"
|
@echo "$(NVCC) not found, skipping"
|
||||||
else
|
else
|
||||||
$(NVCC) $(NVCCFLAGS) -c $< -o $@
|
$(NVCC) $(NVCCFLAGS) -c $< -o $@
|
||||||
endif
|
endif
|
||||||
@ -87,7 +87,11 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.c $(SRCDIR)/include/%.h
|
|||||||
$(CC) -c $< -o $@ $(CFLAGS)
|
$(CC) -c $< -o $@ $(CFLAGS)
|
||||||
|
|
||||||
$(BUILDDIR)/cuda_%.o: $(SRCDIR)/%.cu $(SRCDIR)/include/%.h
|
$(BUILDDIR)/cuda_%.o: $(SRCDIR)/%.cu $(SRCDIR)/include/%.h
|
||||||
|
ifndef NVCC_INSTALLED
|
||||||
|
@echo "$(NVCC) not found, skipping"
|
||||||
|
else
|
||||||
$(NVCC) $(NVCCFLAGS) -c $< -o $@
|
$(NVCC) $(NVCCFLAGS) -c $< -o $@
|
||||||
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tests
|
# 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
|
$(BUILDDIR)/test-cnn_%: test/cnn_%.cu $(BUILDDIR)/cnn_cuda_%.o $(BUILDDIR)/cuda_utils.o $(BUILDDIR)/colors.o $(BUILDDIR)/mnist.o
|
||||||
ifndef NVCC_INSTALLED
|
ifndef NVCC_INSTALLED
|
||||||
@echo "nvcc not found, skipping"
|
@echo "$(NVCC) not found, skipping"
|
||||||
else
|
else
|
||||||
$(NVCC) $(NVCCFLAGS) $^ -o $@
|
$(NVCC) $(NVCCFLAGS) $^ -o $@
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user