summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTim Dettmers <tim.dettmers@gmail.com>2022-07-31 20:59:34 -0700
committerTim Dettmers <tim.dettmers@gmail.com>2022-07-31 20:59:34 -0700
commit4a6ea7e24b933bf574f7707e1b331ea62f7e7273 (patch)
tree5f010cc5e24eb1006a5ffbcbc14c827c5fea6d4d /Makefile
parent28d1e7dc016b72b47dd97ee35094a98d1467cab4 (diff)
Added adjusted build file.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 04a6fa7..b109f96 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,16 @@
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
ROOT_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
-ifndef CUDA_VERSION
-$(error ERROR: CUDA_VERSION not set. Call make with CUDA string, for example: make cuda11x CUDA_VERSION=115 or make cpuonly CUDA_VERSION=CPU)
-endif
-
GPP:= /usr/bin/g++
ifeq ($(CUDA_HOME),)
CUDA_HOME:= $(shell which nvcc | rev | cut -d'/' -f3- | rev)
endif
+ifndef CUDA_VERSION
+$(warning WARNING: CUDA_VERSION not set. Call make with CUDA string, for example: make cuda11x CUDA_VERSION=115 or make cpuonly CUDA_VERSION=CPU)
+CUDA_VERSION:=
+endif
+
NVCC := $(CUDA_HOME)/bin/nvcc
@@ -92,7 +93,7 @@ cuda11x: $(BUILD_DIR) env
$(GPP) -std=c++14 -DBUILD_CUDA -shared -fPIC $(INCLUDE) $(BUILD_DIR)/ops.o $(BUILD_DIR)/kernels.o $(BUILD_DIR)/link.o $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_cuda$(CUDA_VERSION).so $(LIB)
cpuonly: $(BUILD_DIR) env
- $(GPP) -std=c++14 -shared -fPIC -I $(ROOT_DIR)/csrc -I $(ROOT_DIR)/include $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_$(CUDA_VERSION).so
+ $(GPP) -std=c++14 -shared -fPIC -I $(ROOT_DIR)/csrc -I $(ROOT_DIR)/include $(FILES_CPP) -o ./bitsandbytes/libbitsandbytes_cpu.so
env:
@echo "ENVIRONMENT"
@@ -116,7 +117,10 @@ $(ROOT_DIR)/dependencies/cub:
cd dependencies/cub; git checkout 1.11.0
clean:
- rm build/* ./bitsandbytes/libbitsandbytes.so
+ rm build/*
cleaneggs:
rm -rf *.egg*
+
+cleanlibs:
+ rm ./bitsandbytes/libbitsandbytes*.so