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

View File

@ -12,25 +12,28 @@ endif
ifeq ($(TARGET), CPU) ifeq ($(TARGET), CPU)
COMP=$(CXX) COMP=$(CXX)
CXXFLAGS = -O3 -std=c++11 -DRAJA_TARGET_CPU CXXFLAGS = -DRAJA_TARGET_CPU
ifndef COMPILER ifndef COMPILER
define compiler_help define compiler_help
Set COMPILER to ensure correct OpenMP flags are set. Set COMPILER to ensure correct OpenMP flags are set.
Available compilers are: Available compilers are:
INTEL GNU CRAY INTEL GNU CRAY XL
endef endef
$(info $(compiler_help)) $(info $(compiler_help))
endif endif
ifeq ($(COMPILER), INTEL) ifeq ($(COMPILER), INTEL)
COMP = icpc COMP = icpc
CXXFLAGS += -qopenmp CXXFLAGS += -O3 -std=c++11 -qopenmp
else ifeq ($(COMPILER), GNU) else ifeq ($(COMPILER), GNU)
COMP = g++ COMP = g++
CXXFLAGS += -fopenmp CXXFLAGS += -O3 -std=c++11 -fopenmp
else ifeq ($(COMPILER), CRAY) else ifeq ($(COMPILER), CRAY)
COMP = CC 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 endif
else ifeq ($(TARGET), GPU) else ifeq ($(TARGET), GPU)