Skip to content

Commit c45c270

Browse files
committed
Drop uses of Trilinos_ENABLE_CXX11
Also drop uses of the form `${PROJECT_NAME}_ENABLE_CXX11`.
1 parent 44f27e9 commit c45c270

File tree

16 files changed

+43
-168
lines changed

16 files changed

+43
-168
lines changed

CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ INCLUDE(${CMAKE_SOURCE_DIR}/ProjectName.cmake)
6969
# not in an include file :-(
7070
PROJECT(${PROJECT_NAME} NONE)
7171

72-
# Set default C++ standard to C++11
73-
SET(Trilinos_ENABLE_CXX11_DEFAULT ON)
74-
7572
#
7673
# B) Pull in the TriBITS system and execute
7774
#

cmake/CallbackSetupExtraOptions.cmake

-39
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,6 @@
33
# TrilinosCreateClientTemplateHeaders.cmake
44
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Trilinos_SOURCE_DIR}/cmake")
55

6-
MACRO(TRILINOS_DISABLE_PACKAGE_REQUIRING_CXX11 CXX11_PACKAGE_NAME_IN)
7-
IF ("${${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN}}" STREQUAL "")
8-
MESSAGE(
9-
"\n***"
10-
"\n*** NOTE: Setting ${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN}=OFF"
11-
" because ${PROJECT_NAME}_ENABLE_CXX11='${${PROJECT_NAME}_ENABLE_CXX11}'!"
12-
"\n***\n"
13-
)
14-
SET(${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN} OFF)
15-
ELSEIF (${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN})
16-
MESSAGE( FATAL_ERROR
17-
"ERROR: Setting"
18-
" ${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN}='${${PROJECT_NAME}_ENABLE_${CXX11_PACKAGE_NAME_IN}}'"
19-
" is not consistent with "
20-
" ${PROJECT_NAME}_ENABLE_CXX11='${${PROJECT_NAME}_ENABLE_CXX11}'!"
21-
" ${CXX11_PACKAGE_NAME_IN} requires C++11 support! Either don't"
22-
" enable the package ${CXX11_PACKAGE_NAME_IN} or enable support for C++11!")
23-
ELSE()
24-
# This package is already disabled which is just fine.
25-
ENDIF()
26-
ENDMACRO()
27-
28-
296
MACRO(TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS)
307

318
#MESSAGE("TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS got called!")
@@ -58,16 +35,6 @@ MACRO(TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS)
5835
OPTION(Trilinos_ENABLE_THREAD_SAFE
5936
"Enable thread safe code including RCP classes." OFF )
6037

61-
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_CXX11)
62-
IF (Trilinos_ENABLE_THREAD_SAFE AND NOT ${PROJECT_NAME}_ENABLE_CXX11)
63-
MESSAGE(FATAL_ERROR
64-
"You set Trilinos_ENABLE_THREAD_SAFE=ON, but ${PROJECT_NAME}' support"
65-
" for CXX11 is not enabled (${PROJECT_NAME}_ENABLE_CXX11=OFF)."
66-
" This is not allowed. Please enable ${PROJECT_NAME}_ENABLE_CXX11 in"
67-
" ${PROJECT_NAME} before attempting to enable Trilinos_ENABLE_THREAD_SAFE"
68-
" or leave Trilinos_ENABLE_THREAD_SAFE off.")
69-
ENDIF ()
70-
7138
#
7239
# Trilinos Data Dir? Is this still being used anywhere?
7340
#
@@ -79,12 +46,6 @@ MACRO(TRIBITS_REPOSITORY_SETUP_EXTRA_OPTIONS)
7946
#
8047
# Put in disables based on various criteria
8148
#
82-
83-
IF (NOT ${PROJECT_NAME}_ENABLE_CXX11)
84-
TRILINOS_DISABLE_PACKAGE_REQUIRING_CXX11("Kokkos")
85-
TRILINOS_DISABLE_PACKAGE_REQUIRING_CXX11("Tpetra")
86-
ENDIF()
87-
8849
IF (
8950
NOT ${PROJECT_NAME}_ENABLE_Fortran
9051
AND

cmake/ProjectCompilerPostConfig.cmake

-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
IF (${PROJECT_NAME}_ENABLE_Kokkos)
2-
3-
MESSAGE("-- " "Skip adding flags for C++11 because Kokkos flags does that ...")
4-
# Set this to empty to trick Tribits into passing the C++11 flag check
5-
SET(${PROJECT_NAME}_CXX11_FLAGS)
6-
72
MESSAGE("-- " "Skip adding flags for OpenMP because Kokkos flags does that ...")
83
SET(OpenMP_CXX_FLAGS_OVERRIDE " ")
94

doc/build_ref/TrilinosBuildReferenceTemplate.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,8 @@ the Kokkos settings are not used and the default Trilinos CMake configuration
155155
is used as described below.
156156

157157
If ``KOKKOS_ARCH != None`` is set, then the correct compiler flags for
158-
C++11 and OpenMP are selected by the Kokkos system and the values of the cache
159-
vars ``Trilinos_CXX11_FLAGS`` and ``OpenMP_CXX_FLAGS`` set by the user will be
160-
ignored.
158+
OpenMP are selected by the Kokkos system and the value of the cache
159+
var ``OpenMP_CXX_FLAGS`` set by the user will be ignored.
161160

162161
``KOKKOS_ARCH`` can be set to a list of entries with different values for the
163162
host code and the device code using semi-colons as::

packages/muelu/CMakeLists.txt

-11
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ IF( TPL_ENABLE_AVATAR AND ${PACKAGE_NAME}_ENABLE_AvatarT)
3939
MESSAGE(FATAL_ERROR "MueLu does not support Avatar being built both as a TPL and as an external package.")
4040
ENDIF()
4141

42-
# JJH: pulled this logic from Tpetra. Comments below about CUDA are from Tpetra developers.
43-
# This is redundant, since MueLu also requires Kokkos, and Kokkos requires C++11.
44-
# "I left a special case for CUDA because I'm not sure whether TriBITS
45-
# counts C++11 as enabled in that case; please feel free to revise if
46-
# you know better."
47-
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_CXX11)
48-
ASSERT_DEFINED(TPL_ENABLE_CUDA)
49-
IF (NOT ${PROJECT_NAME}_ENABLE_CXX11 AND NOT TPL_ENABLE_CUDA)
50-
MESSAGE(FATAL_ERROR "MueLu requires that C++11 support in Trilinos be enabled. This should happen automatically if your compiler is C++11 compliant.")
51-
ENDIF ()
52-
5342
IF ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7") AND NOT TPL_ENABLE_CUDA)
5443
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
5544
ENDIF()

packages/sacado/CMakeLists.txt

+2-10
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,8 @@ int main()
123123
CHECK_CXX_SOURCE_COMPILES("${SOURCE_C99_TR1_CMATH}"
124124
HAS_C99_TR1_CMATH)
125125

126-
TRIBITS_ADD_OPTION_AND_DEFINE(
127-
Sacado_ENABLE_CXX11
128-
HAVE_SACADO_CXX11
129-
"Enable C++11 support in Sacado."
130-
"${${PROJECT_NAME}_ENABLE_CXX11}"
131-
)
132-
133-
IF(Sacado_NEW_FAD_DESIGN_IS_DEFAULT AND NOT Sacado_ENABLE_CXX11)
134-
message(FATAL_ERROR "New Fad design requires C++11 enabled. Please reconfigure with ${PROJECT_NAME}_ENABLE_CXX11=ON.")
135-
ENDIF()
126+
# FIXME: Remove this hard-coded setting. We always have C++11 now.
127+
SET(HAVE_SACADO_CXX11 ON)
136128

137129
#
138130
# C) Add the libraries, tests, and examples

packages/sacado/example/CMakeLists.txt

+6-8
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,12 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST(
114114
NUM_MPI_PROCS 1
115115
)
116116

117-
IF (Sacado_ENABLE_CXX11)
118-
TRIBITS_ADD_EXECUTABLE_AND_TEST(
119-
template_container_example
120-
SOURCES template_container_example.cpp
121-
COMM serial mpi
122-
NUM_MPI_PROCS 1
123-
)
124-
ENDIF()
117+
TRIBITS_ADD_EXECUTABLE_AND_TEST(
118+
template_container_example
119+
SOURCES template_container_example.cpp
120+
COMM serial mpi
121+
NUM_MPI_PROCS 1
122+
)
125123

126124
IF(Sacado_ENABLE_TeuchosNumerics)
127125

packages/sacado/test/UnitTests/CMakeLists.txt

+24-26
Original file line numberDiff line numberDiff line change
@@ -280,34 +280,32 @@ IF (Sacado_ENABLE_TeuchosCore)
280280

281281
ENDIF()
282282

283-
IF (Sacado_ENABLE_CXX11)
284-
TRIBITS_ADD_EXECUTABLE_AND_TEST(
285-
PromoteTests
286-
SOURCES PromoteTests.cpp
287-
ARGS
288-
COMM serial mpi
289-
NUM_MPI_PROCS 1
290-
STANDARD_PASS_OUTPUT
291-
)
283+
TRIBITS_ADD_EXECUTABLE_AND_TEST(
284+
PromoteTests
285+
SOURCES PromoteTests.cpp
286+
ARGS
287+
COMM serial mpi
288+
NUM_MPI_PROCS 1
289+
STANDARD_PASS_OUTPUT
290+
)
292291

293-
TRIBITS_ADD_EXECUTABLE_AND_TEST(
294-
MPLTests
295-
SOURCES MPLTests.cpp
296-
ARGS
297-
COMM serial mpi
298-
NUM_MPI_PROCS 1
299-
STANDARD_PASS_OUTPUT
300-
)
292+
TRIBITS_ADD_EXECUTABLE_AND_TEST(
293+
MPLTests
294+
SOURCES MPLTests.cpp
295+
ARGS
296+
COMM serial mpi
297+
NUM_MPI_PROCS 1
298+
STANDARD_PASS_OUTPUT
299+
)
301300

302-
TRIBITS_ADD_EXECUTABLE_AND_TEST(
303-
ConditionalReturnTypeTest
304-
SOURCES ConditionalReturnTypeTest.cpp
305-
ARGS
306-
COMM serial mpi
307-
NUM_MPI_PROCS 1
308-
STANDARD_PASS_OUTPUT
309-
)
310-
ENDIF()
301+
TRIBITS_ADD_EXECUTABLE_AND_TEST(
302+
ConditionalReturnTypeTest
303+
SOURCES ConditionalReturnTypeTest.cpp
304+
ARGS
305+
COMM serial mpi
306+
NUM_MPI_PROCS 1
307+
STANDARD_PASS_OUTPUT
308+
)
311309

312310
TRIBITS_ADD_EXECUTABLE_AND_TEST(
313311
ConversionTests

packages/stokhos/CMakeLists.txt

+2-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@ IF(HAVE_STOKHOS_ENSEMBLE_GEMV)
4747
SET(Stokhos_Ensemble_GEMV_Team_Size 1 CACHE INTEGER "Team size used in the ensemble GEMV")
4848
ENDIF()
4949

50-
TRIBITS_ADD_OPTION_AND_DEFINE(
51-
Stokhos_ENABLE_CXX11
52-
HAVE_STOKHOS_CXX11
53-
"Enable C++11 support in Stokhos."
54-
"${${PROJECT_NAME}_ENABLE_CXX11}"
55-
)
50+
# FIXME: Remove this hard-coded setting. We always have C++11 now.
51+
SET(HAVE_STOKHOS_CXX11 ON)
5652

5753
SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default OFF)
5854
IF(Stokhos_ENABLE_Sacado)

packages/teuchos/CMakeLists.txt

-10
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,6 @@ TRIBITS_ADD_OPTION_AND_DEFINE(
198198
${Trilinos_ENABLE_THREAD_SAFE}
199199
)
200200

201-
IF (${PACKAGE_NAME}_ENABLE_THREAD_SAFE AND NOT ${PROJECT_NAME}_ENABLE_CXX11)
202-
MESSAGE(FATAL_ERROR
203-
"You set ${PACKAGE_NAME}_ENABLE_THREAD_SAFE=ON, but ${PACKAGE_NAME}' support"
204-
" for CXX11 is not enabled (${PROJECT_NAME}_ENABLE_CXX11=OFF)."
205-
" This is not allowed. Please enable ${PACKAGE_NAME}_ENABLE_CXX11 in"
206-
" ${PACKAGE_NAME} before attempting to enable ${PACKAGE_NAME}_ENABLE_THREAD_SAFE"
207-
" or leave ${PACKAGE_NAME}_ENABLE_THREAD_SAFE off.")
208-
ENDIF ()
209-
210201
ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_THREAD_SAFE)
211202
ASSERT_DEFINED(${PACKAGE_NAME}Core_ENABLE_Pthread)
212203
COMBINED_OPTION(
@@ -441,7 +432,6 @@ SET(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/tribits
441432
CACHE PATH "By default assume Teuchos is in Trilinos")
442433
INCLUDE("${${PROJECT_NAME}_TRIBITS_DIR}/TriBITS.cmake")
443434
SET(TEUCHOS_STANDALONE_PACKAGE TRUE)
444-
SET(${PROJECT_NAME}_ENABLE_CXX11_DEFAULT ON)
445435
SET(${PROJECT_NAME}_ENABLE_Teuchos ON CACHE BOOL
446436
"Set by default in teuchos/CMakeLists.txt")
447437
TRIBITS_PROJECT()

packages/teuchos/core/src/CMakeLists.txt

+2-13
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ IF (${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}ParameterList)
2626
SET(HAVE_TEUCHOS_PARAMETERLIST TRUE)
2727
ENDIF()
2828

29-
# Have C++11?
30-
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_CXX11)
31-
SET(HAVE_TEUCHOSCORE_CXX11 ${${PROJECT_NAME}_ENABLE_CXX11})
29+
# FIXME: Remove this hard-coded setting. We always have C++11 now.
30+
SET(HAVE_TEUCHOSCORE_CXX11 ON)
3231

3332
SET(YAML_CPP_DEF 0)
3433
IF(${PACKAGE_NAME}_ENABLE_yaml-cpp)
@@ -84,16 +83,6 @@ IF (NOT ${PACKAGE_NAME}_ENABLE_Boost)
8483

8584
ENDIF()
8685

87-
IF (NOT ${PROJECT_NAME}_ENABLE_CXX11)
88-
89-
LIST(REMOVE_ITEM HEADERS
90-
${CMAKE_CURRENT_SOURCE_DIR}/Teuchos_RCPStdSharedPtrConversions.hpp
91-
${CMAKE_CURRENT_SOURCE_DIR}/Teuchos_RCPStdSharedPtrConversionsDecl.hpp
92-
)
93-
94-
ENDIF()
95-
96-
9786
ASSERT_DEFINED(TPL_ENABLE_Valgrind)
9887
IF(TPL_ENABLE_Valgrind)
9988
INCLUDE_DIRECTORIES(${TPL_Valgrind_INCLUDE_DIRS})

packages/teuchos/core/test/MemoryManagement/CMakeLists.txt

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
# executables are also likely to fail as well.
55
#
66

7-
IF (
8-
(${PACKAGE_NAME}_ENABLE_Boost AND HAVE_TEUCHOSCORE_BOOST_IS_POLYMORPHIC)
9-
OR ${PROJECT_NAME}_ENABLE_CXX11
10-
)
11-
SET(HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR TRUE)
12-
ELSE()
13-
SET(HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR FALSE)
14-
ENDIF()
15-
7+
# FIXME: Remove this hard-coded setting. We always have C++11 now.
8+
SET(HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR TRUE)
169

1710
IF (HAS_TEUCHOS_GET_BASE_OBJ_VOID_PTR)
1811
TRIBITS_ADD_EXECUTABLE_AND_TEST(

packages/tpetra/CMakeLists.txt

+1-11
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@ IF (Tpetra_ENABLE_CUDA AND (NOT Kokkos_ENABLE_CUDA))
6060
MESSAGE (FATAL_ERROR "You set Tpetra_ENABLE_CUDA:BOOL=ON, but Kokkos_ENABLE_CUDA is OFF. TPL_ENABLE_CUDA and Kokkos_ENABLE_CUDA must both be ON before you may set Tpetra_ENABLE_CUDA:BOOL=ON.")
6161
ENDIF ()
6262

63-
# Kokkos and Tpetra require C++11 as of the 12.0 release.
64-
#
65-
# I left a special case for CUDA because I'm not sure whether TriBITS
66-
# counts C++11 as enabled in that case; please feel free to revise if
67-
# you know better.
68-
ASSERT_DEFINED(${PROJECT_NAME}_ENABLE_CXX11)
69-
IF (NOT ${PROJECT_NAME}_ENABLE_CXX11 AND NOT Tpetra_ENABLE_CUDA)
70-
MESSAGE(FATAL_ERROR "As of Trilinos 12.0, C++11 is REQUIRED when building Kokkos and its downstream packages, which include Tpetra. You MUST enable C++11 when building these packages. Trilinos should enable this by default, if your C++11 compiler supports C++11 (that is, if it's not too old). If you set ${PROJECT_NAME}_ENABLE_CXX11=OFF, then you are disabling C++11. DON'T DO THAT if you want to build Kokkos or its downstream packages, including Tpetra. If you aren't happy about that, then you need to disable Kokkos explicitly, by setting ${PROJECT_NAME}_ENABLE_Kokkos=OFF. This WILL disable Tpetra and its downstream packages.")
71-
ENDIF ()
72-
7363
# Checks that only matter if building with CUDA enabled.
7464
IF (Tpetra_ENABLE_CUDA)
7565
# As of 10 Aug 2017, Tpetra requires CUDA >= 7.5.
@@ -96,7 +86,7 @@ IF (Tpetra_ENABLE_CUDA)
9686
# SET(TpetraCore_FOUND_CUDA_LAMBDA_FLAG ON)
9787
#ENDIF ()
9888
#IF (NOT TpetraCore_FOUND_CUDA_LAMBDA_FLAG)
99-
# MESSAGE (FATAL_ERROR "If building with CUDA, Tpetra and downstream packages require, at least with CUDA_VERSION >= 7.5 and <= 9.0, that you add \"--expt-extended-lambda\" to either Trilinos_CXX11_FLAGS or CMAKE_CXX_FLAGS. You must also set Kokkos_ENABLE_CUDA_LAMBDA:BOOL=ON, if it is not already ON by default.")
89+
# MESSAGE (FATAL_ERROR "If building with CUDA, Tpetra and downstream packages require, at least with CUDA_VERSION >= 7.5 and <= 9.0, that you add \"--expt-extended-lambda\" to CMAKE_CXX_FLAGS. You must also set Kokkos_ENABLE_CUDA_LAMBDA:BOOL=ON, if it is not already ON by default.")
10090
#ENDIF ()
10191

10292
IF (NOT DEFINED Kokkos_ENABLE_CUDA_LAMBDA OR NOT Kokkos_ENABLE_CUDA_LAMBDA)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
ASSERT_DEFINED (${PROJECT_NAME}_ENABLE_CXX11)
2-
3-
IF (${PROJECT_NAME}_ENABLE_CXX11)
41
IF (Tpetra_INST_DOUBLE)
52
TRIBITS_ADD_EXECUTABLE_AND_TEST(
63
lesson07_kokkos_fill
@@ -10,4 +7,3 @@ IF (Tpetra_INST_DOUBLE)
107
STANDARD_PASS_OUTPUT
118
)
129
ENDIF ()
13-
ENDIF ()

packages/tpetra/doc/FAQ.txt

+1-9
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,11 @@ variables that you would normally set:
124124
-D TPL_ENABLE_CUDA:BOOL=ON
125125
-D Kokkos_ENABLE_Cuda_UVM:BOOL=ON
126126
-D Kokkos_ENABLE_Cuda_Lambda:BOOL=ON
127-
-D Trilinos_CXX11_FLAGS:STRING="-std=c++11 -expt-extended-lambda"
128127
#+END_EXAMPLE
129128

130129
If you already define ~CMAKE_CXX_FLAGS~ yourself, just make sure that
131130
you include the above options. If the versions of ~nvcc~ and ~mpicxx~
132-
that live in your path are correct, then this should work. The
133-
~-std=c++11~ option is required, though it may cause harmless build
134-
warnings that look like this:
135-
136-
#+BEGIN_EXAMPLE
137-
cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++
138-
but not for C [enabled by default]
139-
#+END_EXAMPLE
131+
that live in your path are correct, then this should work.
140132

141133
If you enable CUDA using the above instructions, Kokkos will enable
142134
its CUDA support by default. If Kokkos enables its CUDA support,

packages/trilinoscouplings/examples/fenl/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IF (TrilinosCouplings_ENABLE_Tpetra AND Tpetra_Have_Kokkos_Refactor AND ${PROJECT_NAME}_ENABLE_CXX11)
1+
IF (TrilinosCouplings_ENABLE_Tpetra AND Tpetra_Have_Kokkos_Refactor)
22

33
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
44
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)