Add XL compiler support to OpenMP and RAJA makefiles

This commit is contained in:
Tom Deakin 2017-02-24 17:37:30 +00:00
parent dfe5503cba
commit 050a27ca83
2 changed files with 12 additions and 6 deletions

View File

@ -3,7 +3,7 @@ ifndef COMPILER
define compiler_help
Set COMPILER to change flags (defaulting to GNU).
Available compilers are:
CLANG CRAY GNU INTEL
CLANG CRAY GNU INTEL XL
endef
$(info $(compiler_help))
@ -25,12 +25,14 @@ COMPILER_GNU = g++
COMPILER_INTEL = icpc
COMPILER_CRAY = CC
COMPILER_CLANG = clang++
COMPILER_XL = xlc++
CXX = $(COMPILER_$(COMPILER))
FLAGS_GNU = -O3 -std=c++11
FLAGS_INTEL = -O3 -std=c++11 -xHOST
FLAGS_CRAY = -O3 -hstd=c++11
FLAGS_CLANG = -O3 -std=c++11
FLAGS_XL = -O5 -qarch=pwr8 -qtune=pwr8 -std=c++11
CXXFLAGS = $(FLAGS_$(COMPILER))
# OpenMP flags for CPUs
@ -38,6 +40,7 @@ OMP_GNU_CPU = -fopenmp
OMP_INTEL_CPU = -qopenmp
OMP_CRAY_CPU = -homp
OMP_CLANG_CPU = -fopenmp=libomp
OMP_XL_CPU = -qsmp=omp -qthreaded
# OpenMP flags for NVIDIA
OMP_CRAY_NVIDIA = -DOMP_TARGET_GPU

View File

@ -12,25 +12,28 @@ endif
ifeq ($(TARGET), CPU)
COMP=$(CXX)
CXXFLAGS = -O3 -std=c++11 -DRAJA_TARGET_CPU
CXXFLAGS = -DRAJA_TARGET_CPU
ifndef COMPILER
define compiler_help
Set COMPILER to ensure correct OpenMP flags are set.
Available compilers are:
INTEL GNU CRAY
INTEL GNU CRAY XL
endef
$(info $(compiler_help))
endif
ifeq ($(COMPILER), INTEL)
COMP = icpc
CXXFLAGS += -qopenmp
CXXFLAGS += -O3 -std=c++11 -qopenmp
else ifeq ($(COMPILER), GNU)
COMP = g++
CXXFLAGS += -fopenmp
CXXFLAGS += -O3 -std=c++11 -fopenmp
else ifeq ($(COMPILER), CRAY)
COMP = CC
CXXFLAGS +=
CXXFLAGS += -O3 -hstd=c++11
else ifeq ($(COMPILER), XL)
COMP = xlc++
CXXFLAGS += -O5 -std=c++11 -qarch=pwr8 -qtune=pwr8 -qsmp=omp -qthreaded
endif
else ifeq ($(TARGET), GPU)