mirror of
https://github.com/amd/blis.git
synced 2026-05-11 17:50:00 +00:00
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.
162 lines
4.5 KiB
Makefile
162 lines
4.5 KiB
Makefile
#!/bin/bash
|
|
#
|
|
# BLIS
|
|
# An object-based framework for developing high-performance BLAS-like
|
|
# libraries.
|
|
#
|
|
# Copyright (C) 2014, The University of Texas at Austin
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions are
|
|
# met:
|
|
# - Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# - Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
# documentation and/or other materials provided with the distribution.
|
|
# - Neither the name of The University of Texas at Austin nor the names
|
|
# of its contributors may be used to endorse or promote products
|
|
# derived from this software without specific prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#
|
|
#
|
|
|
|
#
|
|
# Makefile
|
|
#
|
|
# Field G. Van Zee
|
|
#
|
|
# Makefile for standalone BLIS test drivers.
|
|
#
|
|
|
|
#
|
|
# --- Makefile PHONY target definitions ----------------------------------------
|
|
#
|
|
|
|
.PHONY: all \
|
|
test-ranges \
|
|
clean cleanx
|
|
|
|
|
|
|
|
#
|
|
# --- Determine makefile fragment location -------------------------------------
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
|
#
|
|
# --- Include common makefile definitions --------------------------------------
|
|
#
|
|
|
|
# Include the common makefile fragment.
|
|
-include $(SHARE_PATH)/common.mk
|
|
|
|
|
|
|
|
#
|
|
# --- General build definitions ------------------------------------------------
|
|
#
|
|
|
|
TEST_SRC_PATH := .
|
|
TEST_OBJ_PATH := .
|
|
|
|
# Gather all local object files.
|
|
TEST_OBJS := $(sort $(patsubst $(TEST_SRC_PATH)/%.c, \
|
|
$(TEST_OBJ_PATH)/%.o, \
|
|
$(wildcard $(TEST_SRC_PATH)/*.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))
|
|
|
|
# Add installed and local header paths to CFLAGS
|
|
CFLAGS += -I$(TEST_SRC_PATH)
|
|
|
|
# Locate the libblis library to which we will link.
|
|
LIBBLIS_LINK := $(LIB_PATH)/$(LIBBLIS_L)
|
|
|
|
|
|
# Datatype
|
|
DT_S := -DDT=BLIS_FLOAT
|
|
DT_D := -DDT=BLIS_DOUBLE
|
|
DT_C := -DDT=BLIS_SCOMPLEX
|
|
DT_Z := -DDT=BLIS_DCOMPLEX
|
|
|
|
# Problem size specification
|
|
PDEF_MT := -DP_BEGIN=400 \
|
|
-DP_END=8000 \
|
|
-DP_INC=400
|
|
|
|
|
|
|
|
#
|
|
# --- Targets/rules ------------------------------------------------------------
|
|
#
|
|
|
|
all: test-ranges
|
|
|
|
test-ranges: \
|
|
test_ranges.x
|
|
|
|
|
|
|
|
# --Object file rules --
|
|
|
|
$(TEST_OBJ_PATH)/%.o: $(TEST_SRC_PATH)/%.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
# blis asm
|
|
test_%.o: test_%.c
|
|
$(CC) $(CFLAGS) $(PDEF_MT) $(DT_D) -c $< -o $@
|
|
|
|
|
|
# -- Executable file rules --
|
|
|
|
# NOTE: For the BLAS test drivers, we place the BLAS libraries before BLIS
|
|
# on the link command line in case BLIS was configured with the BLAS
|
|
# compatibility layer. This prevents BLIS from inadvertently getting called
|
|
# for the BLAS routines we are trying to test with.
|
|
|
|
test_ranges.x: test_ranges.o $(LIBBLIS_LINK)
|
|
$(LINKER) $< $(LIBBLIS_LINK) $(LDFLAGS) -o $@
|
|
|
|
|
|
# -- Clean rules --
|
|
|
|
clean: cleanx
|
|
|
|
cleanx:
|
|
- $(RM_F) *.o *.x
|
|
|