##############################
CUDA_INCLUDE_DIR := $(CUDA_DIR)/include
CUDA_LIB_DIR := $(CUDA_DIR)/lib64 $(CUDA_DIR)/lib
-MKL_INCLUDE_DIR := $(MKL_DIR)/include
-MKL_LIB_DIR := $(MKL_DIR)/lib $(MKL_DIR)/lib/intel64
+BLAS_INCLUDE_DIR := $(BLAS_DIR)/include
+BLAS_LIB_DIR := $(BLAS_DIR)/lib
INCLUDE_DIRS += $(BUILD_INCLUDE_DIR)
INCLUDE_DIRS += ./src ./include $(CUDA_INCLUDE_DIR)
COMMON_FLAGS := -DNDEBUG -O2
endif
-# MKL switch (default = non-MKL = ATLAS)
-USE_MKL ?= 0
-ifeq ($(USE_MKL), 1)
+# MKL switch (default = ATLAS)
+BLAS ?= 0
+ifeq ($(BLAS), 1)
LIBRARIES += mkl_rt
COMMON_FLAGS += -DUSE_MKL
- INCLUDE_DIRS += $(MKL_INCLUDE_DIR)
- LIBRARY_DIRS += $(MKL_LIB_DIR)
+ INCLUDE_DIRS += $(BLAS_INCLUDE_DIR)
+ LIBRARY_DIRS += $(BLAS_LIB_DIR) $(BLAS_DIR)/lib/intel64
else
ifeq ($(LINUX), 1)
+ ifeq ($(BLAS), 0)
# Linux simply has cblas and atlas
LIBRARIES += cblas atlas
+ else ifeq ($(BLAS), 2)
+ LIBRARIES += openblas
+ endif
+ INCLUDE_DIRS += $(BLAS_INCLUDE_DIR)
+ LIBRARY_DIRS += $(BLAS_LIB_DIR)
else ifeq ($(OSX), 1)
# OS X packages atlas as the vecLib framework
INCLUDE_DIRS += /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35
-# MKL switch:
+# BLAS switch:
# 0 for ATLAS BLAS (default)
# 1 for MKL BLAS
-USE_MKL := 0
-# MKL directory contains include/ and lib/ directions that we need.
-MKL_DIR := /opt/intel/mkl
+# 2 for OpenBlas
+BLAS := 0
+# (MKL/ATLAS/OpenBlas) directory contains include/ and lib/ directions that we need.
+#BLAS_DIR := /opt/intel/mkl
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.