From 17aa2db216d00369ba5bdf17f1e047be558aff11 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Fri, 24 Jul 2020 15:41:46 -0500 Subject: [PATCH] Fail-safe updates to Makefiles in 'test' dir. Details: - Updated Makefiles in test, test/3, and test/sup so that running any of the usual targets without having first built BLIS results in a helpful error message. For example, if BLIS is not yet configured, make will output: Makefile:327: *** Cannot proceed: config.mk not detected! Run configure first. Stop. Similarly, if BLIS is configured but not yet built, make will output: Makefile:340: *** Cannot proceed: BLIS library not yet built! Run make first. Stop. In previous commits, these actions would result in a rather cryptic make error such as: make: *** No rule to make target 'test_sgemm_2400_asm_blis_st.x', needed by 'blis-nat-st'. Stop. --- test/3/Makefile | 42 +++++++++++++++++++++++++++++------------- test/Makefile | 31 +++++++++++++++++++++++++------ test/sup/Makefile | 40 ++++++++++++++++++++++++++++------------ 3 files changed, 82 insertions(+), 31 deletions(-) diff --git a/test/3/Makefile b/test/3/Makefile index 1a8aa3087..b40c04c3b 100644 --- a/test/3/Makefile +++ b/test/3/Makefile @@ -46,6 +46,7 @@ # .PHONY: all \ + check-env check-env-mk check-lib \ clean cleanx @@ -285,21 +286,21 @@ VENDOR_2S_OBJS := $(call get-2s-objs,vendor) VENDOR_2S_BINS := $(patsubst %.o,%.x,$(VENDOR_2S_OBJS)) # Define some targets associated with the above object/binary files. -blis-nat-st: $(BLIS_NAT_ST_BINS) -blis-nat-1s: $(BLIS_NAT_1S_BINS) -blis-nat-2s: $(BLIS_NAT_2S_BINS) +blis-nat-st: check-env $(BLIS_NAT_ST_BINS) +blis-nat-1s: check-env $(BLIS_NAT_1S_BINS) +blis-nat-2s: check-env $(BLIS_NAT_2S_BINS) -openblas-st: $(OPENBLAS_ST_BINS) -openblas-1s: $(OPENBLAS_1S_BINS) -openblas-2s: $(OPENBLAS_2S_BINS) +openblas-st: check-env $(OPENBLAS_ST_BINS) +openblas-1s: check-env $(OPENBLAS_1S_BINS) +openblas-2s: check-env $(OPENBLAS_2S_BINS) -eigen-st: $(EIGEN_ST_BINS) -eigen-1s: $(EIGEN_1S_BINS) -eigen-2s: $(EIGEN_2S_BINS) +eigen-st: check-env $(EIGEN_ST_BINS) +eigen-1s: check-env $(EIGEN_1S_BINS) +eigen-2s: check-env $(EIGEN_2S_BINS) -vendor-st: $(VENDOR_ST_BINS) -vendor-1s: $(VENDOR_1S_BINS) -vendor-2s: $(VENDOR_2S_BINS) +vendor-st: check-env $(VENDOR_ST_BINS) +vendor-1s: check-env $(VENDOR_1S_BINS) +vendor-2s: check-env $(VENDOR_2S_BINS) mkl-st: vendor-st mkl-1s: vendor-1s @@ -317,7 +318,7 @@ armpl-2s: vendor-2s .INTERMEDIATE: $(VENDOR_ST_OBJS) $(VENDOR_1S_OBJS) $(VENDOR_2S_OBJS) -# --Object file rules -- +# -- Object file rules -- #$(TEST_OBJ_PATH)/%.o: $(TEST_SRC_PATH)/%.c # $(CC) $(CFLAGS) -c $< -o $@ @@ -453,6 +454,21 @@ test_%_$(P2_MAX)_vendor_2s.x: test_%_$(P2_MAX)_vendor_2s.o $(LIBBLIS_LINK) $(CC) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@) +# -- Environment check rules -- + +check-env: check-lib + +check-env-mk: +ifeq ($(CONFIG_MK_PRESENT),no) + $(error Cannot proceed: config.mk not detected! Run configure first) +endif + +check-lib: check-env-mk +ifeq ($(wildcard $(LIBBLIS_LINK)),) + $(error Cannot proceed: BLIS library not yet built! Run make first) +endif + + # -- Clean rules -- clean: cleanx diff --git a/test/Makefile b/test/Makefile index 56e80ad1c..a2e0391d5 100644 --- a/test/Makefile +++ b/test/Makefile @@ -47,6 +47,7 @@ .PHONY: all \ blis openblas atlas mkl \ + check-env check-env-mk check-lib \ clean cleanx @@ -168,7 +169,7 @@ CFLAGS += -I$(TEST_SRC_PATH) #all: blis openblas atlas mkl all: blis openblas mkl -blis: \ +blis: check-env \ test_dotv_blis.x \ test_axpyv_blis.x \ test_gemv_blis.x \ @@ -190,7 +191,7 @@ blis: \ test_trmm_blis.x \ test_trsm_blis.x -openblas: \ +openblas: check-env \ test_dotv_openblas.x \ test_axpyv_openblas.x \ test_gemv_openblas.x \ @@ -212,7 +213,7 @@ openblas: \ test_trmm_openblas.x \ test_trsm_openblas.x -atlas: \ +atlas: check-env \ test_dotv_atlas.x \ test_axpyv_atlas.x \ test_gemv_atlas.x \ @@ -233,7 +234,8 @@ atlas: \ test_trmm_atlas.x \ test_trsm_atlas.x -mkl: test_dotv_mkl.x \ +mkl: check-env \ + test_dotv_mkl.x \ test_axpyv_mkl.x \ test_gemv_mkl.x \ test_ger_mkl.x \ @@ -254,7 +256,8 @@ mkl: test_dotv_mkl.x \ test_trmm_mkl.x \ test_trsm_mkl.x -essl: test_dotv_essl.x \ +essl: check-env \ + test_dotv_essl.x \ test_axpyv_essl.x \ test_gemv_essl.x \ test_ger_essl.x \ @@ -274,7 +277,8 @@ essl: test_dotv_essl.x \ test_trmm_essl.x \ test_trsm_essl.x -mac: test_dotv_mac.x \ +mac: check-env \ + test_dotv_mac.x \ test_axpyv_mac.x \ test_gemv_mac.x \ test_ger_mac.x \ @@ -346,6 +350,21 @@ test_%_blis.x: test_%_blis.o $(LIBBLIS_LINK) $(LINKER) $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@ +# -- Environment check rules -- + +check-env: check-lib + +check-env-mk: +ifeq ($(CONFIG_MK_PRESENT),no) + $(error Cannot proceed: config.mk not detected! Run configure first) +endif + +check-lib: check-env-mk +ifeq ($(wildcard $(LIBBLIS_LINK)),) + $(error Cannot proceed: BLIS library not yet built! Run make first) +endif + + # -- Clean rules -- clean: cleanx diff --git a/test/sup/Makefile b/test/sup/Makefile index c852cb7d1..daab19070 100644 --- a/test/sup/Makefile +++ b/test/sup/Makefile @@ -49,6 +49,7 @@ st mt \ blissup-st blisconv-st eigen-st openblas-st vendor-st blasfeo-st libxsmm-st \ blissup-mt blisconv-mt eigen-mt openblas-mt vendor-mt \ + check-env check-env-mk check-lib \ clean cleanx @@ -485,24 +486,24 @@ all: st st: blissup-st blisconv-st \ eigen-st openblas-st blasfeo-st libxsmm-st vendor-st -blissup-st: $(BLISSUP_ST_BINS) -blisconv-st: $(BLISLPAB_ST_BINS) -eigen-st: $(EIGEN_ST_BINS) -openblas-st: $(OPENBLAS_ST_BINS) -blasfeo-st: $(BLASFEO_ST_BINS) -libxsmm-st: $(LIBXSMM_ST_BINS) -vendor-st: $(VENDOR_ST_BINS) +blissup-st: check-env $(BLISSUP_ST_BINS) +blisconv-st: check-env $(BLISLPAB_ST_BINS) +eigen-st: check-env $(EIGEN_ST_BINS) +openblas-st: check-env $(OPENBLAS_ST_BINS) +blasfeo-st: check-env $(BLASFEO_ST_BINS) +libxsmm-st: check-env $(LIBXSMM_ST_BINS) +vendor-st: check-env $(VENDOR_ST_BINS) # -- Multithreaded -- mt: blissup-mt blisconv-mt \ eigen-mt openblas-mt vendor-mt -blissup-mt: $(BLISSUP_MT_BINS) -blisconv-mt: $(BLISLPAB_MT_BINS) -eigen-mt: $(EIGEN_MT_BINS) -openblas-mt: $(OPENBLAS_MT_BINS) -vendor-mt: $(VENDOR_MT_BINS) +blissup-mt: check-env $(BLISSUP_MT_BINS) +blisconv-mt: check-env $(BLISLPAB_MT_BINS) +eigen-mt: check-env $(EIGEN_MT_BINS) +openblas-mt: check-env $(OPENBLAS_MT_BINS) +vendor-mt: check-env $(VENDOR_MT_BINS) # --- Object file rules -------------------------------------------------------- @@ -650,6 +651,21 @@ test_%_vendor_mt.x: test_%_vendor_mt.o $(LIBBLIS_LINK) $(CC) $(strip $< $(VENDORP_LIB) $(LIBBLIS_LINK) $(LDFLAGS) -o $@) +# -- Environment check rules -- + +check-env: check-lib + +check-env-mk: +ifeq ($(CONFIG_MK_PRESENT),no) + $(error Cannot proceed: config.mk not detected! Run configure first) +endif + +check-lib: check-env-mk +ifeq ($(wildcard $(LIBBLIS_LINK)),) + $(error Cannot proceed: BLIS library not yet built! Run make first) +endif + + # -- Clean rules -- clean: cleanx