Skip to content

Commit

Permalink
DBM: improved miniapp makefile (#2035)
Browse files Browse the repository at this point in the history
* Introduced realclean target.
* Introduced NVARCH variable.
* Link MKL library if present.
  • Loading branch information
hfp committed Mar 29, 2022
1 parent d38e67f commit d14dce1
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/dbm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@
all: dbm_miniapp.x

clean:
rm -fv *.o */*.o *.x ../offload/*.o
rm -fv *.o */*.o ../offload/*.o

realclean: clean
rm -fv *.x

CFLAGS := -fopenmp -g -O3 -march=native -Wall -Wextra
NVFLAGS := -g -O3 -lineinfo -arch sm_70 -Wno-deprecated-gpu-targets -Xcompiler "$(CFLAGS)" -D__OFFLOAD_CUDA
LIBS := -lm -lblas -lstdc++
NVARCH := sm_70
NVFLAGS := -g -O3 -lineinfo -arch $(NVARCH) -Wno-deprecated-gpu-targets -Xcompiler "$(CFLAGS)" -D__OFFLOAD_CUDA

ifneq ($(MKLROOT),)
LIBS += \
-Wl,--start-group \
$(MKLROOT)/lib/intel64/libmkl_gf_lp64.a \
$(MKLROOT)/lib/intel64/libmkl_core.a \
/opt/intel/oneapi_customer/mkl/2022.0.1/lib/intel64/libmkl_sequential.a \
-Wl,--end-group -ldl
else
LIBS += -lblas
endif

LIBS += -lstdc++ -lm

ALL_HEADERS := $(shell find . -name "*.h") $(shell find ../offload/ -name "*.h")
ALL_OBJECTS := ../offload/offload_library.o \
Expand Down

0 comments on commit d14dce1

Please sign in to comment.