Streamline build system
This commit is contained in:
parent
4b481bb407
commit
d026028439
16
Makefile
16
Makefile
@ -1,22 +1,28 @@
|
|||||||
TAG = GCC
|
|
||||||
|
|
||||||
#CONFIGURE BUILD SYSTEM
|
#CONFIGURE BUILD SYSTEM
|
||||||
TARGET = MDBench-$(TAG)
|
TARGET = MDBench-$(TAG)
|
||||||
BUILD_DIR = ./$(TAG)
|
BUILD_DIR = ./$(TAG)
|
||||||
SRC_DIR = ./src
|
SRC_DIR = ./src
|
||||||
MAKE_DIR = ./
|
MAKE_DIR = ./
|
||||||
FLAGS = -DAOS
|
|
||||||
Q ?= @
|
Q ?= @
|
||||||
|
|
||||||
#DO NOT EDIT BELOW
|
#DO NOT EDIT BELOW
|
||||||
|
include $(MAKE_DIR)/config.mk
|
||||||
include $(MAKE_DIR)/include_$(TAG).mk
|
include $(MAKE_DIR)/include_$(TAG).mk
|
||||||
INCLUDES += -I./src/includes
|
INCLUDES += -I./src/includes
|
||||||
|
|
||||||
|
ifeq ($(strip $(DATA_LAYOUT)),AOS)
|
||||||
|
DEFINES += -DAOS
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(DATA_TYPE)),SP)
|
||||||
|
DEFINES += -DPRECISION=1
|
||||||
|
else
|
||||||
|
DEFINES += -DPRECISION=2
|
||||||
|
endif
|
||||||
|
|
||||||
VPATH = $(SRC_DIR)
|
VPATH = $(SRC_DIR)
|
||||||
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c))
|
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.c))
|
||||||
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
||||||
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(INCLUDES) ${FLAGS}
|
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
||||||
|
|
||||||
|
|
||||||
${TARGET}: $(BUILD_DIR) $(OBJ)
|
${TARGET}: $(BUILD_DIR) $(OBJ)
|
||||||
@echo "===> LINKING $(TARGET)"
|
@echo "===> LINKING $(TARGET)"
|
||||||
|
@ -4,9 +4,10 @@ A simple, sequential C implementation of the [Mantevo miniMD](https://github.co
|
|||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
1. Open the `Makefile` and edit the `TAG` value according to the tool chain used. Currently supported is GCC, CLANG (LLVM), and ICC (Intel).
|
1. Open `config.mk` and edit the `TAG` value according to the tool chain used. Currently supported is GCC, CLANG (LLVM), and ICC (Intel).
|
||||||
2. Open and adapt the compiler flags in `<include_<TOOLCHAIN>.mk`, e.g. in `include_ICC.mk` for the Intel tool chain.
|
2. Change `DATA_LAYOUT` and `DATA_TYPE` if desired in config.mk.
|
||||||
3. Build the binary calling `make`.
|
3. Open and adapt the compiler flags in `<include_<TOOLCHAIN>.mk`, e.g. in `include_ICC.mk` for the Intel tool chain.
|
||||||
|
4. Build the binary calling `make`.
|
||||||
|
|
||||||
You can clean intermediate build results with `make clean`, and all build results with `make distclean`.
|
You can clean intermediate build results with `make clean`, and all build results with `make distclean`.
|
||||||
You have to call `make clean` before `make` if you changed the build settings.
|
You have to call `make clean` before `make` if you changed the build settings.
|
||||||
|
7
config.mk
Normal file
7
config.mk
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# Supported: GCC, CLANG, ICC
|
||||||
|
TAG ?= GCC
|
||||||
|
DATA_TYPE ?= SP#SP or DP
|
||||||
|
DATA_LAYOUT ?= AOS#AOS or SOA
|
||||||
|
|
||||||
|
#Feature options
|
||||||
|
OPTIONS += -DALIGNMENT=64
|
@ -1,5 +1,4 @@
|
|||||||
CC = cc
|
CC = cc
|
||||||
CXX = gcc
|
|
||||||
LINKER = $(CC)
|
LINKER = $(CC)
|
||||||
|
|
||||||
ANSI_CFLAGS = -ansi
|
ANSI_CFLAGS = -ansi
|
||||||
@ -9,9 +8,7 @@ ANSI_CFLAGS += -Wextra
|
|||||||
|
|
||||||
CFLAGS = -Ofast $(ANSI_CFLAGS) -g #-Xpreprocessor -fopenmp -g
|
CFLAGS = -Ofast $(ANSI_CFLAGS) -g #-Xpreprocessor -fopenmp -g
|
||||||
ASFLAGS = -masm=intel
|
ASFLAGS = -masm=intel
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
FCFLAGS =
|
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEFINES = -D_GNU_SOURCE -DALIGNMENT=64 -DPRECISION=2
|
DEFINES = -D_GNU_SOURCE
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
LIBS = #-lomp
|
LIBS = -lm #-lomp
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
LINKER = $(CC)
|
||||||
FC = gfortran
|
|
||||||
LINKER = $(CXX)
|
|
||||||
|
|
||||||
ANSI_CFLAGS = -ansi
|
ANSI_CFLAGS = -ansi
|
||||||
ANSI_CFLAGS += -std=c99
|
ANSI_CFLAGS += -std=c99
|
||||||
@ -10,10 +8,8 @@ ANSI_CFLAGS += -Wextra
|
|||||||
|
|
||||||
CFLAGS = -O0 -g -std=c99 -fargument-noalias
|
CFLAGS = -O0 -g -std=c99 -fargument-noalias
|
||||||
# CFLAGS = -O3 -march=znver1 -ffast-math -funroll-loops -fopenmp
|
# CFLAGS = -O3 -march=znver1 -ffast-math -funroll-loops -fopenmp
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
ASFLAGS = -masm=intel
|
ASFLAGS = -masm=intel
|
||||||
FCFLAGS =
|
|
||||||
LFLAGS =
|
LFLAGS =
|
||||||
DEFINES = -D_GNU_SOURCE -DALIGNMENT=64 -DPRECISION=2
|
DEFINES = -D_GNU_SOURCE
|
||||||
INCLUDES =
|
INCLUDES =
|
||||||
LIBS =
|
LIBS = -lm
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
CC = icc
|
CC = icc
|
||||||
CXX = icpc
|
|
||||||
LINKER = $(CC)
|
LINKER = $(CC)
|
||||||
|
|
||||||
OPENMP = #-qopenmp
|
OPENMP = #-qopenmp
|
||||||
@ -11,10 +10,8 @@ PROFILE = #-profile-functions -g -pg
|
|||||||
#OPTS = -fast -no-vec $(PROFILE)
|
#OPTS = -fast -no-vec $(PROFILE)
|
||||||
OPTS = -fast -xHost $(PROFILE)
|
OPTS = -fast -xHost $(PROFILE)
|
||||||
CFLAGS = $(PROFILE) -restrict $(OPENMP) $(OPTS)
|
CFLAGS = $(PROFILE) -restrict $(OPENMP) $(OPTS)
|
||||||
CXXFLAGS = $(CFLAGS)
|
|
||||||
ASFLAGS = -masm=intel
|
ASFLAGS = -masm=intel
|
||||||
FCFLAGS =
|
|
||||||
LFLAGS = $(PROFILE) $(OPTS) $(OPENMP)
|
LFLAGS = $(PROFILE) $(OPTS) $(OPENMP)
|
||||||
DEFINES = -D_GNU_SOURCE -DALIGNMENT=64 # -DLIKWID_PERFMON -DPRECISION=1
|
DEFINES = -D_GNU_SOURCE # -DALIGNMENT=64 -DLIKWID_PERFMON -DPRECISION=1
|
||||||
INCLUDES = #$(LIKWID_INC)
|
INCLUDES = #$(LIKWID_INC)
|
||||||
LIBS = #$(LIKWID_LIB) -llikwid
|
LIBS = -lm #$(LIKWID_LIB) -llikwid
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
#ifndef __PARAMETER_H_
|
#ifndef __PARAMETER_H_
|
||||||
#define __PARAMETER_H_
|
#define __PARAMETER_H_
|
||||||
|
|
||||||
#ifndef PRECISION
|
|
||||||
#define PRECISION 2
|
|
||||||
#endif
|
|
||||||
#if PRECISION == 1
|
#if PRECISION == 1
|
||||||
#define MD_FLOAT float
|
#define MD_FLOAT float
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user