KNL ukernel compiles with gcc.

This commit is contained in:
Devin Matthews
2016-04-18 10:14:11 -05:00
parent 58b2c3cf04
commit 49f85177f8
4 changed files with 102 additions and 70 deletions

View File

@@ -44,16 +44,14 @@ MAKE_DEFS_MK_INCLUDED := yes
# --- Determine the C compiler and related flags ---
ifeq ($(CC),)
CC := icc
CC_VENDOR := icc
endif
ifneq ($(CC_VENDOR),icc)
$(error icc is required for this configuration.)
CC := gcc
CC_VENDOR := gcc
endif
# Enable IEEE Standard 1003.1-2004 (POSIX.1d).
# NOTE: This is needed to enable posix_memalign().
CPPROCFLAGS := -D_POSIX_C_SOURCE=200112L
CMISCFLAGS := -mmic -fasm-blocks -std=c99
CMISCFLAGS := -std=c99 -m64
CPICFLAGS := -fPIC
CWARNFLAGS := -Wall
@@ -67,9 +65,29 @@ else
COPTFLAGS := -O3
endif
CVECFLAGS :=
CKOPTFLAGS := $(COPTFLAGS)
ifeq ($(CC_VENDOR),gcc)
CVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl
else
ifeq ($(CC_VENDOR),icc)
CVECFLAGS := -xMIC-AVX512
else
ifeq ($(CC_VENDOR),clang)
CVECFLAGS := -mavx512f -mavx512pf -mfpmath=sse -march=knl
else
$(error gcc, icc, or clang is required for this configuration.)
endif
endif
endif
# The assembler on OS X won't recognize AVX512 without help
ifneq ($(CC_VENDOR),icc)
ifeq ($(OS_NAME),Darwin)
CVECFLAGS += -Wa,-march=knl
endif
endif
# --- Determine the archiver and related flags ---
AR := ar
ARFLAGS := cru
@@ -77,7 +95,7 @@ ARFLAGS := cru
# --- Determine the linker and related flags ---
LINKER := $(CC)
SOFLAGS := -shared
LDFLAGS := -mmic -lm
LDFLAGS := -lm