Skip to content

Commit

Permalink
Added support for PGI (LLNL#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfadden8 authored and davidbeckingsale committed Mar 22, 2018
1 parent f2c7e9a commit ef3847c
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 10 deletions.
5 changes: 4 additions & 1 deletion cmake/BLTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ endmacro(blt_add_benchmark)
## XL xlFlag (optional)
## MSVC msvcFlag (optional)
## MSVC_INTEL msvcIntelFlag (optional)
## PGI pgiFlag (optional)
## )
##
## Appends compiler-specific flags to a given variable of flags
Expand All @@ -701,7 +702,7 @@ endmacro(blt_add_benchmark)
macro(blt_append_custom_compiler_flag)

set(options)
set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG HCC INTEL XL MSVC MSVC_INTEL)
set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG HCC PGI INTEL XL MSVC MSVC_INTEL)
set(multiValueArgs)

# Parse the arguments
Expand All @@ -724,6 +725,8 @@ macro(blt_append_custom_compiler_flag)
set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_GNU} " )
elseif( DEFINED arg_HCC AND COMPILER_FAMILY_IS_HCC )
set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_HCC} " )
elseif( DEFINED arg_PGI AND COMPILER_FAMILY_IS_PGI )
set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_PGI} " )
elseif( DEFINED arg_MSVC_INTEL AND COMPILER_FAMILY_IS_MSVC_INTEL )
set (${arg_FLAGS_VAR} "${${arg_FLAGS_VAR}} ${arg_MSVC_INTEL} " )
elseif( DEFINED arg_MSVC AND (COMPILER_FAMILY_IS_MSVC OR COMPILER_FAMILY_IS_MSVC_INTEL) )
Expand Down
23 changes: 14 additions & 9 deletions cmake/SetupCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "HCC") # For ROCm
set(COMPILER_FAMILY_IS_HCC 1)
message(STATUS "Compiler family is HCC Clang")

elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "PGI")
set(COMPILER_FAMILY_IS_PGI 1)
message(STATUS "Compiler family is PGI")

elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL")
set(COMPILER_FAMILY_IS_XL 1)
message(STATUS "Compiler family is XL")
Expand Down Expand Up @@ -256,18 +260,18 @@ if( BLT_CXX_STD STREQUAL c++98 )
set(CMAKE_CXX_STANDARD 98)
elseif( BLT_CXX_STD STREQUAL c++11 )
set(CMAKE_CXX_STANDARD 11)
if (COMPILER_FAMILY_IS_XL)
blt_append_custom_compiler_flag(
blt_append_custom_compiler_flag(
FLAGS_VAR CMAKE_CXX_FLAGS
DEFAULT "-std=c++11")
endif ()
elseif( BLT_CXX_STD STREQUAL c++14 )
DEFAULT " "
XL "-std=c++11"
PGI "--c++11")
elseif( BLT_CXX_STD STREQUAL c++14)
set(CMAKE_CXX_STANDARD 14)
if (COMPILER_FAMILY_IS_XL)
blt_append_custom_compiler_flag(
blt_append_custom_compiler_flag(
FLAGS_VAR CMAKE_CXX_FLAGS
DEFAULT "-std=c++1y")
endif ()
DEFAULT " "
XL "-std=c++1y"
PGI "--c++14")
else()
message(FATAL_ERROR "${BLT_CXX_STD} is an invalid entry for BLT_CXX_STD.
Valid Options are ( c++98, c++11, c++14 )")
Expand All @@ -287,6 +291,7 @@ blt_append_custom_compiler_flag(
# Additional possibilities for clang include:
# "-Wdocumentation -Wdeprecated -Weverything"
HCC "-Wall"
PGI "-Minform=warn"
MSVC "/W4"
# Additional possibilities for visual studio include:
# "/Wall /wd4619 /wd4668 /wd4820 /wd4571 /wd4710"
Expand Down
25 changes: 25 additions & 0 deletions cmake/blt-test/host-configs/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###########################################################
# Example host-config file for the quartz cluster at LLNL
###########################################################
#
# This file provides CMake with paths / details for:
# C,C++, & Fortran compilers
#
###########################################################

###########################################################
# [email protected] compilers
###########################################################

# c compiler
set(CMAKE_C_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgcc" CACHE PATH "")

# cpp compiler
set(CMAKE_CXX_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgc++" CACHE PATH "")

# fortran support
set(ENABLE_FORTRAN ON CACHE BOOL "")

# fortran support
set(CMAKE_Fortran_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgfortran" CACHE PATH "")

25 changes: 25 additions & 0 deletions docs/tutorial/host-configs/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###########################################################
# Example host-config file for the quartz cluster at LLNL
###########################################################
#
# This file provides CMake with paths / details for:
# C,C++, & Fortran compilers
#
###########################################################

###########################################################
# [email protected] compilers
###########################################################

# c compiler
set(CMAKE_C_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgcc" CACHE PATH "")

# cpp compiler
set(CMAKE_CXX_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgc++" CACHE PATH "")

# fortran support
set(ENABLE_FORTRAN ON CACHE BOOL "")

# fortran support
set(CMAKE_Fortran_COMPILER "/usr/tce/packages/pgi/pgi-17.10/bin/pgfortran" CACHE PATH "")

0 comments on commit ef3847c

Please sign in to comment.