Files
blis/testsuite/Makefile
Field G. Van Zee 4507862167 Generate/compile with/install monolithic blis.h.
Details:
- Rewrote monolithify-header.sh (and renamed to flatten-header.sh) so that
  headers are inserted recursively. This improves performance by a factor
  of 3-4x.
- Modified configure to create an 'include/<configname>' directory in which
  make can create a monolithic header.
- Modified the top-level Makefile so that a monolithic header is generated
  unconditionally prior to compilation (stored in include/<configname>) and
  so that the single header is installed instead of the 450 or so header
  files that reside throughout the framework source tree.
- Added "include/*/*.h" to .gitignore file.
- Removed some pnacl/emscripten leftovers that I intended to include in
  a1caeba (mostly in testsuite/Makefile).
- Trivial comment changes to frame/include/bli_f2c.h.
2017-11-28 15:16:22 -06:00

214 lines
6.1 KiB
Makefile

#
#
# 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 BLIS testsuite.
#
#
# --- Makefile PHONY target definitions ----------------------------------------
#
.PHONY: all bin clean \
check-env check-env-mk check-env-fragments check-env-make-defs \
run run-amd64 run-x86 run-arm
#
# --- Distribution path override -----------------------------------------------
#
# Override the DIST_PATH value obtained from config.mk (via common.mk) by
# defining it here (prior to including the common.mk).
DIST_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
#
# --- Optional overrides -------------------------------------------------------
#
# Uncomment and modify these definitions if you wish to override the values
# present in the current BLIS configuration's makefile definitions file
# (ie: config/<configname>/make_defs.mk).
# CC := gcc
# LINKER := $(CC)
# CFLAGS := -g -O2 -Wall -Wno-comment
# LDFLAGS :=
# INSTALL_PREFIX := $(HOME)/blis
#
# --- BLAS and LAPACK implementations ------------------------------------------
#
# 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 library.
BLIS_LIB_PATH := $(DIST_PATH)/$(LIB_DIR)/$(CONFIG_NAME)
BLIS_LIB := $(BLIS_LIB_PATH)/libblis.a
# BLAS library path(s). This is where the BLAS libraries reside.
#BLAS_LIB_PATH := $(HOME)/flame/lib
# OpenBLAS, ATLAS, and MKL libraries.
#BLAS_LIB := $(LIB_PATH)/libblas.a
#BLAS_LIB := $(LIB_PATH)/libgoto.a
#BLAS_LIB := $(LIB_PATH)/libgoto2.a
#OPENBLAS_LIB := $(BLAS_LIB_PATH)/libopenblas.a
#ATLAS_LIB := $(BLAS_LIB_PATH)/libf77blas.a \
# $(BLAS_LIB_PATH)/libatlas.a
#MKL_LIB := -L/opt/intel/mkl/10.2.2.025/lib/em64t/ \
# -lmkl_sequential -lmkl_core -lmkl_intel_lp64
#
# --- General build definitions ------------------------------------------------
#
TEST_SRC_PATH := src
TEST_OBJ_PATH := obj
# Gather all local object files.
TEST_OBJS := $(sort $(patsubst $(TEST_SRC_PATH)/%.c, \
$(TEST_OBJ_PATH)/%.o, \
$(wildcard $(TEST_SRC_PATH)/*.c)))
# Binary executable name.
TEST_BIN := test_libblis.x
# Use the CFLAGS for the configuration family.
CFLAGS := $(call get-frame-cflags-for,$(CONFIG_NAME))
# Add local header paths to CFLAGS
#CFLAGS += -I$(BLIS_INC_PATH) -I$(TEST_SRC_PATH)
CFLAGS += -I$(TEST_SRC_PATH)
#
# --- Targets/rules ------------------------------------------------------------
#
# --- Primary targets ---
all: check-env bin
bin: check-env $(TEST_BIN)
# --- Environment check rules ---
check-env: check-env-make-defs check-env-fragments check-env-mk
check-env-mk:
ifeq ($(CONFIG_MK_PRESENT),no)
$(error Cannot proceed: config.mk not detected! Run configure first)
endif
check-env-fragments: check-env-mk
ifeq ($(MAKEFILE_FRAGMENTS_PRESENT),no)
$(error Cannot proceed: makefile fragments not detected! Run configure first)
endif
check-env-make-defs: check-env-fragments
ifeq ($(MAKE_DEFS_MK_PRESENT),no)
$(error Cannot proceed: make_defs.mk not detected! Invalid configuration)
endif
# --Object file rules --
$(TEST_OBJ_PATH)/%.o: $(TEST_SRC_PATH)/%.c $(BLIS_LIB)
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
$(CC) $(CFLAGS) -c $< -o $@
else
@echo "Compiling $<"
@$(CC) $(CFLAGS) -c $< -o $@
endif
# -- Executable file rules --
$(TEST_BIN): $(TEST_OBJS) $(BLIS_LIB)
ifeq ($(BLIS_ENABLE_VERBOSE_MAKE_OUTPUT),yes)
$(LINKER) $(TEST_OBJS) $(BLIS_LIB) $(LDFLAGS) -o $@
else
@echo "Linking $@ against '$(BLIS_LIB) $(LDFLAGS)'"
@$(LINKER) $(TEST_OBJS) $(BLIS_LIB) $(LDFLAGS) -o $@
endif
# -- Test run rules --
run: $(TEST_BIN)
./$(TEST_BIN)
# -- Clean rules --
clean:
- $(RM_F) $(TEST_OBJS) $(TEST_BIN)