From fd9c710424fc43f4147e785aaaadac9ba3ec6599 Mon Sep 17 00:00:00 2001 From: John Gebbie Date: Sat, 3 Dec 2022 17:53:21 +0000 Subject: [PATCH] Add OPENBLAS math library option --- src/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Makefile b/src/Makefile index cd697b15..b2dd4ff2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,6 +7,7 @@ CUDA_ROOT?=/usr/local/cuda USE_SHARED?=0 # Math libraries HAVE_OPENBLAS_CLAPACK?=1 +HAVE_OPENBLAS?=0 HAVE_MKL?=0 HAVE_ACCELERATE=0 HAVE_CUDA?=0 @@ -80,6 +81,18 @@ ifeq ($(HAVE_OPENBLAS_CLAPACK), 1) endif endif +ifeq ($(HAVE_OPENBLAS), 1) + CFLAGS += -I$(OPENBLAS_ROOT)/include + ifeq ($(USE_SHARED), 0) + LIBS += \ + $(OPENBLAS_ROOT)/lib/libopenblas.a \ + $(OPENBLAS_ROOT)/lib/liblapack.a \ + $(OPENBLAS_ROOT)/lib/libblas.a + else + LDFLAGS += -lopenblas -llapack -lblas + endif +endif + ifeq ($(HAVE_MKL), 1) CFLAGS += -DHAVE_MKL=1 -I$(MKL_ROOT)/include LDFLAGS += -L$(MKL_ROOT)/lib/intel64 -Wl,-rpath=$(MKL_ROOT)/lib/intel64 -lmkl_rt -lmkl_intel_lp64 -lmkl_core -lmkl_sequential