mirror of
https://github.com/amd/blis.git
synced 2026-04-20 15:48:50 +00:00
Allow lesser Makefiles to reference installed BLIS.
Details:
- Updated the build system so that "lesser" Makefiles, such as those in
belonging to example code or the testsuite, may be run even if the
directory is orphaned from the original build tree. This allows a
user to configure, compile, and install BLIS, delete the build tree
(that is, the source distribution, or the build directory for out-
of-tree builds) and then compile example or testsuite code and link
against the installed copy of BLIS (provided the example or testsuite
directory was preserved or obtained from another source). The only
requirement is that make be invoked while setting the
BLIS_INSTALL_PATH variable to the same installation prefix used when
BLIS was configured. The easiest syntax is:
make BLIS_INSTALL_PATH=/install/prefix
though it's also permissible to set BLIS_INSTALL_PATH as an
environment variable prior to running 'make'.
- Updated all lesser Makefiles to implement the new aforementioned build
behavior.
- Relocated check-blastest.sh and check-blistest.sh from build to
blastest and testsuite, respectively, so that if those directories are
copied elsewhere the user can still run 'make check' locally.
- Updated docs/Testsuite.md with language that mentions this new option
of building/linking against an installed copy of BLIS.
This commit is contained in:
@@ -51,13 +51,23 @@
|
||||
|
||||
|
||||
#
|
||||
# --- Distribution path override -----------------------------------------------
|
||||
# --- Determine makefile fragment location -------------------------------------
|
||||
#
|
||||
|
||||
# Override the default DIST_PATH and BUILD_PATH values so that make can find
|
||||
# the source distribution and build location.
|
||||
DIST_PATH := ../..
|
||||
BUILD_PATH := ../..
|
||||
# Comments:
|
||||
# - DIST_PATH is assumed to not exist if BLIS_INSTALL_PATH is given.
|
||||
# - We must use recursively expanded assignment for LIB_PATH and INC_PATH in
|
||||
# the second case because CONFIG_NAME is not yet set.
|
||||
ifneq ($(strip $(BLIS_INSTALL_PATH)),)
|
||||
LIB_PATH := $(BLIS_INSTALL_PATH)/lib
|
||||
INC_PATH := $(BLIS_INSTALL_PATH)/include/blis
|
||||
SHARE_PATH := $(BLIS_INSTALL_PATH)/share/blis
|
||||
else
|
||||
DIST_PATH := ../..
|
||||
LIB_PATH = ../../lib/$(CONFIG_NAME)
|
||||
INC_PATH = ../../include/$(CONFIG_NAME)
|
||||
SHARE_PATH := ../..
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -65,23 +75,8 @@ BUILD_PATH := ../..
|
||||
# --- Include common makefile definitions --------------------------------------
|
||||
#
|
||||
|
||||
# Define the name of the common makefile fragment.
|
||||
COMMON_MK_FILE := common.mk
|
||||
|
||||
# Construct the path to the makefile configuration file that was generated by
|
||||
# the configure script.
|
||||
COMMON_MK_PATH := $(DIST_PATH)/$(COMMON_MK_FILE)
|
||||
|
||||
# Include the common makefile fragment.
|
||||
-include $(COMMON_MK_PATH)
|
||||
|
||||
# Detect whether we actually got the common makefile fragment. If we didn't,
|
||||
# then it is likely that the user has not yet generated it (via configure).
|
||||
ifeq ($(strip $(COMMON_MK_INCLUDED)),yes)
|
||||
COMMON_MK_PRESENT := yes
|
||||
else
|
||||
COMMON_MK_PRESENT := no
|
||||
endif
|
||||
-include $(SHARE_PATH)/common.mk
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +86,7 @@ endif
|
||||
|
||||
# BLIS library and header path. This is simply wherever it was installed.
|
||||
#BLIS_LIB_PATH := $(INSTALL_PREFIX)/lib
|
||||
BLIS_INC_PATH := $(INSTALL_PREFIX)/include/blis
|
||||
#BLIS_INC_PATH := $(INSTALL_PREFIX)/include/blis
|
||||
|
||||
# BLIS library.
|
||||
#BLIS_LIB := $(BLIS_LIB_PATH)/libblis.a
|
||||
@@ -136,6 +131,11 @@ TEST_OBJ_PATH := .
|
||||
## Gather all local source files.
|
||||
TEST_SIZES_SRC := test_size.c
|
||||
|
||||
# Override the value of CINCFLAGS so that the value of CFLAGS returned by
|
||||
# get-frame-cflags-for() is not cluttered up with include paths needed only
|
||||
# while building BLIS.
|
||||
CINCFLAGS := -I$(INC_PATH)
|
||||
|
||||
# Use the CFLAGS for the configuration family.
|
||||
CFLAGS := $(call get-frame-cflags-for,$(CONFIG_NAME))
|
||||
|
||||
@@ -143,7 +143,7 @@ CFLAGS := $(call get-frame-cflags-for,$(CONFIG_NAME))
|
||||
CFLAGS += -I$(TEST_SRC_PATH)
|
||||
|
||||
# Locate the libblis library to which we will link.
|
||||
LIBBLIS_LINK := $(BUILD_PATH)/$(LIBBLIS_LINK)
|
||||
LIBBLIS_LINK := $(LIB_PATH)/$(LIBBLIS_L)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user