diff --git a/Makefile b/Makefile index 5a365a0d947..8dde4eae864 100644 --- a/Makefile +++ b/Makefile @@ -109,8 +109,8 @@ TEST_ALL_BIN := $(TEST_BIN_DIR)/test_all.testbin ############################## 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) @@ -176,17 +176,23 @@ else 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/ diff --git a/Makefile.config.example b/Makefile.config.example index 27d460b1568..5ee564ef19c 100644 --- a/Makefile.config.example +++ b/Makefile.config.example @@ -10,12 +10,13 @@ CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \ -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.